February 21, 20178 yr 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?
February 21, 20178 yr 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.
February 22, 20178 yr 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?
February 23, 20178 yr Author 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, 20178 yr by saurav2008
February 23, 20178 yr 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, 20178 yr by nosepicker
February 23, 20178 yr 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.
February 23, 20178 yr 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).
February 23, 20178 yr 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.
Create an account or sign in to comment