@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case BUY:
getWalking().walk(new Position(3274, 3180, 0));
npcs.closest("Karim").interact("Talk-to");
if (dialogues.isPendingContinuation()) {
dialogues.clickContinue();
}
else if (dialogues.isPendingOption()) {
dialogues.selectOption("Yes please.");
}
case BANK:
getWalking().walk(new Position(3270, 3168, 0));
if (!getBank().isOpen()){
getBank().open();
} else { bank.depositAll("Kebab");
getBank().close();}
case WAIT:
return random(100,400); //The amount of time in milliseconds before the loop starts over
}
//@Override
//public void onExit() {
log("Thanks for using my script!");
//Code here will execute after the script ends
//@Override
//public void onPaint(Graphics2D g) {
//This is where you will put your code for paint(s)
return random(200,300);
}
}
There is yar problem, you have your paint and on exit in the loop :b
Fixed version:
@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case BUY:
getWalking().walk(new Position(3274, 3180, 0));
npcs.closest("Karim").interact("Talk-to");
if (dialogues.isPendingContinuation()) {
dialogues.clickContinue();
}
else if (dialogues.isPendingOption()) {
dialogues.selectOption("Yes please.");
}
break;
case BANK:
getWalking().walk(new Position(3270, 3168, 0));
if (!getBank().isOpen()){
getBank().open();
} else {
bank.depositAll("Kebab");
getBank().close();
}
break;
case WAIT:
return random(100,400); //The amount of time in milliseconds before the loop starts over
break;
}
return random(200,300);
}
//@Override
//public void onExit() {
log("Thanks for using my script!");
//Code here will execute after the script ends
//}
//@Override
//public void onPaint(Graphics2D g) {
//This is where you will put your code for paint(s)
//}
}
And do what woody said :b