Sleep until login screen is reached

This commit is contained in:
Yuri Moens 2021-10-21 14:37:12 +02:00
parent 4c3cde1647
commit 23125b2711
Signed by: ymo
GPG Key ID: F6D51D6FE15BE924

View File

@ -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;