Goaks Posted February 29, 2016 Posted February 29, 2016 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.
Vilius Posted February 29, 2016 Posted February 29, 2016 As far as I know scripts are single threaded meaning either you make a thread yourself or just deal with it doing a single task at a time. But why are you doing this?
Goaks Posted February 29, 2016 Author Posted February 29, 2016 As far as I know scripts are single threaded meaning either you make a thread yourself or just deal with it doing a single task at a time. But why are you doing this? ahh fair enough, ill keep looking. And just to remove the bot like actions. As a person, Id close the bank whilst moving my mouse to the destination. With bots, it appears that it's one action at a time. Such that: move mouse to inv spot close bank with esc key when a real human would move mouse while pressing esc key
FrostBug Posted February 29, 2016 Posted February 29, 2016 I have things very similar to this in my Hotkey API What I'd do is: 1. Create a MoveMouseEvent or ClickMouseEvent 2. Set the event to run asynchronously (setAsync) 3. Get the distance to the destination 4. Execute the event 5. ConditionalSleep until event finished or remaining mouse distance is less than 30-50% of original distance 6. Hit the hotkey 7. Wait until event finishes (if not already finished)
Alek Posted February 29, 2016 Posted February 29, 2016 ahh fair enough, ill keep looking. And just to remove the bot like actions. As a person, Id close the bank whilst moving my mouse to the destination. With bots, it appears that it's one action at a time. Such that: move mouse to inv spot close bank with esc key when a real human would move mouse while pressing esc key How would you know that every human that plays will move their mouse while pressing the ESC key?
Goaks Posted February 29, 2016 Author Posted February 29, 2016 (edited) How would you know that every human that plays will move their mouse while pressing the ESC key? It is an assumption I made. It is a personal script, thus resulting in 100% of the people using it will move whilst pressing the 'Esc' key. It also makes far more sense in my head to do it this way to reduce botlike actions. Edited February 29, 2016 by Goaks
Volta Posted February 29, 2016 Posted February 29, 2016 (edited) How would you know that every human that plays will move their mouse while pressing the ESC key? He knows that almost every bot will not move their mouse while pressing the ESC key. Edited February 29, 2016 by Volta