Moderators SmOke_N Posted February 16, 2006 Moderators Share Posted February 16, 2006 lol, thats right - i can't think of anyone using the release, everyone i know uses the beta (some can't even script a simple "hello world"-script )Guilty, Everytime I try to type that word, it comes out 'Howdy'! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Big10Inch Posted February 27, 2006 Share Posted February 27, 2006 Others have posted different code that may do what you want. I think the error in your original code was sending a key with the Send() functions that triggers the translation function you defined for the sent letter, which sends a different letter, triggering another translation function, etc. ad infinitum. THIS IS IT !!!! This is the reason for the error !! I did exactly the same thing and got the same error landing me here in this forum to find out what 'recursion' meant and the fix. I used HotKeySet and the Send command in the Function to repetitivly send the same letter I set up as a HotKey and welcome to crash error>---recursion---Buh-Bye Auto-It....I fixed it by changing the assigned HotKey's to something else. ( I used numbers instead ..) and no recursion error. Here's my code: ; This code rapidly presses specific keys faster than I'd ever be able to for a stupid little java game on arcadegamesforum.comHotKeySet( "1" , "XandZ" ) ; Originally I used 'X' as the keyHotKeySet( "2" , "Ghee" ) ; Originally I used 'G' as the keyHotKeySet( "3" , "Ell" ) ; and so on... The function starts that letter rapidly being Send() edHotKeySet( "4" , "Cee" ) ; which triggered it as HotKey Being pressed to infinity causing theHotKeySet( "5" , "ZandX" ) ; recurance error and auto-it crash--- I changed the key assignment toHotKeySet( "q" , "Endgame" ) ; numbers and problem solved. Do $Loop = $Loop + 1Until $X = 1 Func XandZ() $X = 1$V = 2 Do Send( "xzxzxzxzxzxzxzxz" ) Until $X = 2EndFuncFunc Ghee()$Y = 1$X = 2 Do Send( "g" ) Until $Y = 2EndFunc Func Ell()$Z = 1$Y = 2 Do Send( "l" ) Until $Z = 2EndFuncFunc Cee()$W = 1$Z = 2 Do Send( "c" ) Until $W = 2EndFuncFunc ZandX()$V = 1$W = 2 Do Send( "xz" ) Until $V = 2 EndFuncFunc Endgame() ExitEndFunc Link to comment Share on other sites More sharing options...
greenmachine Posted February 28, 2006 Share Posted February 28, 2006 Well I just feel like answering the recursion question - when you have a hotkey function send another hotkey, that function is then called, and it continues until the recursion level is exceeded. In other words, an example: Say my hotkeys all send the next letter. When I press a, it sends b, which calls the hotkey function for b (because it captures the sent b as a key press), which calls c, d, e, f... forever (or at least until AutoIt catches it and scolds you). So, a moral: don't set a hotkey to send the key of another hotkey function. Link to comment Share on other sites More sharing options...
death pax Posted February 28, 2006 Share Posted February 28, 2006 unless of course you close the hotkey first and reopen it afterwards :"> Link to comment Share on other sites More sharing options...
greenmachine Posted February 28, 2006 Share Posted February 28, 2006 True, you could close the Hotkey that the current hotkey function is linked to and the send it and then redefine.. that would do the trick. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 28, 2006 Share Posted February 28, 2006 About 90% of the workable scripts on here.Doesn't that imply it's time to finalize the next Prod version (3.2.0 or whatever)? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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