Sign in to follow this  
Followers 0
fangx

nooby help

6 posts in this topic

okay im trying to make an autoit script to bind 2 keys to one button. For example i would like to set F1 and F2 to be sent when i press Q. what would be the script needed to do this? thanks for help in advance

Share this post


Link to post
Share on other sites

also this is my script so far^_^

;Hotkeys

HotkeySet("{HOME}","_end")

Func _end()

Exit 0

EndFunc

Sleep(2147483647)

HotKeySet("{Q}", "SkillOne")

Func SkillOne()

Send("{f1}")

Send("{f2}")

EndFunc

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Well it looks like what you have will basically work. You'll need a while loop too:

;Hotkeys

HotkeySet("{HOME}","_end")
HotKeySet("Q", "SkillOne")

While 1
    Sleep (100)
WEnd

Func _end()
    Exit
EndFunc

Func SkillOne()
    Send("{f1}")
    Send("{f2}")
EndFunc

EDIT: Awww! herewasplato! You beat me :shocked:

Edited by Bert

Share this post


Link to post
Share on other sites

thanks guys, its working great

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

EDIT: Awww! herewasplato! You beat me :shocked:

...but you gave the OP what was asked for - I took the liberty of using a lowercase "q".

Actually, the code that the OP posted works fine without a loop if you move the long sleep to the end and remove the brackets from the "Q" in the HotKetSet line.

HotKeySet("{HOME}", "_end")
Func _end()
    Exit 0
EndFunc   ;==>_end

HotKeySet("Q", "SkillOne")
Func SkillOne()
    Send("{f1}")
    Send("{f2}")
EndFunc   ;==>SkillOne

Sleep(2147483647)
Edit: A loop is probably better - I was just pointing out how close the OP was.

BTW, if you turn Sleep(2147483647) into a US telephone number, you get some guy in Dallas, Texas - according to http://www.anywho.com/qry/wp_rl

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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