fangx Posted April 15, 2007 Share Posted April 15, 2007 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 Link to comment Share on other sites More sharing options...
fangx Posted April 15, 2007 Author Share Posted April 15, 2007 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 Link to comment Share on other sites More sharing options...
herewasplato Posted April 15, 2007 Share Posted April 15, 2007 HotKeySet("{HOME}", "_end") HotKeySet("q", "SkillOne") While 1 Sleep(100) WEnd Func SkillOne() Send("{f1}") Send("{f2}") EndFunc ;==>SkillOne Func _end() Exit 0 EndFunc ;==>_end [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
BrettF Posted April 15, 2007 Share Posted April 15, 2007 (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 Edited April 15, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
fangx Posted April 15, 2007 Author Share Posted April 15, 2007 thanks guys, its working great Link to comment Share on other sites More sharing options...
herewasplato Posted April 15, 2007 Share Posted April 15, 2007 (edited) EDIT: Awww! herewasplato! You beat me ...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 April 15, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now