Gawish Posted September 13, 2013 Share Posted September 13, 2013 pls can anyone tell me what's wrong in this code HotKeySet("2", "auto0") While 1 ;a loop WEnd Func auto0() opt("SendKeyDelay",0) opt("SendKeyDownDelay",0) send("{F4}{1}") send("{F1}{1}") EndFunc HotKeySet("3", "auto1") While 2 ;a loop WEnd Func auto1() opt("SendKeyDelay",0) opt("SendKeyDownDelay",0) send("{F4}{5}") send("{F1}{2}") EndFunc Link to comment Share on other sites More sharing options...
FireFox Posted September 13, 2013 Share Posted September 13, 2013 Hi, Welcome to the autoit forum Your script is stuck at the first endless loop, the rest of the script outside your funcs won't be executed. Br, FireFox. Link to comment Share on other sites More sharing options...
Gawish Posted September 13, 2013 Author Share Posted September 13, 2013 when i add first part of the code it workfine like this HotKeySet("2", "auto0") While 1 ;a loop WEnd Func auto0() opt("SendKeyDelay",0) opt("SendKeyDownDelay",0) send("{F4}{1}") send("{F1}{1}") EndFunc i want to know how to add more HotKeySet event Link to comment Share on other sites More sharing options...
FireFox Posted September 13, 2013 Share Posted September 13, 2013 Structure of the code: HotKeySet( ... HotKeySet( ... Opt( ... While 1 ; endless loop Sleep(10) ; avoid high CPU usage WEnd Func _MyFunc1 ... Func _MyFunc2 ... ;etc Link to comment Share on other sites More sharing options...
Gawish Posted September 13, 2013 Author Share Posted September 13, 2013 sry man i got error again HotKeySet ("2", "myfunce1") opt("SendKeyDelay",0) opt("SendKeyDownDelay",0) While 1 ; endless Loop Sleep(10) ; avoid high CPU usag WEnd Func myfunce1() send("{F4}{2}") send("(F1)(3)") EndFunc Link to comment Share on other sites More sharing options...
FireFox Posted September 13, 2013 Share Posted September 13, 2013 Your Send("{F4}{2}") sends the key 2 which is registered by your HotKeySet function so it calls myfunce1 and so on, hence the stack overflow error. Br, FireFox. Link to comment Share on other sites More sharing options...
Gawish Posted September 13, 2013 Author Share Posted September 13, 2013 pls can u post full ex Link to comment Share on other sites More sharing options...
Gawish Posted September 13, 2013 Author Share Posted September 13, 2013 Thanks pro Link to comment Share on other sites More sharing options...
FireFox Posted September 13, 2013 Share Posted September 13, 2013 There is no example to post as your script has no sense to me. Tell us what you're trying to achieve and what for are you using this script. Hence we will show you more reliable ways to automate that. Br, FireFox. 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