Kramnik Posted July 20, 2019 Share Posted July 20, 2019 (edited) Hi, very strange for me why bot is not interacting with widget. Want to make script for leveling up herblore. But somehow bot doesn't find the widget. It is not the first time I write something like this and everything went great. This time I made everything identical but it cant find the widget. Any help? RS2Widget herb = getWidgets().get(270,14, 29); sleep(1000); if(herb!= null){ log("Widget found"); } else{ log("Widget not found"); } if(herb != null) herb.interact(); EDIT: Found mistake. Didn't even though it could be it. In other similar scripts I used sleep(700) and for this one I used sleep(500), so it didn't read the widget that quickly. Since I already made this so for it not to be useless maybe any tips regarding sleeps? How much sleep would you have used in my case? Edited July 20, 2019 by Kramnik Quote Link to comment Share on other sites More sharing options...
zwaffel Posted July 20, 2019 Share Posted July 20, 2019 (edited) 270, 14, 38 should work. Edit: also make sure the widget is visible before retrieving it. Edited July 20, 2019 by zwaffel Quote Link to comment Share on other sites More sharing options...
Token Posted July 20, 2019 Share Posted July 20, 2019 The sleep interval is irrelevant. If it's on mirror mode then it may be a mirror mode related issue. If that's only a section of your code then the problem lies elsewhere. Quote Link to comment Share on other sites More sharing options...
Hybris Posted July 20, 2019 Share Posted July 20, 2019 Before looking for the herb do a conditional sleep until that screen is open. https://osbot.org/forum/topic/127193-conditional-sleep-with-lambda-expressions/ 1 Quote Link to comment Share on other sites More sharing options...
Kramnik Posted July 20, 2019 Author Share Posted July 20, 2019 43 minutes ago, Token said: The sleep interval is irrelevant. If it's on mirror mode then it may be a mirror mode related issue. If that's only a section of your code then the problem lies elsewhere. But changing interval from 500 to 800 fixed everything I am on injection mode Quote Link to comment Share on other sites More sharing options...
Token Posted July 20, 2019 Share Posted July 20, 2019 5 minutes ago, Kramnik said: But changing interval from 500 to 800 fixed everything I am on injection mode Then you have an error elsewhere in the code 1 Quote Link to comment Share on other sites More sharing options...
Gunman Posted July 20, 2019 Share Posted July 20, 2019 1 hour ago, Hybris said: Before looking for the herb do a conditional sleep until that screen is open. https://osbot.org/forum/topic/127193-conditional-sleep-with-lambda-expressions/ 58 minutes ago, Kramnik said: But changing interval from 500 to 800 fixed everything I am on injection mode I Agree with Hybris. Use a conditional sleep. Quote Link to comment Share on other sites More sharing options...
Norscax Posted July 20, 2019 Share Posted July 20, 2019 use 9 + 10 = 21 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted July 20, 2019 Share Posted July 20, 2019 why widget when you can press 1 on the keyboard? Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted July 20, 2019 Share Posted July 20, 2019 2 hours ago, Chris said: why widget when you can press 1 on the keyboard? 44 minutes ago, Malcolm said: This. Wouldn't you still want to check the widget was up before pressing 1 Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted July 20, 2019 Share Posted July 20, 2019 24 minutes ago, Malcolm said: Yes, check the sprite instead of using child widgets Then why not tell him that The guy can't figure out widgets, tell him to press 1 and he'll be spending his botting days typing 1111111111111111111111111111111111111111111111111111 in game Quote Link to comment Share on other sites More sharing options...