Zor Posted May 17, 2020 Share Posted May 17, 2020 (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 May 17, 2020 by Zor Quote Link to comment Share on other sites More sharing options...
Gunman Posted May 17, 2020 Share Posted May 17, 2020 1 interaction per onloop. It will still break a bit but it should be more stable 1 Quote Link to comment Share on other sites More sharing options...
Zor Posted May 17, 2020 Author Share Posted May 17, 2020 Just now, Gunman said: 1 interaction per onloop. It will still break a bit but it should be more stable I'm really hoping this isn't a complete noob but what do you mean by onloop Quote Link to comment Share on other sites More sharing options...
Gunman Posted May 17, 2020 Share Posted May 17, 2020 (edited) 13 minutes ago, Zor said: I'm really hoping this isn't a complete noob but what do you mean by onloop Oops sorry. 1 interaction per iteration of the onloop. EDIT: Also increasing sleep times would probably help. Edited May 17, 2020 by Gunman Quote Link to comment Share on other sites More sharing options...
Zor Posted May 17, 2020 Author Share Posted May 17, 2020 27 minutes ago, Gunman said: Oops sorry. 1 interaction per iteration of the onloop. EDIT: Also increasing sleep times would probably help. as in change this method so that it only handles opening the shop and then another method to buy and another to close? Quote Link to comment Share on other sites More sharing options...
Gunman Posted May 17, 2020 Share Posted May 17, 2020 5 minutes ago, Zor said: as in change this method so that it only handles opening the shop and then another method to buy and another to close? Yes, this should help. Quote Link to comment Share on other sites More sharing options...
Zor Posted May 17, 2020 Author Share Posted May 17, 2020 (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 May 17, 2020 by Zor Quote Link to comment Share on other sites More sharing options...
Gunman Posted May 17, 2020 Share Posted May 17, 2020 Gonna say yes didn't fully read it though. And try using widgets for the store thing. Quote Link to comment Share on other sites More sharing options...
Zor Posted May 17, 2020 Author Share Posted May 17, 2020 15 minutes ago, Gunman said: Gonna say yes didn't fully read it though. And try using widgets for the store thing. will do thank you Quote Link to comment Share on other sites More sharing options...