Reskal Posted January 21, 2010 Posted January 21, 2010 Hello all,yesterday i downloaded AutoIt 3 for use in a online-game named Wurm Online. Mining there is pretty boring but necessary. I've done the "corpse" so far, here it is:MouseMove(300, 400, 10);moving mouse to positionMouseClick("right"); opening little menuMouseMove(315, 400, 10); moving mouse to position in menuMouseMove(315, 465, 10); moving mouse to position in menuMouseMove(390, 465, 10); moving mouse to position in menuMouseClick("left"); starting to mine, takes 31 seconds.Sleep(32000); waiting for mining to finishI have searched in the help-window for a sort of repeat-command, just found _RepeatString, but im not sure if its right, it seems its only for words, not for commands. Not sure indeed. Looking for the right command to repeat the whole above.2. How can i set up a hotkey(or hotkeys) for beginning and stopping the macro then ?If possible and if not too much work, would be great if someone could enter the missing commandlines im not able to. I wouldnt care also what hotkeys i get for start and stop of the macro, main thing is i dont have to stare all the time on the mining-event until finished
Hawkwing Posted January 21, 2010 Posted January 21, 2010 Look at While...Wend loop and hotkeyset in the help file. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.
AlmarM Posted January 21, 2010 Posted January 21, 2010 (edited) Mayby this is what you are looking for? HotKeySet("{ESC}", "_Exit") ; Make a hotkey to exit the script ; Very important when u are using MouseMove, MouseClick etc. in a loop HotKeySet("{YourKeyHere}", "_Mine") ; Look at the Send command in the help file for keys Global $Mine = False ; Here we say $Mine = false, so the bot has stopped as default While 1 Sleep(1000) ; Use a sleep in the main loop for not getting a high CPU WEnd Func _Mine() $Mine = Not $Mine ; It's basicly something like: If $Mine = False Then $Mine = True ; Also visa versa While $Mine MouseMove(300, 400, 10);moving mouse to position MouseClick("right"); opening little menu MouseMove(315, 400, 10); moving mouse to position in menu MouseMove(315, 465, 10); moving mouse to position in menu MouseMove(390, 465, 10); moving mouse to position in menu MouseClick("left"); starting to mine, takes 31 seconds. Sleep(32000); waiting for mining to finish WEnd EndFunc Func _Exit() Exit EndFunc Edited January 21, 2010 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
Reskal Posted January 21, 2010 Author Posted January 21, 2010 Mayby this is what you are looking for? Well i typed into the editor what you suggested here, nearly understanding nothing but i was in good hope And it works properly and wonderful. Nearly a whole night i was searching for a macro program helping me in this but all the recorders i did not understand or they didn't work. I knew AutoIt is great, because we used it in Atitd(Tales of egyptian nights) before and there i were surprised how intelligent those macros can be(in the opposite to me when it comes to scripts and programming )So a big thanks for the small program AlmarM, you wrote and a big thanks to AutoIt also to provide such a wonderful piece of software !
AlmarM Posted January 21, 2010 Posted January 21, 2010 Well i typed into the editor what you suggested here, nearly understanding nothing but i was in good hope And it works properly and wonderful. Nearly a whole night i was searching for a macro program helping me in this but all the recorders i did not understand or they didn't work. I knew AutoIt is great, because we used it in Atitd(Tales of egyptian nights) before and there i were surprised how intelligent those macros can be(in the opposite to me when it comes to scripts and programming )So a big thanks for the small program AlmarM, you wrote and a big thanks to AutoIt also to provide such a wonderful piece of software !Nooo problem at aalll~ Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now