Jump to content

Handling misclicks.


Recommended Posts

Posted (edited)

For example im running my banking method. i open bank and sleepunitl bank open.

How would u handle if it misclicks the bank and then it will skip the rest of my code that should run if bank is open?

 

I know probably a stupid question just wondering how other people handle stuff like this.

i guess everything runs on a loop and is if else statements? so if it misses something it comes back to it?

Edited by saintpaul1
Posted (edited)

If you wrap the interactions correctly, you don't have to worry so much about this. The code loops all the time, and this is quick. If you are worried about the sleep timer being too long, then you could try this:

Use custom checks with timers/bools. The two checks you have to watchout for is if the player is moving and a bank booth / bank chest / grand exchange bank booth is visible (or if they are reachable -- up to you). Just reset a timer when those conditions are met separately from your bank interaction.

For the open bank ineraction, just sleep until the "open" bool = true, but don't add a long conditional sleep.

Here is a rough example (Im not gonna write in the specifics)

Define the isVisible variables first, then:

if ((isMoving && BankBoothisVisible) || (isMoving && BankChestisVisible) || (isMoving && GrandExchangeBoothisVisible)) {
    timer = System.currentTimeMillis();
}

For the next portion, just check for the timer and "open" bools, then do aconditional sleep until bool "open" comes back as true coupled with your open bank interaction. This sleep shouldnt be too long since you are already checking for whether the bot is moving and reseting a timer.

Edited by FushigiBot
Posted
6 hours ago, Gunman said:

1 interaction per cycle of the loop, or you only add a isBankOpen check, if you're too lazy to actually plan out/redo a stable script

ah okay thank you!

 

4 hours ago, FushigiBot said:

If you wrap the interactions correctly, you don't have to worry so much about this. The code loops all the time, and this is quick. If you are worried about the sleep timer being too long, then you could try this:

Use custom checks with timers/bools. The two checks you have to watchout for is if the player is moving and a bank booth / bank chest / grand exchange bank booth is visible (or if they are reachable -- up to you). Just reset a timer when those conditions are met separately from your bank interaction.

For the open bank ineraction, just sleep until the "open" bool = true, but don't add a long conditional sleep.

Here is a rough example (Im not gonna write in the specifics)

Define the isVisible variables first, then:

if ((isMoving && BankBoothisVisible) || (isMoving && BankChestisVisible) || (isMoving && GrandExchangeBoothisVisible)) {
    timer = System.currentTimeMillis();
}

For the next portion, just check for the timer and "open" bools, then do aconditional sleep until bool "open" comes back as true coupled with your open bank interaction. This sleep shouldnt be too long since you are already checking for whether the bot is moving and reseting a timer.

okay that gives me some ideas, thank you very much.

Posted
On 4/26/2023 at 2:43 AM, Gunman said:

1 interaction per cycle of the loop, or you only add a isBankOpen check, if you're too lazy to actually plan out/redo a stable script

Just to come back to this thread, since listening to what u said and only perfroming 1 interaction per cycle, my code is much better. Thank you.

  • Like 1

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...