October 14, 201510 yr 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.
October 14, 201510 yr 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, 201510 yr by Khaleesi Scripts
October 14, 201510 yr Author 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, 201510 yr by DankFish
October 14, 201510 yr 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.
October 14, 201510 yr 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
October 14, 201510 yr 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, 201510 yr by Khaleesi Scripts
October 14, 201510 yr 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.
Create an account or sign in to comment