Speakmore Posted April 16, 2013 Share Posted April 16, 2013 Hey guys, I'm currently working on my first ever script and I've run into a roadblock. I would like to know how to pick up items on the ground, and then the next closest, until my inventory is filled. For example: If I was making a script that sat at cows and picked up Cowhides. I would like to know how to pick that cowhide up and the next closest one, until 28. But I don't want the raw meat or bones!! Thanks Link to comment Share on other sites More sharing options...
Brainfree Posted April 16, 2013 Share Posted April 16, 2013 (edited) When the API (located on the top banner) is seemingly fixed, look over it. It has documentation on how each method within the API works, along with the required parameters. You could also import it into your IDE if you so wished, but that's a little extreme for your situation. But right now that's all I have to to suggest to you before I pass out on my bed. -Night all. Edited April 16, 2013 by Brainfree Link to comment Share on other sites More sharing options...
Speakmore Posted April 16, 2013 Author Share Posted April 16, 2013 When the API (located on the top banner) is seemingly fixed, look over it. It has documentation on how each method within the API works, along with the required parameters. You could also import it into your IDE if you so wished, but that's a little extreme for your situation. But right now that's all I have to to suggest to you before I pass out on my bed. -Night all. Believe me, I looked it over. For a solid 2 hours, couldn't get it to work. Please note, I started scripting today, so I don't know a lot ! Link to comment Share on other sites More sharing options...
Brainfree Posted April 16, 2013 Share Posted April 16, 2013 (edited) Believe me, I looked it over. For a solid 2 hours, couldn't get it to work. Please note, I started scripting today, so I don't know a lot ! Look over scripts on the forms, it's how I first started out. Even if it's honest Copy and Pasting, if it works, it works. But I'm sure you're more for the knowledge, so I would suggest studying multiple implementations of your desired methods, and see how there used, and how they are structured into any given script. Edited April 16, 2013 by Brainfree Link to comment Share on other sites More sharing options...
Speakmore Posted April 16, 2013 Author Share Posted April 16, 2013 Look over scripts on the forms, it's how I first started out. Even if it's honest Copy and Pasting, if it works, it works. But I'm sure you're more for the knowledge, so I would suggest studying multiple implementations of your desired methods, and see how there used, and structured into any given script. I'll be glad to check again, but is there any scripts that pick up items. I'll go look, I think we may have a chicken killer... Let me check!!! Link to comment Share on other sites More sharing options...
daniel Posted April 16, 2013 Share Posted April 16, 2013 Add me on skype: daooof Link to comment Share on other sites More sharing options...
Speakmore Posted April 16, 2013 Author Share Posted April 16, 2013 Add me on skype: daooof Added! Link to comment Share on other sites More sharing options...
Link Posted April 16, 2013 Share Posted April 16, 2013 Haven't tested it yet but this might work closestGroundItem(ID).interact("Take") Link to comment Share on other sites More sharing options...
zeejfps Posted April 16, 2013 Share Posted April 16, 2013 GroundItem cowhide = closestGroundItem(cowhideID);If(cowhide.exists()){ selectOption(cowhide, cowhide.getMouseDestination(), "Take");} Put this inside a method, i typed this on my ipad so errors are possible Link to comment Share on other sites More sharing options...
Speakmore Posted April 16, 2013 Author Share Posted April 16, 2013 (edited) Haven't tested it yet but this might work closestGroundItem(ID).interact("Take") Okay, so I used what you typed out here, with some if's however, and the only thing I'm noticing is that: It'll actually walk by like 6+ of the items, to go pick up one that is definitely further away than the 6+ it walks over XD So that really is slowing down the process, not to mention the amount of miss-clicks on the item is a killer too -___- Is there any way to make it not miss-click the item, I mean.... Here is my code: if(!client.getInventory().isFull()){ log("Picking Item.") closestGroundItem(item).getPosition() if(client.getMyPlayer().getPosition().distance(closestGroundItem(item).getPosition()) < 2){ closestGroundItem(item).interact("Take") }else{ walk(closestGroundItem(item).getPosition()) return 1000 } } if(client.getInventory().isFull()){ log("Are you serious.") state = State.TODOOR return 1000 } I replaced the actual item with "item" so no one makes the script ^_^ Edited April 16, 2013 by Speakmore Link to comment Share on other sites More sharing options...
GoldenGates Posted April 16, 2013 Share Posted April 16, 2013 Just wait for the API to be updated in next release, things should be slightly smoother. Link to comment Share on other sites More sharing options...