Jump to content

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


Twin

Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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 :)

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