Jump to content
Sign in to follow this  
hoang anh

What's Error ?

Recommended Posts

While running my program, Autoit report me this error, but i dont understand and dont know why.

Sleep(5000)

Error: Recursion level has been exceeded - AutoIt will quit to prevent stack over flow

My code :

func hunt()

send("{F8}")

sleep(5000)

send("{F9}")

endfunc

Share this post


Link to post
Share on other sites

Your Code you offered is fine,

Its the code calling this function that has the problem.

There is a recursion limit in autoit (Someone else more qualified can explain), and your OTHER code is hitting it.

Show the rest and we may be able to offer assistance.

HardCopy


Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Share this post


Link to post
Share on other sites

Func _IsPressed($hexKey)
  Local $aR, $bO
  
  $hexKey = '0x' & $hexKey
  $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
  If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
     $bO = 1
  Else
     $bO = 0
  EndIf
  
  Return $bO
EndFunc


If _IsPressed('01') = 1 Then hunt(); if or While better than ??


func hunt()
send("{F8}")
sleep(5000)
send("{F9}")
endfunc

I wanna " sleep(5000) " while left mouse click, but seem cant use this code . plz help me!

Share this post


Link to post
Share on other sites

maybe...

While 1
    
    If _IsPressed('01') = 1 Then hunt(); if or While better than ??
    
    Sleep(10)
WEnd

Func hunt()
    Send("{F8}")
    Sleep(5000)
    Send("{F9}")
EndFunc   ;==>hunt

Func _IsPressed($hexKey)
    Local $aR, $bO
    
    $hexKey = '0x' & $hexKey
    $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
    If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
        $bO = 1
    Else
        $bO = 0
    EndIf
    
    Return $bO
EndFunc   ;==>_IsPressed

8)

Share this post


Link to post
Share on other sites

Oh, i did it ago, but I got this error:

Error: Recursion level has been exceeded - AutoIt will quit to prevent stack over flow

How fix it ?

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  

×
×
  • Create New...