June 28, 20241 yr 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, 20241 yr by driedApricots
June 28, 20241 yr Author 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, 20241 yr by driedApricots
June 29, 20241 yr 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;
June 29, 20241 yr @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
July 30, 20241 yr 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.
Create an account or sign in to comment