Jump to content

Bank pin solver not working


Recommended Posts

Posted (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 by driedApricots
Posted

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;
 

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...