Twin Posted February 22, 2015 Posted February 22, 2015 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.
Novak Posted February 22, 2015 Posted February 22, 2015 (edited) interfaces use the debugger in the client Edited February 22, 2015 by Novak
Extreme Scripts Posted February 22, 2015 Posted February 22, 2015 You need to grab the interface id's for each and interact with them. Use the interface debugger.
Khaleesi Posted February 22, 2015 Posted February 22, 2015 (edited) RS2Interface(parent) and RS2InterfaceChild(child, grandchild) Basicly: A parent is a collection of childs and grandchilds. A child can be a collection of grandchilds Edited February 22, 2015 by Khaleesi
Twin Posted February 22, 2015 Author Posted February 22, 2015 You need to grab the interface id's for each and interact with them. Use the interface debugger. So would It be something likeEntity furnace = objects.closest("Furnace"); furnace.interact("Smith"); Furnace.interact(Id of option after first click goes here?); RS2Interface(parent) and RS2InterfaceChild(child, grandchild) 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 clientWill 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
Khaleesi Posted February 22, 2015 Posted February 22, 2015 (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 You can use the interface debugger for that! Edited February 22, 2015 by Khaleesi
Twin Posted February 22, 2015 Author Posted February 22, 2015 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 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.
Khaleesi Posted February 23, 2015 Posted February 23, 2015 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