Some friends of mine at work have been asking for me to come up with some more AutoIt tutorials. I think "DeepClip" will end up being the first of them.
But for now I thought I would post a super simple little 10 line snippet that was for a game I was playing last week where clicking quickly was needed.
The statement numbers aren't part of the code
1. Sleep(2000)
2. HotKeySet("{esc}", "_exit")
3. While 1
MouseClick("Left")
WEnd
4. Func _exit()
Exit
EndFunc
1. First I needed a way to run this script then get to the window with the game in it before it started clicking madly.
2. HotKeySet() is a built in function in AutoIt function that registers a hotkey with windows and binds that to a function. The list of hotkeys is in the AutoIt help file.
3. A basic loop type called while, when a while loop starts it checks the argument to the right of the "while". As long as that statment returns "True" meaning a non-zero number it continues. While 1 is a way to loop forever. While looping forever we want to click the left mouse button. Then WEnd ends the while statement.
4. Here we setup the exit function we bound to the escape key since we wont be able to click our way out of this script we need a way to get out easily.
You can download AutoIt from their download page located here. Its a great starter language and (despite what others may say) a great language for medium to large windows utilities.
No comments:
Post a Comment