Sign in to follow this  
Followers 0
BinaryBrother

Bug or what?

5 posts in this topic

07-28-07 BETA.au3 (181) : ==> Recursion level has been exceeded - AutoIt will quit to prevent stack overflow.:

loop9()

What? How can I fix this?

Share this post


Link to post
Share on other sites



You are calling func's in a way they never end and keep on calling themselves ...

Post your script or search on the many times it is explained :)


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

Here she is... ;)

#include <GUIConstants.au3>
#include <array.au3>

TCPStartup()

$router_IP = "***"
$port = "***"

Dim $ConnectedSocket = -1
$ConnectedSocket = TCPConnect($router_IP , $port )
If $ConnectedSocket = -1 Then
    MsgBox(16, "Error", "Server" & $router_IP & " seems to be down...")
    Exit
EndIf
HotKeySet("{F6}", "Inputt")
HotKeySet("{F7}", "StandAloneInput")
$GOOEY = GUICreate("*** Bot",800,600)
$edit = GUICtrlCreateEdit("",10,50,750,550,$WS_DISABLED)
GUICtrlSetBkColor($edit,0x000000)
GUICtrlSetFont ($edit,12)
GUISetState()
Dim $recv
Dim $sMovee[303]=["s","s","se","e","s","se","sw","s","se","sw","sw","s","s","se","se","e","se","e","e","e","e","e","e","e","ne","n","n","n","n","n","ne","n","n","e","e","e","e","e","ne","n","ne","ne","n","n","ne","ne","n","n","n","n","n","nw","nw","nw","w","nw","w","nw","w","w","nw","nw","w","w","s","s","s","s","se","e","se","s","s","s","sw","s","sw","w","sw","s","w","w","nw","nw","w","nw","nw","n","n","n","w","w","s","w","nw","s","s","se","s","s","s","s","se","e","e","se","s","s","se","s","ne","e","e","se","e","e","ne","e","e","e","ne","n","n","nw","w","n","w","s","w","n","w","ne","ne","n","e","ne","ne","n","n","n","nw","nw","n","w","nw","w","n","n","e","e","se","se","sw","se","e","se","e","s","s","s","se","e","e","e","ne","n","n","nw","nw","w","nw","w","nw","w","w","sw","w","nw","w","s","s","w","w","w","sw","s","sw","s","se","e","w","nw","n","ne","n","ne","e","e","e","se","e","se","s","s","s","sw","s","sw","w","sw","s","w","w","nw","nw","w","nw","nw","n","n","n","w","w","s","w","nw","s","s","se","s","s","s","s","s","s","se","e","s","se","sw","s","se","ne","e","se","se","ne","ne","e","e","se","se","ne","n","n","e","e","ne","ne","n","ne","ne","nw","nw","e","ne","ne","n","n","n","n","nw","nw","w","s","s","s","se","s","sw","s","s","w","w","w","sw","w","sw","w","sw","w","w","w","w","w","w","nw","w","w"]
$iCounter = 0
$evil = 0
$StandAlone = InputBox("Connection", "Do you wish to make a standard connection with BOT inactive?")
Func StandAloneInput()
$hehe = InputBox("BinaryBrother", "Input Command.")
        TCPSend( $ConnectedSocket , $hehe & @CRLF)
        StandAlone()
EndFunc
Func StandAlone()
While 1
    $recv = TCPRecv($ConnectedSocket,9999)
       If $recv <> "" Then
        GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
    EndIf
WEnd
EndFunc
While 1
    $kills = 0
    $timerrr = TimerInit()
    $recv = TCPRecv($ConnectedSocket,9999)
       If $recv <> "" Then
        GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
        sleep(2000)
    EndIf
If StringInStr($recv,"Your choice:") Then
    TCPSend( $ConnectedSocket , "Binary" & @CRLF)
    sleep(4000)
    TCPSend( $ConnectedSocket , "***" & @CRLF)
EndIf

If StringInStr($recv,"Throw the other copy out?") Then
    msgbox(4096, "ERROR", "You did not log out correctly last time. This program will now attempt to kick the net dead copy from the game.")
    GUICtrlSetData($edit, "Please Wait...")
    TCPSend( $ConnectedSocket , "y" & @CRLF)
    sleep(5000)
    LookForKill2()
EndIf
If StringInStr($recv,"This is the Rimwards Gate of Sto Lat, ") Then
    GUICtrlSetData($edit, "Bot is Active, Location Check 1 of 2 passed.")
    TCPSend( $ConnectedSocket , "look" & @CRLF)
    sleep(3000)
EndIf

If StringInStr($recv,"There are five obvious exits: southeast, north, south, southwest and west.") Then
    GUICtrlSetData($edit, "Location Check 2 of 2 passed. You are in the correct Starting location!!")
    sleep(5000)
    TCPSend( $ConnectedSocket , "qwho" & @CRLF)
    sleep(Random(2000,5000))
    TCPSend( $ConnectedSocket , "major me" & @CRLF)
    GUICtrlSetData($edit, "Setting off some IDLE")
    sleep(Random(30000, 40000))
    GUICtrlSetData($edit, "Creating group and inviting parties.")
    TCPSend( $ConnectedSocket , "gcc" & @CRLF)
    sleep(Random(2000,3000))
    TCPSend( $ConnectedSocket , "gfa" & @CRLF)
    sleep(Random(10000,20000))
    GUICtrlSetData($edit, "Bot will now Begin Sto Lat Wall")
    sleep(2000)
    GUICtrlSetData($edit, "Created and Designed by BinaryBrother")
    sleep(5000)
    GUICtrlSetData($edit, "Idea, support, and creativity by: Xanadoo and those on the AutoIt Forum")
    sleep(5000)
If StringInStr($StandAlone,"yes") or StringInStr($StandAlone,"Yes") Then
    StandAloneInput()
Else
    LookForKill2()
EndIf
EndIf
WEnd
Func LookForKill2()
    TCPSend( $ConnectedSocket , "look" & @CRLF)
    sleep(Random(2000,3000))
    LookForKill()
EndFunc
Func LookForKill()
While 1
$recv = TCPRecv($ConnectedSocket,9999)
If $recv <> "" Then
    GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
EndIf
If StringInStr($recv,"It leads from the busiest gate, lying to the northwest, ") then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw")
    TCPSend($ConnectedSocket,"s")
EndIf
If StringInStr($recv, "Something.  It's dark here, isn't it?") Then
        TCPSend($ConnectedSocket,"light weapon 1" & @CRLF)
        sleep(12000)
EndIf
If StringInStr($recv,"Queued command: ") Then
    Sleep(Random(2000,3000))
EndIf
If StringInStr($recv,"What?") Or StringInStr($recv,"Try something else.") Then
    MsgBox(4096, "CRASH", "What? or Try something else. has been triggered...")
    Run("notepad.exe")
    WinActivate("Untitled")
    WinWait("Untitled")
    ClipPut($recv)
    Send("^v")
    Send($kills)
    OnAutoItExit()
EndIF
If StringInStr($recv,"Binary has no arcane") Or StringInStr($recv, "divine protection expires") Or StringInStr($recv,"divine protection is weakening") Then
    TCPSend( $ConnectedSocket , "major me" & @CRLF)
    sleep(12000)
EndIf
If StringInStr($recv,"too evil for") Then
    $evil = "yes"
EndIf
If $icounter = 303 then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw" & @CRLF)
    TCPSend($ConnectedSocket,"s" & @CRLF)
EndIf
If StringInStr($recv,"pigeon is pottering") Or StringInStr($recv,"priest are standing") Or StringInStr($recv,"priest is stansing") Or StringInStr($recv,"tosher are standing") Or StringInStr($recv,"tosher is standing") Or StringInStr($recv,"worker is standing") Or StringInStr($recv,"worker are standing") Or StringInStr($recv,"tanner is standing") Or StringInStr($recv,"tanner are standing") Or StringInStr($recv, "carpenter are standing") Or StringInStr($recv, "carpenter is standing") Or StringInStr($recv, "vintner are standing") Or StringInStr($recv, "vintner is standing") Or StringInStr($recv,"tanner are standing") Or StringInStr($recv,"jester is standing") Or StringInStr($recv,"jester are standing") Or StringInStr($recv,"seller is standing") or StringInStr($recv,"judge are standing") or StringInStr($recv,"judge is standing") or StringInStr($recv,"florist is standing") Or StringInStr($recv,"florist are standing") Or StringInStr($recv,"terrier is standing") Or StringInStr($recv,"merchant is standing") Or StringInStr($recv,"child are standing") Or StringInStr($recv,"bum is standing") Or StringInStr($recv,"thief are standing") Or StringInStr($recv,"warrior is standing") Or StringInStr($recv,"thief is standing") Or StringInStr($recv,"peasant are standing") Or StringInStr($recv,"drunk are standing") Or StringInStr($recv,"peasant is standing") Or StringInStr($recv,"washerwoman is standing") Or StringInStr($recv,"washerwoman are standing") Or StringInStr($recv,"drunk is standing") Or StringInStr($recv,"brawler are standing") Or StringInStr($recv,"child is standing") Or StringInStr($recv,"brawler is standing") Or StringInStr($recv,"drunk is sitting") Or StringInStr($recv,"deerhound is standing") Or StringInStr($recv,"spaniel are standing") Or StringInStr($recv,"bum are standing") Or StringInStr($recv,"carter are standing") Or StringInStr($recv,"spaniel is standing here") Or StringInStr($recv,"nobleman are standing") Or StringInStr($recv,"wolfhound is standing") Or StringInStr($recv,"fishmonger are") Or StringInStr($recv,"dressmaker are") Or StringInStr($recv,"carter is standing") Or StringInStr($recv,"executioner is standing") Or StringInStr($recv,"drunk is lying") Or StringInStr($recv,"warrior are standing") Or StringInStr($recv,"girl is standing") Or StringInStr($recv,"man is standing") Or StringInStr($recv,"judge is standing") Or StringInStr($recv,"hound are standing") Or StringInStr($recv,"worker is taking") Or StringInStr($recv,"worker is slouching") Or StringInStr($recv,"worker is running") Or StringInStr($recv,"chandler is standing") Or StringInStr($recv,"seller are standing") Or StringInStr($recv,"dog are standing") Or StringInStr($recv,"drover are standing") Or StringInStr($recv,"lipwigzer are standing") Or StringInStr($recv,"noblewoman are standing") Or StringInStr($recv,"retriever are standing") Or StringInStr($recv,"hound are standing") Or StringInStr($recv,"man are standing") Or StringInStr($recv,"merchant are standing") Or StringInStr($recv,"butcher are standing") Or StringInStr($recv,"beggar are standing")Or StringInStr($recv,"beggar is standing") Or StringInStr($recv,"beggar is sitting") Or StringInStr($recv,"terrier are standing") Or StringInStr($recv,"deerhound are standing") Or StringInStr($recv,"nobleman is standing") Or StringInStr($recv,"wolfhound are standing") Or StringInStr($recv,"fishmonger is standing") Or StringInStr($recv,"dressmaker is standing") Or StringInStr($recv,"executioner are standing") Or StringInStr($recv,"girl are standing") Or StringInStr($recv,"chandler are standing") Or StringInStr($recv,"dog is standing") Or StringInStr($recv,"drover is standing") Or StringInStr($recv,"lipwigzer is standing") Or StringInStr($recv,"noblewoman is standing") Or StringInStr($recv,"retriever is standing") Or StringInStr($recv,"hound is standing")Or StringInStr($recv,"butcher is standing") Or StringInStr($recv,"cur is standing") Or StringInStr($recv,"cur are standing") Or StringInStr($recv,"beagle is standing") Or StringInStr($recv,"beagle are standing") Then
    sleep(Random(1000,2000))
    TCPSend( $ConnectedSocket , "ka" & @CRLF)
    $kills += 1
    $timerrr = TimerInit()
    $recv = 0
    KillIt()
Else
    TCPSend($ConnectedSocket , $sMovee[$iCounter] & @CRLF)
    $iCounter += 1
    $recv = 0
sleep(Random(3000,4500))
EndIf
WEnd
EndFunc
Func KillIt()
Do
$recv = TCPRecv($ConnectedSocket,9999)
If $recv <> "" Then
    GUICtrlSetData($edit, $recv & @CRLF & GUICtrlRead($edit))
EndIf
If StringInStr($recv,"It leads from the busiest gate, lying to the northwest, ") then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw")
    TCPSend($ConnectedSocket,"s")
    sleep(Random(2000,4000))
EndIf
$defff = TimerDiff($timerrr)
If $defff > 60000 Then
    $recv = "you killed"
EndIf
If StringInStr($recv,"Binary has no arcane") Or StringInStr($recv, "divine protection expires") Or StringInStr($recv,"divine protection is weakening") Then
    TCPSend( $ConnectedSocket , "major me" & @CRLF)
sleep(12000)
EndIf
If StringInStr($recv, "Cannot find") Then
        TCPSend( $ConnectedSocket , $sMovee[$iCounter] & @CRLF)
        $iCounter += 1
        LookForKill2()
EndIf
Until StringInStr($recv,"You killed") Or StringInStr($recv,"dealt the death")
TCPSend( $ConnectedSocket , "look" & @CRLF)
sleep(Random(2000,3000))
$recv = TCPRecv($ConnectedSocket,9999)
If $sMovee[$iCounter] = 300 then
    $iCounter = 1
    TCPSend($ConnectedSocket,"nw")
    TCPSend($ConnectedSocket,"s")
    sleep(Random(2000,4000))
EndIf
If $recv <> "" Then
    GUICtrlSetData($edit,$recv & @CRLF & GUICtrlRead($edit))
EndIf
    If StringInStr($recv, "are fighting") Or StringInStr($recv, "is fighting") Then
        KillIt()
    EndIf
        If $evil > 0 Then
            $evil -= 1
        TCPSend($connectedSocket,"get coins from corpses" & @CRLF)
        TCPSend( $ConnectedSocket , "decompose corpse 1" & @CRLF)
        TCPSend( $ConnectedSocket , "/" & @CRLF)
        $recv = 0
        Sleep(Random(2000,3000))
        LookForKill2()
        Else
        TCPSend( $ConnectedSocket , "/" & @CRLF)
        $recv = 0
        sleep(Random(2000,3000))
        LookForKill2()
EndIf
EndFunc
Func Inputt()
        GUICtrlSetData($edit, "You can now input a command to the game!!")
$hehe = InputBox("Command", "Command here")
        TCPSend( $ConnectedSocket , $hehe & @CRLF)
LookForKill2()
EndFunc
Func OnAutoItExit()
    If $ConnectedSocket <> - 1 Then
        sleep(2000)
        TCPCloseSocket($ConnectedSocket)
    EndIf
    sleep(1000)
    TCPShutdown()
msgbox(4096,"Kills",$kills)
    Run("notepad.exe")
    WinActivate("Untitled")
    WinWait("Untitled")
    ClipPut($recv)
    Send("^v")
    Send($kills)
EndFunc

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You really need to re-think your script logic:

- I see many func's calling eachother .. even KillIt() calling itselve again ...

- What makes Func LookForKill() ever stop running ?

You need to changed it so that called Func's end at some time and return to the spot that callled it ...

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

Hmm... So something like this...

msgbox(4096,"Hello","Hello World"
Test()
msgbox(4096,"Hello","Hello World3"
Func Test()
msgbox(4096,"Hello","Hello World2")

Will call those in order? I used the Func NAME() as labels, like you would in batch scripting. I see where I guess I went wrong... If the above example is true, then I think I can have it fixed in a bit.

lol ------------------->

Func Loop()

; Do statements

Loop()

lol --------------------->

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