Sleep until login screen is reached
This commit is contained in:
parent
4c3cde1647
commit
23125b2711
@ -2,6 +2,9 @@ package io.reisub.dreambot.cshopper.tasks;
|
|||||||
|
|
||||||
import io.reisub.dreambot.cshopper.CShopper;
|
import io.reisub.dreambot.cshopper.CShopper;
|
||||||
import io.reisub.dreambot.cshopper.ItemWrapper;
|
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.MethodProvider;
|
||||||
import org.dreambot.api.methods.container.impl.Inventory;
|
import org.dreambot.api.methods.container.impl.Inventory;
|
||||||
import org.dreambot.api.methods.tabs.Tabs;
|
import org.dreambot.api.methods.tabs.Tabs;
|
||||||
@ -27,6 +30,8 @@ public class Stop extends TaskNode {
|
|||||||
public int execute() {
|
public int execute() {
|
||||||
MethodProvider.log("Finished buying");
|
MethodProvider.log("Finished buying");
|
||||||
Tabs.logout();
|
Tabs.logout();
|
||||||
|
MethodProvider.sleepUntil(() -> Client.getGameState() == GameState.LOGIN_SCREEN, Calculations.random(4000, 4500));
|
||||||
|
|
||||||
ScriptManager.getScriptManager().stop();
|
ScriptManager.getScriptManager().stop();
|
||||||
|
|
||||||
return 1000;
|
return 1000;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user