dreameo Posted July 22, 2017 Share Posted July 22, 2017 Didn't see an interact method between item and entity. Here's an example (can overload to accept String) : Does not check for item Does not check for entity returns true on interaction between item and entity Spoiler private boolean useOn(int itemID, Entity e) throws InterruptedException { if(getInventory().getItem(itemID).interact("Use")) { new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return getInventory().isItemSelected(); } }.sleep(); sleep(random.nextInt(500) + 800); return e.interact("Use"); } return false; } Quote Link to comment Share on other sites More sharing options...
OSRSPsycheDelic Posted July 22, 2017 Share Posted July 22, 2017 (edited) sleep(random.nextInt(500) + 800); Don't do this! Also you should check if there is a current item selected and if it is the correct one otherwise click to deselect it. .. Also use item names over IDs ^^ Edited July 22, 2017 by OSRSPsycheDelic 1 Quote Link to comment Share on other sites More sharing options...
dreameo Posted July 22, 2017 Author Share Posted July 22, 2017 (edited) The purpose of sleep is to avoid instantaneous reaction. Otherwise, explain your reasoning. The behavior of the method is to interact, not check. As mentioned, overloading is doable. Edited July 22, 2017 by dreameo Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted July 22, 2017 Share Posted July 22, 2017 6 minutes ago, dreameo said: The purpose of sleep is to avoid instantaneous reaction. Otherwise, explain your reasoning. The behavior of the method is to interact, not check. As mentioned, overloading is doable. If you're aiming for a script on the SDN Alek doesn't support for random numbers/sleeps unless you have a strict math background and have valid reasoning. For private scripts though it's personal preference on your part. Quote Link to comment Share on other sites More sharing options...
dreameo Posted July 22, 2017 Author Share Posted July 22, 2017 I'm not aiming for the SDN, however, it is allowed. IS NOT ALLOWED: Quote -Scripts that randomize sleep whose bounds are 25% within the mean or less than 250ms Which does not apply 1 Quote Link to comment Share on other sites More sharing options...
OSRSPsycheDelic Posted July 23, 2017 Share Posted July 23, 2017 (edited) 11 hours ago, dreameo said: The purpose of sleep is to avoid instantaneous reaction. Otherwise, explain your reasoning. The behavior of the method is to interact, not check. As mentioned, overloading is doable. Alek has multiple posts explaining that sleeps such as the one you have included are not a good idea and are possibly worse than not including them at all, Basically you can plot these sleeps and see a trend which pretty much gives away "bot like behavior" if Jagex wanted to look at it. Secondly yes i understand that the method you wrote is to interact however it also makes sense to include simple checks rather than having to include them multiple times in your code before calling this method, after all that is why we use methods to rerun code without having to rewrite it many times I'm simply chucking constructive criticism at you try to help! Edited July 23, 2017 by OSRSPsycheDelic Quote Link to comment Share on other sites More sharing options...
dreameo Posted July 23, 2017 Author Share Posted July 23, 2017 I understand alek may have posted explaining but, you still haven't given me a valid reason. Saying that its more 'bot like' doesn't prove anything. And yes, I keep behavior strictly to what the method does. Same as the interact method in osbot, you must first check to see if an entity is not null and visible before you interact, it's not the responsibility of the interact method to do that. Simply creating a method to check beforehand is what you're looking for. I never rejected your criticism, i'm asking for clarification. Quote Link to comment Share on other sites More sharing options...