Jump to content

Chatbox right click, choose all.


Recommended Posts

Posted (edited)

Use Widgets smile.png

int parent = 200;
int child = 85;
RS2Widget child = script.getWidgets().get(parent, child);

if(child!= null && child.isVisible()){
   String action = "Make 10";
   child.interact(action);
}

Should be something like this ^

Enable the widgets debugger to find the parent,child id's biggrin.png

 

Khaleesi

Edited by Khaleesi Scripts
Posted

Use Widgets smile.png

int parent = 200;
int child = 85;
RS2Widget child = script.getWidgets().get(200, 85);

if(child!= null && child.isVisible()){
   String action = "Make 10";
   child.interact(action);
}

Should be something like this ^

Enable the widgets debugger to find the parent,child id's biggrin.png

 

Khaleesi

 

 

Shouldn't be creating a string object everytime the code is ran,

child.interact("Make 10"); is going to be more efficient in this situation, 

 

http://examples.javacodegeeks.com/core-java/lang/string/java-string-pool-example/

could work both ways though, i just see less lines being better

Posted (edited)

Shouldn't be creating a string object everytime the code is ran,

child.interact("Make 10"); is going to be more efficient in this situation, 

 

http://examples.javacodegeeks.com/core-java/lang/string/java-string-pool-example/

could work both ways though, i just see less lines being better

 

Doesn't really matter though smile.png

Compiler will do the rest.

 

I just did this to show him an example with the names(Parent, child and action).

makes it a bit more clear then just inputting numbers in a function ^^

 

but you're right, you can just put the numbers/text in the function instead of creating an variable or an object smile.png

 

If(!this.getInventory().contains(ammo name here))

stop();

On phone so please excuse typos etc.

 

Phone coding OP, took me 5 min to typ the code above lol -_-

The auto correct is so stronk -_-

Edited by Khaleesi Scripts

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...