Jump to content

Bots start breaking when run in low cpu mode


Recommended Posts

Posted (edited)

I would really rather not post the code as this is the method i'm currently running but the script i made breaks working I put it into low cpu mode. It isnt something that needs a high frame rate to run but it really just will continuously hop worlds when on low cpu (its a shop buyer) it tries to open the shop but then it just hops worlds. are there any known issues with low cpu mode with known or unknown fixes?

Edit:here is the code of the buy method i made

NPC buyGuy = npcs.closest(here is the npc);
        if(buyGuy != null && buyGuy.exists()) {
            buyGuy.interact("Trade");
            Sleep.sleepUntil(() -> store.isOpen(), 20000); //after rerererereading the code i have a feeling it is something to do with me do store.isOpen() here any ideas on what it should be
            try {
                sleep(random(100, 590));
                
                
                
                    sleep(random(132, 459));
                    getStore().buy("item", 10);
                    sleep(random(9, 898));
                    getStore().close();
                    Sleep.sleepUntil(() -> getStore().close(), 4000);
                    sleep(random(1000,2345));
                    if(!inventory.isFull())
                        getWorlds().hop(nextWorldInOrder(true));
            
                    sleep(random(100, 1523));

Edited by Zor
Posted (edited)
37 minutes ago, Gunman said:

Yes, this should help.

similar to this? 

    public int onLoop() throws InterruptedException {
        if(!genArea.contains(myPlayer())) { 
            state = "Walking there";
            walkThere();
        }else if(inventory.isFull()) {
            state = "Banking";
            bank();
        }else if(inventory.isEmptyExcept(995) && !buy.contains(myPosition())) {
            state ="Running to shop";
            runToShop();
        }else if(buy.contains(myPosition()) && !inventory.isFull() && !getStore().isOpen()) {
            state = "Trading";
            trade();
        }else if(buy.contains(myPosition()) && !inventory.isFull() && getStore().isOpen() && getStore().contains("item name")) {
            state= "Buying";
            buy();
            bought = true;
        }else if(buy.contains(myPosition()) && store.isOpen() && getStore().isOpen() && bought && !hop) {
            state = "Closing Store";
            closeStore();
            hop = true;
        }else if(hop && bought) {
            hopWorlds();
            hop = false;
            bought = false;
        }
edit:doing getStore().contains("item name") broke it is there an instock method

edit2:fixed previous edit and for anyone looking the method is getAmount("item name")

Edited by Zor

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