jordyownn 2 Share 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 Link to comment Share on other sites More sharing options...
rexas 12 Share 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)); } } Link to comment Share on other sites More sharing options...
Hashtag 8670 Share 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. Link to comment Share on other sites More sharing options...
Mood 4 Share 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 Link to comment Share on other sites More sharing options...
Cardozz 46 Share 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. Link to comment Share on other sites More sharing options...
rexas 12 Share 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. Link to comment Share on other sites More sharing options...
Cardozz 46 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.