Jump to content

Any Way To Prevent Recursion Error?


Recommended Posts

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.

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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?

Link to comment
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.
Link to comment
Share on other sites

  • Developers

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...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...