Jump to content

Bots start breaking when run in low cpu mode


Zor

Recommended Posts

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

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