Jump to content

Bot misclicks - Shift drop and banking


whoknowshonestly

Recommended Posts

Hi,

I'm working on an AIO woodcutter as my first script. It chops and drops from 1-60, then banks yews at 60+.

My problem is that I can't toggle shift click drop on either of my bots because the client seemingly misclicks on most of the logs and wont drop the majority of the inventory. Similarly in my banking script it sometimes talks to the banker instead of banking, and so I had to implement a workaround in case of it happening.

Is this common? Is there a simple fix to this that I can check out as it would speed up my bots a decent amount. It works fine with normal dropping and the workaround but I'd love a solution to make it that bit better.

Thanks in advance.

 

EDIT TO ADD CODE:

Dropping logs:

 private void dropWood(){
        if (inventory.dropAllExcept("Bronze axe", "Steel axe", "Rune axe")){
            new ConditionalSleep(100, 1000) {
                @Override
                public boolean condition() {
                    return isInventoryEmpty();
                }
            }.sleep();
        }
    }

Banking:

private void bankWood() throws InterruptedException {
        if (getWalking().webWalk(Banks.GRAND_EXCHANGE)) {
            new ConditionalSleep(100, 1000) {
                @Override
                public boolean condition() {
                    return isInBank();
                }
            }.sleep();
        }
        if (isInBank()) {
            if (!getBank().isOpen()) {
                if (getBank().open()){
                    new ConditionalSleep(100, 1000) {
                        @Override
                        public boolean condition() {
                            return getBank().isOpen();
                        }
                    }.sleep();
                }
            } else if (getBank().isOpen()) {
                if (getBank().depositAllExcept("Bronze axe", "Steel axe", "Rune axe")) {
                    new ConditionalSleep(100, 1000) {
                        @Override
                        public boolean condition() {
                            return isInventoryEmpty();
                        }
                    }.sleep();
                }
            }
        }
    }

 

Edited by whoknowshonestly
Add code snippets
Link to comment
Share on other sites

4 minutes ago, dogetrix said:

Your timeout time (100ms) for the ConditionalSleeps is shorter than the sleepTime (1 second). This might be causing some issues.

From docs:

Parameters:
timeout - The specified time out.
sleepTime - The time to sleep in milliseconds between timeout and conditions checks.

Should it be more like (3000, 1000) instead? I'm going to give those numbers a shot and report back but if that's also a bad way to write it then let me know. Think I'm still misunderstanding sleep but other than that the code is coming together nicely.

Link to comment
Share on other sites

Define either a RS2Object for a bank booth or an NPC for a banker. Have it like 

      if (isInBank())                 
         if (NPC/RS2Object != null)
            (NPC/RS2Object.interact("Bank"))

Try adjust the conditional sleep, idk whats up with the misclicking. With the way you made the ConditionalSleep you're giving it 100ms to complete the task, so not allowing it enough time to drop everything may break it. I'd personally give it like (30000,1000). This will allow the bot 30 seconds to drop the inventory, and if it drops everything before the 30 seconds the "return getInventory().isEmpty();" will catch it

3 hours ago, whoknowshonestly said:

Should it be more like (3000, 1000) instead? I'm going to give those numbers a shot and report back but if that's also a bad way to write it then let me know. Think I'm still misunderstanding sleep but other than that the code is coming together nicely.

Edited by Dab in a Lab
Link to comment
Share on other sites

45 minutes ago, Dab in a Lab said:

Define either a RS2Object for a bank booth or an NPC for a banker. Have it like 


      if (isInBank())                 
         if (NPC/RS2Object != null)
            (NPC/RS2Object.interact("Bank"))

Try adjust the conditional sleep, idk whats up with the misclicking. With the way you made the ConditionalSleep you're giving it 100ms to complete the task, so not allowing it enough time to drop everything may break it. I'd personally give it like (30000,1000). This will allow the bot 30 seconds to drop the inventory, and if it drops everything before the 30 seconds the "return getInventory().isEmpty();" will catch it

I simplified some bits of the code after logging out the problem and it seems to be working now, fingers crossed. Thanks for your help.

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