some1 Posted August 14, 2007 Share Posted August 14, 2007 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 Link to comment Share on other sites More sharing options...
Generator Posted August 14, 2007 Share Posted August 14, 2007 Replace EndFunc with return Link to comment Share on other sites More sharing options...
Gif Posted August 14, 2007 Share Posted August 14, 2007 or replace it with exitloop Link to comment Share on other sites More sharing options...
tAKTelapis Posted August 14, 2007 Share Posted August 14, 2007 They are referring to this end func btw: If $CyclesDone => GUICtrlRead($InputCycles) Then EndFunc EndIfoÝ÷ جƥ'èëÞ¯!nÇîÉÚë-jצz{mêÞ«-¡·¨µwEºw,µ«^éíz÷§ú'zí颲åÉÆ¥çbÚrب^ªZ®ØºV«rÝب+&zÔ¨¶¬².×hØ)äjëh×6 If $CyclesDone => GUICtrlRead($InputCycles) Then ExitLoop Link to comment Share on other sites More sharing options...
some1 Posted August 14, 2007 Author Share Posted August 14, 2007 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now