Sign in to follow this  
Followers 0
TheNewDeal

Any Way To Prevent Recursion Error?

10 posts in this topic

this is my code:

func start()

;click start

mouseclick("left",718,572)

;awaits game creation

sleep(3000)

;suicide

$s = timerstart()

While Timerstop($s) < 4000

send("{left down}")

wend

send("{left up}")

send("{f8}")

;win

mouseclick("left",705,464)

$s = timerstart()

While Timerstop($s) < 4000

send("{left down}")

wend

send("{left up}")

send("{f8}")

;win

mouseclick("left",705,464)

$s = timerstart()

While Timerstop($s) < 4000

send("{left down}")

wend

send("{left up}")

send("{f8}")

;win

mouseclick("left",705,464)

$s = timerstart()

While Timerstop($s) < 4000

send("{left down}")

wend

send("{left up}")

send("{f8}")

;win

mouseclick("left",705,464)

;awaits the ready up screen again

sleep(3000)

start()

endfunc

is there any other way i could go about doing this?

any help would be very greatful

thanks.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You need to let the function end before calling it again...

In your script function start(), you keep on calling start() and none of those calls end... try the below logic and see if that works for you...

do while 1
   Start()
Wend

func start()
; your script without the start() at the end
endfunc
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks, that seems logical to me. I'l test it and see if it works or not.

Share this post


Link to post
Share on other sites

this is my code now:

HotKeySet("{ESC}", "Terminate")

sleep(3000)

while 1

Start()

Wend

func start()

mouseclick("left",718,572)

sleep(1000)

send("{f8}")

mouseclick("left",705,464)

sleep(1000)

endfunc

Func Terminate()

Exit

endfunc

i am still getting the error btw. Any other ideas?

Share this post


Link to post
Share on other sites

What does the error message say?

Share this post


Link to post
Share on other sites

yea, its a recursion error at line 0 sleep(1000) or something of the sort

Share this post


Link to post
Share on other sites

yea, its a recursion error at line 0 sleep(1000) or something of the sort

Line 0? That means you're using a compiled script. Are you sure you aren't using an older version of your script with the error? You don't have to run a compiled script to test, you can run the script file itself by double-clicking it if you installed AutoIt via the installer, or you can double-click the AutoIt3.exe and select your script. There are no errors in the code that you posted, so you either aren't showing us everything or you're not running the right script.

Share this post


Link to post
Share on other sites

yea, its a recursion error at line 0 sleep(1000) or something of the sort

.. and you didn't define a "Func Sleep()" somewhere in your script ?

Just ran a similar script and let it run more than 1.5 milion times the Start() function without any error...


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

lol, i am having people run it for me but, as you stated they could be running the old version instead of this version. Thanks for checking it out though. I'l run it myself and find out.

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