driedApricots Posted June 28 Share Posted June 28 (edited) I'm trying to debug my script. getBank.open() log("next step") This is my entire script, its located in the "loop" section. The script clicks on the banker, opens the PIN interface then, the log comes up. After some time I get Script exeecutor is taking too long to suspend; restarting now...." "Shutting down script background executors" Then the bank pin solver starts and CORRECTLY ENTERS THE PIN. Followed by "Terminated script my script" I can't for the life of me figure out what the heck is happening. The back pin solver is "working" but will never work while my script is running. when I wait for the bank to open, the solver never comes up. Does anyone know what is happening here? I have also tried a conditional wait for the bank to be open and I get similar strange behavior. Thanks! Edited June 28 by driedApricots Quote Link to comment Share on other sites More sharing options...
driedApricots Posted June 28 Author Share Posted June 28 (edited) Another strange thing is happening. If I have the following getBank().open(); log("Test1"); sleep(10000);//Ten seconds log("Test2"); both log messages appear immediately. Followed by the random solver starting. Edited June 28 by driedApricots Quote Link to comment Share on other sites More sharing options...
Czar Posted June 29 Share Posted June 29 Use this: public boolean sleeped(String text, int timeout, BooleanSupplier condition) { return new ConditionalSleep(timeout) { @Override public boolean condition() throws InterruptedException { return condition.getAsBoolean(); } }.sleep(); } and in your script: if (getBank().isOpen()) { log("Bank is currently open"); return random(800, 1400); } log("Attempting to open bank..."); if (!getBank().open()) { log("...didn't open bank, try again..."); return random(800, 1400); } boolean didSucceed = sleeped("Wait up to 10s for bank to open", 10000, () -> getBank().isOpen(); if (!didSucceed) { log("Waited the whole 10 seconds and bank didn't open..."); return 600; } log("Bank successfully opened"); return 600; Quote Link to comment Share on other sites More sharing options...
Gunman Posted June 29 Share Posted June 29 @driedApricots RandomSolvers will interrupt the script loop, not sure why that would kill the script though. Put the code in a try catch and see if that does anything, may be related to a exception being thrown Quote Link to comment Share on other sites More sharing options...
revoke11 Posted July 30 Share Posted July 30 I figured out what was happening. The main method of my script was throwing an interrupt exception presumably from the random solver. Handing the interrupt or disabling the random solver both worked. Quote Link to comment Share on other sites More sharing options...