Smokeyjay 1 Share Posted March 22, 2020 Hey guys I'm fairly new to Dreambot Scripting but I have a decent background in Java. I was wondering if anyone could recommend some tips on how to make my code more ban-proof. I understand that setting sleep timers, taking breaks, etc are all helpful. But, does adjusting the camera, switching worlds and other things help? Appreciate it! @Override public int onLoop() { if(getInventory().contains("Grapes") && getInventory().contains("Jug of water") && !getBank().isOpen()) { getInventory().get("Grapes").useOn("Jug of water"); getWidgets().getWidgetChild(270, 14, 38).interact(); sleepWhile( () -> getInventory().contains("Grapes"), Calculations.random(20000, 25000)); } else if (getBank().isOpen()) { if(getInventory().contains("Jug of wine") || getInventory().contains("Unfermented wine")) { getBank().depositAllItems(); sleepWhile( () -> getBank().isOpen(), Calculations.random(1000, 5000)); } else if (!getInventory().contains("Jug of water")) { getBank().withdraw("Jug of water", 14); sleepWhile( () -> getBank().isOpen(), Calculations.random(1000, 5000)); } else if (!getInventory().contains("Grapes")) { getBank().withdraw("Grapes", 14); sleepWhile( () -> getBank().isOpen(), Calculations.random(1000, 5000)); } else { getBank().close(); } } else { getBank().openClosest(); log("Bank sleeping"); sleepWhile( () -> getBank().isOpen(), Calculations.random(2000, 10000)); log("done sleeping"); } return 300; } Link to comment Share on other sites More sharing options...
Defiled 423 Share Posted March 23, 2020 why sleepWhile? when in the inv while its making the wine just do sleepUntil until there is a dialogue || there are no more components in the inventory. also your way of handling the bank is weird.. just before get("Grapes") add if(getBank.isOpen()) getBank.close(); or just surround it by an if statement if you want. also the thread placement is wrong, place this in snippets. Link to comment Share on other sites More sharing options...
Smokeyjay 1 Author Share Posted March 23, 2020 19 hours ago, Defiled said: why sleepWhile? when in the inv while its making the wine just do sleepUntil until there is a dialogue || there are no more components in the inventory. I've been looking around and I'm having a hard time finding a tutorial for finding how to listen for dialogue. Is it possible for you to give me an example? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.