Kramnik Posted November 19, 2020 Share Posted November 19, 2020 (edited) Hello, have been experiencing this issue for sometime now and fail to find why it is happening. My script just randomly throws this error: [WARN][Bot #1][11/19 06:28:37 AM]: Script executor is taking too long to suspend; restarting now... and pretty much script crashes, stands for 5 minutes, logs out and that's it. Also it happens very randomly, e.g. the last time this happened script ran for 10 hours without issues, but it also could happened within hour or so. The logger goes like this before crashing: [INFO][Bot #1][11/19 06:23:29 AM]: Trading NPC [INFO][Bot #1][11/19 06:23:30 AM]: Check amount [INFO][Bot #1][11/19 06:23:30 AM]: Buy item at first try [WARN][Bot #1][11/19 06:28:37 AM]: Script executor is taking too long to suspend; restarting now... [INFO][Bot #1][11/19 06:41:46 AM]: Terminating script Ironmanbuyer... if (gpAmount > 1000) { final int feathers = (int)this.getInventory().getAmount(new String[] { "Item" }); getNpcs().closest("NPC").interact("Trade"); log("Trading NPC"); new ConditionalSleep(8000, 1000) { @Override public boolean condition() throws InterruptedException { return getStore().isOpen(); } }.sleep(); log("Check amount"); if(getStore().isOpen() && getStore().getAmount("Item") > 5){ log("Buy item at first try"); if(getStore().getItem("Item") != null){ getStore().buy("Item",5); } log("Bought"); new ConditionalSleep(5000, 1000) { @Override public boolean condition() throws InterruptedException { return getInventory().contains("Item"); } }.sleep(); log("Closing store"); getStore().close(); new ConditionalSleep(5000, 1000) { @Override public boolean condition() throws InterruptedException { return !getStore().isOpen(); } }.sleep(); } So the last logger are always "Buy item at first try" and after it crashes I never find it with the item in inventory. So the issue must be in this part, but I don't know why is this is wrong. Can it be client itself issue since these issues were not happening with previous versions? Thanks everyone for input if(getStore().getItem("Item") != null){ getStore().buy("Item",1); } Edited November 19, 2020 by Kramnik Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted November 19, 2020 Share Posted November 19, 2020 "Item" has to be a name of the item in case you didn't know, Feathers for example Also the logic is fairly flawed and unstable. You should try to only do 1 or max 2 actions in 1 loop. A better format would be: if (gp > 1000){ if(store is open){ if(store contains more than 5 items){ buyItems(); } }else{ openstore() } } If you are hopping or whatever you should close the bank ik there Quote Link to comment Share on other sites More sharing options...
Kramnik Posted November 19, 2020 Author Share Posted November 19, 2020 (edited) 7 hours ago, Khaleesi said: "Item" has to be a name of the item in case you didn't know, Feathers for example Also the logic is fairly flawed and unstable. You should try to only do 1 or max 2 actions in 1 loop. A better format would be: if (gp > 1000){ if(store is open){ if(store contains more than 5 items){ buyItems(); } }else{ openstore() } } If you are hopping or whatever you should close the bank ik there Hi, yes I am aware of it, I changed it to "Item" when I pasted I changed a code to be more like you said, but still the issue is happening. Happened two times, one after 6 hours of using it other after 10 minutes. Currently using this code: getNpcs().closest("NPC").interact("Trade"); log("Trading NPC"); new ConditionalSleep(8000, 1000) { @Override public boolean condition() throws InterruptedException { return getStore().isOpen(); } }.sleep(); log("Store is open now"); if(getStore().isOpen()) { log("Store is open"); if (getStore().getAmount("Item") > 5) { log("Amount is good, buying"); getStore().buy("Item", 1); new ConditionalSleep(5000, 1000) { @Override public boolean condition() throws InterruptedException { return getInventory().contains("Item"); } }.sleep(); log("Closing store"); getStore().close(); new ConditionalSleep(5000, 1000) { @Override public boolean condition() throws InterruptedException { return !getStore().isOpen(); } }.sleep(); And still bugs with this in logger: [INFO][Bot #1][11/19 03:15:40 PM]: Opening store [INFO][Bot #1][11/19 03:15:40 PM]: Trading NPC [INFO][Bot #1][11/19 03:15:41 PM]: Store is open now [INFO][Bot #1][11/19 03:15:41 PM]: Store is open [INFO][Bot #1][11/19 03:15:41 PM]: Amount is good, buying [WARN][Bot #1][11/19 03:20:48 PM]: Script executor is taking too long to suspend; restarting now... And when I log into account I can see that it haven't bought the item. Any ideas what could be wrong here? Edited November 19, 2020 by Kramnik Quote Link to comment Share on other sites More sharing options...