Zamp Posted March 19, 2007 Share Posted March 19, 2007 I'm trying to make a program that will help me be lazy in a game I play. I want it so I can press up and let go, then it will hold down up for by itself. Here is what I have right now: Global $up Global $down HotKeySet("{UP}", "moveup") HotKeySet("{DOWN}", "movedown") HotKeySet("{ESC}", "Terminate") ;;;; Body of program would go here;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func moveup() $up = NOT $up While $up Send("{UP}") WEnd EndFunc Func movedown() $down = NOT $down While $down Send("{DOWN}") WEnd EndFunc Func Terminate() Exit 0 EndFunc Nothing happens when I press up or down, my guy doesn't even move. I changed the {UP} and {DOWN} to stuff like a and other random letters, and it will just spam those in notepad; but I can't get it to move the cursor up or anything. I've tried a lot of stuff like Send("a{UP}") and sometimes it works, sometimes it doesn't. Link to comment Share on other sites More sharing options...
/dev/null Posted March 19, 2007 Share Posted March 19, 2007 There are at least two problems in your code. __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Zamp Posted March 19, 2007 Author Share Posted March 19, 2007 You want to tell what two things are wrong? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 19, 2007 Moderators Share Posted March 19, 2007 Global $bUpKey, $bDownKey HotKeySet("{UP}", "_MoveUp") HotKeySet("{DOWN}", "_MoveDown") HotKeySet("{ESC}", "_Terminate") ;;;; Body of program would go here;;;; While 1 Sleep(10000000) WEnd ;;;;;;;; Func _Terminate() Exit EndFunc Func _MoveUp() If $bDownKey Then _MoveDown() $bUpKey = Not $bUpKey HotKeySet('{UP}') While $bUpKey Sleep(10) Send('{UP}') WEnd If Not $bUpKey Then HotKeySet('{UP}', '_MoveUp') EndFunc Func _MoveDown() If $bUpKey Then _MoveUp() $bDownKey = Not $bDownKey HotKeySet('{DOWN}') While $bDownKey Sleep(10) Send('{DOWN}') WEnd If Not $bDownKey Then HotKeySet('{DOWN}', '_MoveDown') EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
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