Jump to content

Recommended Posts

Posted

Hey, I am writin' a bot for the mmo EVE-online. It's gonna do all the boring mining part.

Here is a piece of the code (one of the places where I have problems with the EndFunc statement):

;;===============================================
;; Mine;
;;===============================================

Func Mine()
    $Status = "Mining"
    GUICtrlSetData($LabelStatus, $Status)
    $TimeInit = TimerInit()
        call("DetectStep")
    
    While 1
        
        Select
            Case $Step = 1
                Call("Undock")
            Case $Step = 2
                Call("WarpToBelt")
            Case $Step = 3
                Call("TargetApproachLock")
            Case $Step = 4
                Call("ActivateLasers")
            Case $Step = 5
                Call("DockStation")
            Case $Step = 6
                Call("MoveCargo")
        Endselect
        
        If $CyclesDone => GUICtrlRead($InputCycles) Then
                EndFunc
        EndIf
        
    WEnd

EndFunc

As you can see, I am primarily using functions to make it do what I want... But when using EndFunc more than once, I get some problems. In the above code I need the function to end when a predefined number of mining-cycles have been made.... but if I run the script as it stands there, I get an:

EndFunc

Error: "Func" statement has no matching "EndFunc".

Can you help me adjust my code so it will work???

Or should I do it in another way?

Btw: I searched the forum ;P

Posted

The help-file:

ExitLoop will break out of a While, Do or For loop.

ExitLoop is useful when you would otherwise need to perform error checking in both the loop-test and the loop-body.

But return works fine thanks :)

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
×
×
  • Create New...