Jump to content

How to use options on furnace after it's clicked?


Recommended Posts

Posted

So when you click smelt on a furnace, it brings up a bunch of options like bronze, blurite, iron, all of that. How do I have the bot click on one of those, Can't seem to figure it out and have no idea where to look in the api. I thought it might be interfaces but I didn't know what it meant by parent/child.

Posted

You need to grab the interface id's for each and interact with them.

Use the interface debugger.

So would It be something like

Entity furnace = objects.closest("Furnace");

furnace.interact("Smith");

Furnace.interact(Id of option after first click goes here?);

RS2Interface(parent) and RS2InterfaceChild(child, grandchild) wink.png

Basicly:

A parent is a collection of childs and grandchilds.

A child can be a collection of grandchilds

So a parent is the main interface, once clicked that becomes the child, and if that's clicked it becomes the grandchild?

interfaces use the debugger in the client

Will it tell me the ID then of the option I want to click? I was messing around with that yesterday on the spinning wheel and couldn't figure it out
Posted (edited)

So would It be something like

Entity furnace = objects.closest("Furnace");

furnace.interact("Smith");

Furnace.interact(Id of option after first click goes here?);

So a parent is the main interface, once clicked that becomes the child, and if that's clicked it becomes the grandchild?

 

Basicly you can do: (Just a quick example)

RS2Interface parent = script.interfaces.get(582);
   if(parent != null){
      RS2InterfaceChild child = parent.getChild(4);
      if(child != null)
         child.interact("Make 10");
}	

You only have to get the right ID's fromt the furnance text in chatbox wink.png

You can use the interface debugger for that!

Edited by Khaleesi
Posted

Basicly you can do: (Just a quick example)

RS2Interface parent = script.interfaces.get(582);   if(parent != null){      RS2InterfaceChild child = parent.getChild(4);      if(child != null)         child.interact("Make 10");}
You only have to get the right ID's fromt the furnance text in chatbox wink.png

You can use the interface debugger for that!

So then it is the main interface is the parent, and the different clickable options are the children? And I'm assuming when you say it's not null, that means the text is black and not red? Thanks for the replies by the way, definatly cleared some confusion up.
Posted

So then it is the main interface is the parent, and the different clickable options are the children? And I'm assuming when you say it's not null, that means the text is black and not red? Thanks for the replies by the way, definatly cleared some confusion up.

 

Just testing if it exists ... could be that the child could nto be loaded and returned null.

Then a npe would be thrown if you try to interact.

 

It's smart to always null check an object, npc, ... before trying to interact with them.

This will stop your script from jamming :)

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