jordyownn 2 Posted December 18, 2016 if(FurnaceArea.contains(getLocalPlayer())){ GameObject Furnace = getGameObjects().closest("Furnace"); if (Furnace != null) { sleepUntil(() -> getInventory().get("Bucket of sand").useOn(Furnace), 10000); WidgetChild child = getWidgets().getWidgetChildrenContainingText("Molten glass").get(0); if (child.isVisible() && child != null) { child.interact("Make All"); } } } else { if (getWalking().walk(FurnaceArea.getCenter())) { sleep(Calculations.random(3000,6000)); } } Hi, I am a new scripter, this is my first script. I'm experiecing some problems correctly waiting untill things have happend. I am standing at the Furnace with the correct supplies in my inventory. I use the Bucket of sand on the furnace, but the script automaticly spams this action, how do i make the script verify that that action is correctly executed? And then ofcourse not do that same action again! Next, how do i check that the Furnace interaction bar is visible i tried checking if child.isVisible() but this doesn't seem to work properly. Thanks in advance, Jordy
rexas 12 Posted December 18, 2016 You should use sleep while your inventory has bucket of sand. For example: if (child.isVisible() && child != null) { if (child.interact("Make All")) { sleepWhile( () -> getInventory().contains("Bucket of sand"), Calculations.random(35000, 40000)); } }
Hashtag 9071 Posted December 18, 2016 You also might want to sleep until you are in dialogue (I assume making molten glass gives exp) to avoid the script waiting for dozens of seconds in the level up screen.
Mood 4 Posted December 18, 2016 You also might want to sleep until you are in dialogue (I assume making molten glass gives exp) to avoid the script waiting for dozens of seconds in the level up screen. this
Cardozz 46 Posted December 18, 2016 You should use sleep while your inventory has bucket of sand. For example: if (child.isVisible() && child != null) { if (child.interact("Make All")) { sleepWhile( () -> getInventory().contains("Bucket of sand"), Calculations.random(35000, 40000)); } } you forgot the exclamation mark in the sleepWhile() method.
rexas 12 Posted December 18, 2016 you forgot the exclamation mark in the sleepWhile() method. I believe it sleeps while condition is true. It it were sleepUntil() then the mark would be needed.
Cardozz 46 Posted December 18, 2016 I believe it sleeps while condition is true. It it were sleepUntil() then the mark would be needed. You're damn right, my bad
Recommended Posts
Archived
This topic is now archived and is closed to further replies.