Jump to content

Simple Script Request / On Hotkey


 Share

Recommended Posts

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...