Logout when stopping script

This commit is contained in:
Yuri Moens 2021-10-20 14:41:20 +02:00
parent 17f2a005ca
commit 9de32663fb
Signed by: ymo
GPG Key ID: F6D51D6FE15BE924
2 changed files with 5 additions and 3 deletions

View File

@ -36,11 +36,11 @@ public class CShopper extends CTaskScript {
buyTask = new Buy(); buyTask = new Buy();
addNodes( addNodes(
new Stop(),
new Run(), new Run(),
new Open(), new Open(),
buyTask, buyTask,
new Hop(), new Hop()
new Stop()
); );
} }

View File

@ -4,6 +4,7 @@ import io.reisub.dreambot.cshopper.CShopper;
import io.reisub.dreambot.cshopper.ItemWrapper; import io.reisub.dreambot.cshopper.ItemWrapper;
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.script.ScriptManager; import org.dreambot.api.script.ScriptManager;
import org.dreambot.api.script.TaskNode; import org.dreambot.api.script.TaskNode;
@ -25,8 +26,9 @@ public class Stop extends TaskNode {
@Override @Override
public int execute() { public int execute() {
MethodProvider.log("Finished buying"); MethodProvider.log("Finished buying");
Tabs.logout();
ScriptManager.getScriptManager().stop(); ScriptManager.getScriptManager().stop();
return 0; return 1000;
} }
} }