Kennet Posted January 22, 2018 Posted January 22, 2018 Hello, I am attempting to make a script which at the press of caps lock, holds down w and shift until any key or caps lock is pressed again. Here is what I have so far. #include <GUIConstantsEx.au3> #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") Global $autorun Global Const $VK_CAPITAL = 0x14 Func _GetCapsLock() Local $ret $ret = DllCall("user32.dll","long","GetKeyState","long",$VK_CAPITAL) Return $ret[0] EndFunc while 1 HotKeySet("{k}", "Quit") HotKeySet("{CAPSLOCK}", "autorun") If _GetCapsLock = 1 Then ConsoleWrite("working") EndIf WEnd Func autorun() $autorun = 1 while autorun = 1 ConsoleWrite("Running!") send("{w down}") send("{SHIFTDOWN}") if _IsPressed(14) Then $autorun = 0 EndIF WEnd HotKeySet("{CAPSLOCK}", "autorun") EndFunc Func Quit() Exit EndFunc I have gotten the script to work with varying degrees of success. At the moment it doesn't work at all and I do not understand. Any bit of help would be appreciated, I am still learning to use Autoit. Thanks, Kennet
Kennet Posted January 22, 2018 Author Posted January 22, 2018 I should have noted that at one point I used the "_GetCapsLock" function to check the state of the caps lock however it is not used in the current setup.
Moderators JLogan3o13 Posted January 22, 2018 Moderators Posted January 22, 2018 (edited) @Kennet how about a detailed description on what you are trying to accomplish with your script? What app/website is this for? Edited January 22, 2018 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Kennet Posted January 22, 2018 Author Posted January 22, 2018 @JLogan3o13 Hello, this is for the game Fortnite and is intended to enable autorunning. The goal is when caps-lock is pressed, the "w" key and "shift" key are held down simultaneously until caps-lock is pressed again. Thanks
Moderators JLogan3o13 Posted January 22, 2018 Moderators Posted January 22, 2018 As I thought. You might try reading the forum rules before you post again, especially the part on game automation. You will get no help on this subject. I would also suggest you pay attention to this point: Quote 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Recommended Posts