March 16, 20169 yr Dear scripters, I ran into a small problem while learning to code, so basically i'm just making a script that walks to the G.E and use's bank on the banker. Problem : After that, the script is still running but doesn't move, i want it to stop and not logout my account. @Overridepublic void onStart() {log("Let's get started!");}@Overridepublic int onLoop() throws InterruptedException {getWalking().webWalk(new Position(3166, 3485, 0));npcs.closest("Banker").interact("Bank");stop(false);return random(200, 300);}@Overridepublic void onExit() {log("Arrived at destination !");}@Overridepublic void onPaint(Graphics2D g) {}} Could someone explain this, and how i make the script stop when it has interacted with the banker ? Thanks Edited March 16, 20169 yr by Takes A Nap
March 16, 20169 yr stop(false); @Override public void onStart() { log("Let's get started!"); } @Override public int onLoop() throws InterruptedException { getWalking().webWalk(new Position(3166, 3485, 0)); if (npcs.closest("Banker") != null && npcs.closest("Banker").interact("Bank")){ stop(false); } return random(200, 300); } @Override public void onExit() { log("Arrived at destination !"); } @Override public void onPaint(Graphics2D g) { } } Edited March 16, 20169 yr by Sinatra
March 16, 20169 yr Author It is stop(true); Now it logsout my account Edited March 16, 20169 yr by Takes A Nap
March 16, 20169 yr Now it logsout my account Right I guess you dont want that, in that case do this: getBot().getScriptExecutor().setRunningScript(false);
March 16, 20169 yr Author Right I guess you dont want that, in that case do this: getBot().getScriptExecutor().setRunningScript(false); Hmm it still doesn't stop the script :'( Anything else that might work ?
March 16, 20169 yr I guess you could try this @Override public int onLoop() { if (bank.isOpen()) { stop(false); } else if (npcs.closest("Banker") == null || myPosition().distance(new Position(3166, 3485, 0)) > 10) { walking.webWalk(new Position(3166, 3485, 0)); } else { npcs.closest("Banker").interact("Bank"); } return 69; }
March 16, 20169 yr Author I guess you could try this @Override public int onLoop() { if (bank.isOpen()) { stop(false); } else if (npcs.closest("Banker") == null || myPosition().distance(new Position(3166, 3485, 0)) > 10) { walking.webWalk(new Position(3166, 3485, 0)); } else { npcs.closest("Banker").interact("Bank"); } return 69; } Oke lol this thing is fast haha, and it stops the script thanks alot !
Create an account or sign in to comment