Jump to content

How to close a widget ? [Need Help]


Ornamental

Recommended Posts

firstly, determine the current widget you want to interact with. This being your Close button.

 

do this like this --> 

RS2Widget closebutton = getWidgets().get(firstchild, secondchild);

to get your firstchild and secondchild, use the widgetdebugger in the client and hover over the close button

 

then, once you've determined your widget, check if your widget is there/is visible.

do this like this -->

if (closebutton != null && closebutton.isVisible()){

}

now, you need to tell it to interact with that widget and its current available actions

 

This would be like this i guess, i'm not if its exactly "Close" so please check it yourself -->

closebutton.interact("Close");

Your final piece of code would be -->

RS2Widget closebutton = getWidgets().get(firstchild, secondchild);

if (closebutton != null && closebutton.isVisible()){
    closebutton.interact("Close");
}






Edited by Eagle Scripts
  • Like 1
Link to comment
Share on other sites

 

firstly, determine the current widget you want to interact with. This being your Close button.

 

do this like this --> 

RS2Widget closebutton = getWidgets().get(firstchild, secondchild);

to get your firstchild and secondchild, use the widgetdebugger in the client and hover over the close button

 

then, once you've determined your widget, check if your widget is there/is visible.

do this like this -->

if (closebutton != null && closebutton.isVisible()){

}

now, you need to tell it to interact with that widget and its current available actions

 

This would be like this i guess, i'm not if its exactly "Close" so please check it yourself -->

closebutton.interact("Close");

Your final piece of code would be -->

RS2Widget closebutton = getWidgets().get(firstchild, secondchild);

if (closebutton != null && closebutton.isVisible()){
    closebutton.interact("Close");
}






Thanks alot bro ! 

  • Like 1
Link to comment
Share on other sites

I'm not quite sure if a Quest script is the kind of script you should be working on. Assuming from the 5 threads you have asking for scripting help, I would suggest you to get used to the API first, and Java if your knowledge isn't enough to cover most simple issues you could walk into. (which would happen anyway)

Now to your issue since I'm working on a quest script to:

There is no good reason why you would actually close a interface like that. Most players simply click somewhere on the minimap to follow their path to a bank or whatever. It's not human-like at all. Rather just do whatever is next for the script to do or just logout after some random short time. (not instantly because that's not really human-like either.)

Good luck.

Link to comment
Share on other sites

getWidgets().closeOpenInterface();


I'm not quite sure if a Quest script is the kind of script you should be working on. Assuming from the 5 threads you have asking for scripting help, I would suggest you to get used to the API first, and Java if your knowledge isn't enough to cover most simple issues you could walk into. (which would happen anyway)

Now to your issue since I'm working on a quest script to:
There is no good reason why you would actually close a interface like that. Most players simply click somewhere on the minimap to follow their path to a bank or whatever. It's not human-like at all. Rather just do whatever is next for the script to do or just logout after some random short time. (not instantly because that's not really human-like either.)

Good luck.

 

imo any script is a good place to start. questing scripts are fine to start with if the person understands how to use configs.

 

as for your theory on the bot actions, below are what some bot devs think jagex looks at, not what you're talking about. jagex could probably care less if you click the x to close or not. they're more worried about where you're clicking, how fast you're clicking/reacting, etc. see examples below

 

botlike:

675593585222768e2fd310d0da535641.png

 

humanlike:

526c51cd98bbce33ada8c47e0d3be858.png
 

Edited by Shiny
  • Like 3
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...