Sign in to follow this  
Followers 0
BALA

Understanding error

3 posts in this topic

#1 ·  Posted (edited)

HotKeySet("{ESC}", "Close")
HotKeySet("n", "nm")
HotKeySet("c", "cv")
HotKeySet("v", "vb")

Func Close()
    Exit
EndFunc

Func nm()
    While 1
        Send("n")
        Send("m")       
    WEnd
EndFunc

Func cv()
    While 1
        Send("c")
        Send("v")       
    WEnd
EndFunc

Func vb()
    While 1
        Send("v")
        Send("b")       
    WEnd
EndFunc

While 1
    sleep(10)
WEnd

When I run this script and click "c," it gives me this error: C:\Documents and Settings\Ba-La\Desktop\New AutoIt v3 Script.au3 (28) : ==> Recursion level has been exceeded - AutoIt will quit to prevent stack overflow.:

Send("c")

What is happening that gives out that error?

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites



You're having the same function calling itself over and over. This creates a rift in the time-space continuum. You're basically threatening all life on earth as we know it.

Unset the hotkey before calling it from within the same function, then reset it afterwards before leaving the function.

Share this post


Link to post
Share on other sites

...which is also mentioned in the helpfile :

To Send() a key combination which will trigger a HotKeySet() event, either use ControlSend()

or unregister the HotKeySet() event, otherwise, the Send() event may trigger an infinite loop.

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