Jump to content

Driving me nuts! SetHotKey


Snurkel
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
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...