IkiritokunI Posted November 3, 2018 Share Posted November 3, 2018 Dear great community Making my first script, can any1 help me with this loot state? Just writed the loot state and found a bug (when loot is out of screen) So he can't get the interact ''take'' but is true on minimap I want it the bot get to the loot. but I can not find the webwalk for it. Any1 can help me? private void loot() { final GroundItem BlueWizardHeadOrBeads = getGroundItems().closest(579); if (BlueWizardHeadOrBeads != null && BlueWizardHeadOrBeads.isVisible() && BlueWizardHeadOrBeads.interact("Take")){ new ConditionalSleep(2000) { @Override public boolean condition() throws InterruptedException { return !BlueWizardHeadOrBeads.exists(); } }.sleep(); } else } } } Quote Link to comment Share on other sites More sharing options...
H0rn Posted November 3, 2018 Share Posted November 3, 2018 You should definitely consider using names instead of ID's for things like this, much easier for you to understand and correct errors when you read over it again. GroundItem hat = getGroundItems().closest("Blue wizard hat"); if (hat != null) { InteractionEvent pickup = new InteractionEvent(hat,"Take"); pickup.setWalkTo(true); execute(pickup); } (Code was written in the browser & not tested) You can use interaction events to walk to items, I wouldn't rely on it too heavily though. There's also a lot of other things you can use InteractionEvents for, you should use this page on the API to see this. https://osbot.org/api/org/osbot/rs07/event/InteractionEvent.html Quote Link to comment Share on other sites More sharing options...
IkiritokunI Posted November 3, 2018 Author Share Posted November 3, 2018 Thanks for sharing will take a look into it! Quote Link to comment Share on other sites More sharing options...