taurus Posted March 25, 2015 Posted March 25, 2015 (edited) ;#work in progress. ;~ #RequireAdmin Global $Macro = False HotKeySet("{SPACE}", "SpaceMacro") While 1 Sleep(100) WEnd Func SpaceMacro() $Macro = Not $Macro While $Macro Send("{SPACE}") Sleep(250) ConsoleWrite("WORK") WEnd ConsoleWrite("TEST") EndFunc i am trying to make that hotkey (SPACE) to call the function and keep running while loop , and when space pressed again stop the loop. but it just runs it one time thats that. what am i doing wrong? I know the forum rules, no hacks , cheats. but this isnt hack. keyboard macro are allowed in games. this is exactly what itll be . keyboard macro to save my spacebar Edited March 25, 2015 by taurus
Solution JohnOne Posted March 25, 2015 Solution Posted March 25, 2015 (edited) Simplest fix, use a different HotKey to the one you are using, because you're sending it too, which is consequently sending HotKey again. Change {SPACE} for something else. Edited March 25, 2015 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
ViciousXUSMC Posted March 25, 2015 Posted March 25, 2015 (edited) This may be worth a look as well. https://www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm Seems to work: #include <Misc.au3> Local $hDLL = DLLOpen("user32.dll") While 1 If _IsPressed("20", $hDLL) Then Send("{Space}") Sleep(100) ConsoleWrite("Active") EndIf Sleep(100) WEnd Edited March 25, 2015 by ViciousXUSMC
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