Jump to content

Handling misclicks.


saintpaul1

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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