is my script having recursion? it always crash after 3-5min

Get help with using AutoHotkey and its commands and hotkeys
ravena1
Posts: 14
Joined: 06 Sep 2017, 15:13

is my script having recursion? it always crash after 3-5min

10 Sep 2017, 01:32

my script always crashes every 3-5mins i dont know why theres no error mesage why its crashing?

home::
main()
{
loot1()
}



loot1()
{
ImageSearch,violetX, violetY, 266, 141, 579, 527, C:\image\loot.png
If ErrorLevel
mobs1()
else
newvioletX := violetX + 20
newvioletY := violetY + 40
mousemove(%newvioletX%, %newvioletY%)
MouseClick, left
main()
}




mobs1()
{
PixelSearch, X, Y, 22, 216, 776, 607, 0x00FF00, 0, fast
If ErrorLevel
mobs2()
else
mousemove(%X%, %Y%)
MouseClick, left
main()

}




mobs2()
{
ImageSearch,mobs2x, mobs2y, 243, 76, 776, 607, C:\image\green.png
If ErrorLevel
tele()

else
mousemove(%mobs2x%, %mobs2y%)
MouseClick, left
main()


}





tele()

{

ImageSearch,walkX, walkY, 394, 347, 413, 414, C:\image\walk.png
If ErrorLevel
tele2()


else
MouseClick, left, 200, 300
main()


}

tele2()
{
Send {F9}
sleep, 2000
main()
}
return
just me
Posts: 7392
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: is my script having recursion? it always crash after 3-5min

10 Sep 2017, 02:31

is my script having recursion?
Obviously! You are calling Main() from almost any function originally called by Main(). This is what is called 'recursion'.
ravena1
Posts: 14
Joined: 06 Sep 2017, 15:13

Re: is my script having recursion? it always crash after 3-5min

10 Sep 2017, 03:56

just me wrote:
is my script having recursion?
Obviously! You are calling Main() from almost any function originally called by Main(). This is what is called 'recursion'.
As what Ive thought.. Do u have idea how to run my script go to the main top to continue the scrip without recursion?

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Ernimg, mikeyww, skido, Xeo786 and 46 guests