diff --git a/CShopper/src/io/reisub/dreambot/cshopper/tasks/Stop.java b/CShopper/src/io/reisub/dreambot/cshopper/tasks/Stop.java index dbbd883..1ced8de 100644 --- a/CShopper/src/io/reisub/dreambot/cshopper/tasks/Stop.java +++ b/CShopper/src/io/reisub/dreambot/cshopper/tasks/Stop.java @@ -2,6 +2,9 @@ package io.reisub.dreambot.cshopper.tasks; import io.reisub.dreambot.cshopper.CShopper; import io.reisub.dreambot.cshopper.ItemWrapper; +import org.dreambot.api.Client; +import org.dreambot.api.data.GameState; +import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.MethodProvider; import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.methods.tabs.Tabs; @@ -27,6 +30,8 @@ public class Stop extends TaskNode { public int execute() { MethodProvider.log("Finished buying"); Tabs.logout(); + MethodProvider.sleepUntil(() -> Client.getGameState() == GameState.LOGIN_SCREEN, Calculations.random(4000, 4500)); + ScriptManager.getScriptManager().stop(); return 1000;