JStone Posted August 24, 2009 Share Posted August 24, 2009 So first let me tell you, I am by no means a scripter. I do find it scripting tools a handy tool to do repetitive work, and use it for such. I'm trying to make a very simple script, stand-alone, to upon pressing a hotkey it holds down the shift button, and upon another hotkey, releases it. I cannot use capslock. Here's what I have so far: WinWaitActive( "Darkfall Online" ) while 1 HotKeySet("^{F5}", "Shift") HotKeySet("^{F6}", "NoShift") Func Shift() Send("{SHIFTDOWN}") EndFunc Func NoShift() Send("{SHIFTUP}") EndFunc wend It doesn't necessarily have to wait until the active window is "Darkfall Online", I simply added that line in efforts to get the script to run. It hasn't, and understandably so. I'm an utter newb, and at your attention; please help! Link to comment Share on other sites More sharing options...
omikron48 Posted August 24, 2009 Share Posted August 24, 2009 HotKeySet("^{F5}", "Shift") HotKeySet("^{F6}", "NoShift") WinWaitActive( "Darkfall Online" ) Sleep(86400000) Func Shift() Send("{SHIFTDOWN}") EndFunc Func NoShift() Send("{SHIFTUP}") EndFunc Your mistake is placing the hotkeyset within a while loop. What happens is that hotkeyset is being called over and over again within the loop. That's why it's not working. Link to comment Share on other sites More sharing options...
JStone Posted August 24, 2009 Author Share Posted August 24, 2009 Awesome, I think I was unclear, because although it worked it wasn't as I need. Basically, I need this script to wait in the background until I hit the hotkey, which then holds the shift key, until I hit the second hotkey and stop and reset the script for the next time. Thank's to all help in advance! Link to comment Share on other sites More sharing options...
JStone Posted August 25, 2009 Author Share Posted August 25, 2009 Actually it doesnt necessarily need to have 2 hotkeys, simply be able to repeat/loop. I can't seem to figure that one out. Link to comment Share on other sites More sharing options...
WolfWorld Posted August 25, 2009 Share Posted August 25, 2009 Waittttt.... Don't use Sleep(86400000) lol use While 1 Sleep(50) WEnd Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
JStone Posted August 25, 2009 Author Share Posted August 25, 2009 HotKeySet("{F5}", "Shift") HotKeySet("{F6}", "NoShift") WinWaitActive( "Darkfall Online" ) While 1 Sleep(50) WEnd Func Shift() Send("{SHIFTDOWN}") EndFunc Func NoShift() Send("{SHIFTUP}") EndFunc Still doesn't repeat! Link to comment Share on other sites More sharing options...
Info Posted August 25, 2009 Share Posted August 25, 2009 HotKeySet("{F5}", "Shift") HotKeySet("{F6}", "NoShift") WinWaitActive( "Darkfall Online" ) While 1 Sleep(50) WEnd Func Shift() Send("{SHIFTDOWN}") EndFunc Func NoShift() Send("{SHIFTUP}") EndFunc Still doesn't repeat! There's nothing wrong with that script. 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