April 22, 20169 yr What I'm trying to do: -Two objects are a few tiles apart -Both have the same ID until you click on one and changes -Interact with one, sleep till the ID is changed, interact with the other, sleep, and repeat What I'm having trouble is with how would I differentiate that object ID is changed? I already have defined both IDs of the object but not sure how to compare them. I would think if i had a CondSleep -> return player.animating; it kind of spam clicks the object because it hasn't changed yet. So with that, I think I need a better sleep, or could i just do sleep(int);
April 22, 20169 yr What I'm trying to do: -Two objects are a few tiles apart -Both have the same ID until you click on one and changes -Interact with one, sleep till the ID is changed, interact with the other, sleep, and repeat What I'm having trouble is with how would I differentiate that object ID is changed? I already have defined both IDs of the object but not sure how to compare them. I would think if i had a CondSleep -> return player.animating; it kind of spam clicks the object because it hasn't changed yet. So with that, I think I need a better sleep, or could i just do sleep(int); ID? why not string name? ID? why not string name? nvm xD
April 22, 20169 yr RS2Object object1 = getObjects().closest(o -> o.getId() == 1 && o.getPosition().getX() == 1 && o.getPosition().getY() == 1); RS2Object object2 = getObjects().closest(o -> o.getId() == 2 && o.getPosition().getX() == 2 && o.getPosition().getY() == 2); if (object1 != null) { //interact with object1 } else { if (object2 != null) { //interact with object2 } Edited April 22, 20169 yr by iJodix
April 22, 20169 yr Author RS2Object object1 = getObjects().closest(o -> o.getId() == 1 && o.getPosition().getX() == 1 && o.getPosition().getY() == 1); RS2Object object2 = getObjects().closest(o -> o.getId() == 2 && o.getPosition().getX() == 2 && o.getPosition().getY() == 2); if (object1 != null) { //interact with object1 } else { if (object2 != null) { //interact with object2 } thx
April 23, 20169 yr RS2Object obj = blah ConditionalSleep -> return obj.getId() == the changed id If the objects are not moving position, use the x and y coordinates as iJodix suggested to retrieve a certain object.
Create an account or sign in to comment