Jump to content

How to close a widget ? [Need Help]


Recommended Posts

Posted (edited)

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
Posted

 

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
Posted

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.

Posted (edited)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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