Sign in to follow this  
Followers 0
Guest forthefunofit

hotkey vs Noob= hotkey wins :(

5 posts in this topic

;I want the hotkey to be active and trigger the send function every time I hit the hotkey until I exit the script.

HotKeySet("^!s", "MySend")

Func MySend()

Send("2")

Sleep(1500)

Send("3")

Sleep(1500)

EndFunc

I know the send section works but the hotkeyscript will not run. Im sure it is somthing simple since I am such a noob. Any assistance would be appreciated

thanks,

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

That script does 0. I suggest you look at the manual, and the examples. And ask yourself., how this works. You cannot learn til you know alittle of something.

Understanding a computer language is like trying to understand your self. You need to learn the basics?

How to call a function, may be a solution to your problem here.

Edit: grammer change.

Edit2: Opps, sorry, your calling a functon via hotkey, but no loop to keep your script alive?

Edited by MHz

Share this post


Link to post
Share on other sites

You missed an important part of the script. Basically the script would work fine, but it will end before you can hit the hotkey and thus will do pretty much nothing.

HotKeySet("^!s", "MySend"); looks for key to be pressed while script running

; added a loop so that the program doesn't end 
; before you can hit the hotkey to see if it works

while 1 ; this starts a loop that will always be true
sleep(10); saves CPU cycles
wend; starts the while loop again


Func MySend(); this is the function

Send("2")
Sleep(1500)
Send("3")
Sleep(1500)

EndFunc

many times you can miss the easy stuff.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

You also might want to add a sleep(500) before the 'Send("2")'


Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
Share on other sites

too sweet!! Thanks

That made sense.

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  
Followers 0