Jump to content
Sign in to follow this  
rocknload

help with the hotkeys

Recommended Posts

rocknload

hi, i'm having some troubles that i hope u can help me with.

lets say i want to do a script that when you'll press on a key..lets say "4" and when you press that key it makes this command:

Send("words")

after some time i wasn't scripting i simply forgot how to do that(i was and still am a begginer)

thanks :P

Share this post


Link to post
Share on other sites
Szhlopp

hi, i'm having some troubles that i hope u can help me with.

lets say i want to do a script that when you'll press on a key..lets say "4" and when you press that key it makes this command:

Send("words")

after some time i wasn't scripting i simply forgot how to do that(i was and still am a begginer)

thanks :P

Try this:

HotKeySet("4", "SendKeysFunction")


Do  
    Sleep(100)  
Until False


Func SendKeysFunction()
    
    Send("Words!", 1)
    
EndFunc

Share this post


Link to post
Share on other sites
Overkill

hi, i'm having some troubles that i hope u can help me with.

lets say i want to do a script that when you'll press on a key..lets say "4" and when you press that key it makes this command:

Send("words")

after some time i wasn't scripting i simply forgot how to do that(i was and still am a begginer)

thanks :P

The HotKeySet() command sets a key to call a function when pressed. For that to happen, you need to A) Define a function and B| Set a key to call that function.

I like having my script exit after the function is called, but if you don't want to do that, just remove anything that says "$sent = 0" or "$sent = 1".

EX:

$sent = 0
Func Sendwords()
Send("words")
$sent = 1
EndFunc
HotKeySet("4","Sendwords")

While $sent = 0
Sleep(100)
Wend
Edited by Overkill

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.