Jump to content

Wtf why widget not working?


Kramnik

Recommended Posts

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?

 

image.png.e1df9e13efe3a2ed6dadaf71ebaa8eca.png

Edited by Kramnik
Link to comment
Share on other sites

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 :D I am on injection mode

I Agree with Hybris. Use a conditional sleep.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...