Jump to content

How Do I Fix this Error? What does it mean?


milkman
 Share

Recommended Posts

  • Moderators

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 :geek:)

Guilty, Everytime I try to type that word, it comes out 'Howdy'! :o

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

  • 2 weeks later...

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.

:o

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. :geek: 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.com

HotKeySet( "1" , "XandZ" ) ; Originally I used 'X' as the key

HotKeySet( "2" , "Ghee" ) ; Originally I used 'G' as the key

HotKeySet( "3" , "Ell" ) ; and so on... The function starts that letter rapidly being Send() ed

HotKeySet( "4" , "Cee" ) ; which triggered it as HotKey Being pressed to infinity causing the

HotKeySet( "5" , "ZandX" ) ; recurance error and auto-it crash--- I changed the key assignment to

HotKeySet( "q" , "Endgame" ) ; numbers and problem solved.

Do

$Loop = $Loop + 1

Until $X = 1

Func XandZ()

$X = 1

$V = 2

Do

Send( "xzxzxzxzxzxzxzxz" )

Until $X = 2

EndFunc

Func Ghee()

$Y = 1

$X = 2

Do

Send( "g" )

Until $Y = 2

EndFunc

Func Ell()

$Z = 1

$Y = 2

Do

Send( "l" )

Until $Z = 2

EndFunc

Func Cee()

$W = 1

$Z = 2

Do

Send( "c" )

Until $W = 2

EndFunc

Func ZandX()

$V = 1

$W = 2

Do

Send( "xz" )

Until $V = 2

EndFunc

Func Endgame()

Exit

EndFunc

Link to comment
Share on other sites

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

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)? :o

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...