I have the code fully set up to:
move mouse to invent spot
then close bank using Esc key.
However, I want to move the mouse to position whilst pressing Esc key. Im under the belief that threads is the way to go with this, start a thread which moves the mouse and the next line will close the bank. However, Im having trouble implementing:
all this is in the same class:
static Thread moveMouse;
@Override
public void run() {
getMouse().move(getInventory().getMouseDestination(0), false);
}
//other code above here
else if (inventory.getAmount("item") == 14){
bank.depositAll("item");
bank.withdrawAll("item 2");
moveMouse = new Thread(new scriptName());
moveMouse.start();
getKeyboard().typeKey((char) 27);
}
any help appreciated.