DankFish Posted October 14, 2015 Share Posted October 14, 2015 Hey everyone! I'm new to scripting but it seems very straight forward as I used to script for scar/simba. I am currently working on an edgeville cball maker and I can't for the life of me figure out how to handle the chatbox after using the steel bar on the furnace. Any help will be appreciated. Quote Link to comment Share on other sites More sharing options...
Chris Posted October 14, 2015 Share Posted October 14, 2015 http://osbot.org/api/org/osbot/rs07/api/Widgets.html Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted October 14, 2015 Share Posted October 14, 2015 (edited) Use Widgets 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 Khaleesi Edited October 14, 2015 by Khaleesi Scripts Quote Link to comment Share on other sites More sharing options...
DankFish Posted October 14, 2015 Author Share Posted October 14, 2015 (edited) Thank you very much! Edit: How would I terminate the script should the user not have an ammo mould in their inventory? Edited October 14, 2015 by DankFish Quote Link to comment Share on other sites More sharing options...
Precise Posted October 14, 2015 Share Posted October 14, 2015 Thank you very much! Edit: How would I terminate the script should the user not have an ammo mould in their inventory? If(!this.getInventory().contains(ammo name here)) stop(); On phone so please excuse typos etc. 1 Quote Link to comment Share on other sites More sharing options...
Tom Posted October 14, 2015 Share Posted October 14, 2015 Use Widgets 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 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 Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted October 14, 2015 Share Posted October 14, 2015 (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 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 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 October 14, 2015 by Khaleesi Scripts Quote Link to comment Share on other sites More sharing options...
Littlewayne Posted October 14, 2015 Share Posted October 14, 2015 Look at all of these nice scripters helping out ;) Quote Link to comment Share on other sites More sharing options...
Paradox68 Posted October 14, 2015 Share Posted October 14, 2015 I don't know why you made a thread dude, If you saw I responded to your PM about my Cannonball smelter with a very detailed guide (including pictures) that explains how to use Widget interactions to achieve what you're trying to do. 1 Quote Link to comment Share on other sites More sharing options...