Ornamental Posted March 16, 2016 Share Posted March 16, 2016 (edited) 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, 2016 by Takes A Nap Quote Link to comment Share on other sites More sharing options...
Chris Posted March 16, 2016 Share Posted March 16, 2016 (edited) 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, 2016 by Sinatra Quote Link to comment Share on other sites More sharing options...
Ornamental Posted March 16, 2016 Author Share Posted March 16, 2016 stop(false); Huh i already have that ? Quote Link to comment Share on other sites More sharing options...
Goaks Posted March 16, 2016 Share Posted March 16, 2016 Huh i already have that ? then it must not be called Quote Link to comment Share on other sites More sharing options...
Ornamental Posted March 16, 2016 Author Share Posted March 16, 2016 But it's still not stopping the script Quote Link to comment Share on other sites More sharing options...
Vilius Posted March 16, 2016 Share Posted March 16, 2016 (edited) It is: stop(); Edited March 16, 2016 by Vilius 1 Quote Link to comment Share on other sites More sharing options...
Ornamental Posted March 16, 2016 Author Share Posted March 16, 2016 (edited) It is stop(true); Now it logsout my account Edited March 16, 2016 by Takes A Nap Quote Link to comment Share on other sites More sharing options...
Botre Posted March 16, 2016 Share Posted March 16, 2016 2 Quote Link to comment Share on other sites More sharing options...
Ornamental Posted March 16, 2016 Author Share Posted March 16, 2016 I already saw that ... That's why i made this post Quote Link to comment Share on other sites More sharing options...
Vilius Posted March 16, 2016 Share Posted March 16, 2016 Now it logsout my account Right I guess you dont want that, in that case do this: getBot().getScriptExecutor().setRunningScript(false); Quote Link to comment Share on other sites More sharing options...
Ornamental Posted March 16, 2016 Author Share Posted March 16, 2016 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 ? Quote Link to comment Share on other sites More sharing options...
Token Posted March 16, 2016 Share Posted March 16, 2016 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; } 1 Quote Link to comment Share on other sites More sharing options...
Ornamental Posted March 16, 2016 Author Share Posted March 16, 2016 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 ! Quote Link to comment Share on other sites More sharing options...