Jump to content
Sign in to follow this  
Snurkel

Driving me nuts! SetHotKey

Recommended Posts

Snurkel

Okay, So i'm just trying to accomplish a very simple task..

I wan't to be able to press 1 key, and have it automate 3 keystrokes for me.. So why I'm having such issues, I don't know.

My codes not giving me errors.. It's just not running.. so here we go

HotKeySet("{F1}", "sorry")

WinWaitActive("Enemy Territory")

Func sorry()

Send("v")

Send("4")

Send("5")

EndFunc

No results... Nothing happens, I'm such a tard. Any help is appreciated.

Share this post


Link to post
Share on other sites
Zedna

You must add loop to make your script wait (never end)

also add some hotkey to exit ...

HotKeySet("{F1}", "sorry")
WinWaitActive("Enemy Territory")

While 1
  Sleep(100)
WEnd

Func sorry()
Send("v")
Send("4")
Send("5")
EndFunc

Share this post


Link to post
Share on other sites
evilertoaster

Try making sure the code block doesn't run...maybe add a messagebox or somthing for testing.

Also make sure F1 isn't already hotkeyed by another script or application.

Lastly, you'll want to check if whatever application you're trying to make a macro for (I'm guessing a game) doesn't explicitly block autoit scripting features from being used.

Share this post


Link to post
Share on other sites
Snurkel

You must add loop to make your script wait (never end)

also add some hotkey to exit ...

HotKeySet("{F1}", "sorry")
WinWaitActive("Enemy Territory")

While 1
  Sleep(100)
WEnd

Func sorry()
Send("v")
Send("4")
Send("5")
EndFunc
Makes sense.. I didnt think about it that way. Thank you for the tip.

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.