saurav2008 Posted February 21, 2017 Share Posted February 21, 2017 I have an object I an clicking by doing obstacle = objects.closest(27985); obstacle.interact("Climb"); However, this object is directly next to another object and it often misclicks the wrong obstacle. How can I stop from misclicking the wrong object? I have tried to have the code stop and stand still before trying to interact with the object, but it still can misclick. Any snippets to help? Quote Link to comment Share on other sites More sharing options...
Prozen Posted February 21, 2017 Share Posted February 21, 2017 The two objects next to each other don't have the same id right? Also note you shouldn't use ids for objects as ids change every update, causing your script to break. Quote Link to comment Share on other sites More sharing options...
saurav2008 Posted February 21, 2017 Author Share Posted February 21, 2017 They don't have the same Id. Didn't know that thanks for tip. Quote Link to comment Share on other sites More sharing options...
Sphiinx Posted February 22, 2017 Share Posted February 22, 2017 10 hours ago, saurav2008 said: They don't have the same Id. Didn't know that thanks for tip. Did you attempt to use a String rather than an ID? If you have, did this seem to fix your issue? Quote Link to comment Share on other sites More sharing options...
saurav2008 Posted February 23, 2017 Author Share Posted February 23, 2017 (edited) 20 hours ago, Sphiinx said: Did you attempt to use a String rather than an ID? If you have, did this seem to fix your issue? I did, and no that did not fix the issue. If it helps to mention, its the climbing rocks shortcut on zeah between mining spot and dark altar. Edited February 23, 2017 by saurav2008 Quote Link to comment Share on other sites More sharing options...
Butters Posted February 23, 2017 Share Posted February 23, 2017 (edited) On 2/22/2017 at 1:12 AM, saurav2008 said: I have an object I an clicking by doing obstacle = objects.closest(27985); obstacle.interact("Climb"); However, this object is directly next to another object and it often misclicks the wrong obstacle. How can I stop from misclicking the wrong object? I have tried to have the code stop and stand still before trying to interact with the object, but it still can misclick. Any snippets to help? Try to get your object by position. Write a filter something like RS2Object ladder = s.objects.closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return obj.getName().equals("Ladder") && obj.hasAction("Climb-Up") && obj.getPosition().getX() >= X_COORDINATE; } }); And also you can add a fail-safe if he accidentally still misclicks. Something like if you're in an area that you don't want to be in - climb back up and try again On 2/22/2017 at 1:30 AM, Prozen said: The two objects next to each other don't have the same id right? Also note you shouldn't use ids for objects as ids change every update, causing your script to break. Lol they don't change id's each update But yeah, you're right, bad practice. Edited February 23, 2017 by nosepicker Quote Link to comment Share on other sites More sharing options...
Sphiinx Posted February 23, 2017 Share Posted February 23, 2017 1 hour ago, nosepicker said: Lol they don't change id's each update But yeah, you're right, bad practice. 1 Not all object ID's get changed each update of course, although they do change object ID's, in general, each update. Quote Link to comment Share on other sites More sharing options...
Team Cape Posted February 23, 2017 Share Posted February 23, 2017 click slightly outside of the boundingbox at random times (dont set a specific radius though, or else your clicks will just model the outline of the shape). Quote Link to comment Share on other sites More sharing options...
Prozen Posted February 23, 2017 Share Posted February 23, 2017 11 hours ago, nosepicker said: Try to get your object by position. Write a filter something like RS2Object ladder = s.objects.closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return obj.getName().equals("Ladder") && obj.hasAction("Climb-Up") && obj.getPosition().getX() >= X_COORDINATE; } }); And also you can add a fail-safe if he accidentally still misclicks. Something like if you're in an area that you don't want to be in - climb back up and try again Lol they don't change id's each update But yeah, you're right, bad practice. A lot of objects ids get changed nearly every update. Quote Link to comment Share on other sites More sharing options...