EndFor
#1
Posted 02 December 2007 - 09:54 PM
I can't find a way of ending a For Next loop so, here we go. EndFor ends loops in a For Next Loop.
James
#2
Posted 02 December 2007 - 09:57 PM
Related
ContinueLoop, ExitLoop
Visit the SciTE4AutoIt3 Download page for the latest versions Forum Rules
Live for the present,
Dream of the future,
Learn from the past.
#4
Posted 02 December 2007 - 10:11 PM
Lost you here ... what does a function have to do with ending a For-Next loop ?But you cant call it from a function..
Visit the SciTE4AutoIt3 Download page for the latest versions Forum Rules
Live for the present,
Dream of the future,
Learn from the past.
#5
Posted 02 December 2007 - 10:12 PM
#6
Posted 02 December 2007 - 10:14 PM
That makes it a lot clearerSay you call the For Next Loop in one function, you cannot call another to stop it.
What about a simple scriptlet to show what you mean because I think its just a matter of properly coding your script ....
Visit the SciTE4AutoIt3 Download page for the latest versions Forum Rules
Live for the present,
Dream of the future,
Learn from the past.
#7
Posted 02 December 2007 - 10:15 PM
Opt("ColorMode", 1) HotKeySet("{F9}", "StartMe") HotKeySet("{F8}", "Terminate") Global $v = 2 While 1 Sleep(100) WEnd Func Terminate() MsgBox(0, "Bot", "Bot stopped!") EndFunc ;==>Terminate Func StartMe() MsgBox(0, "Bot", "Bot started") If $v = 2 Then For $i = 1 To 15 MouseMove(496, 324, 1) MouseClick("right", 496, 324, 2, 5) Sleep(2000) MouseClick("left", 263, 495, 2, 5) MouseMove(263, 495, 1) Sleep(2000) MouseMove(495, 233, 1) MouseClick("left", 495, 233, 2, 5) MouseMove(495, 233, 1) Sleep(2000) Send(" ", 1) Next ElseIf $v = 1 Then MsgBox(0, "Bot", "Variable not set to 2!") EndIf EndFunc ;==>StartMe Func Color() $Colour = PixelGetColor(202, 272) If $Colour = Hex(0xA7885D) Then MsgBox(0, "Colour", Hex($Colour)) Else MsgBox(0, "Colour", "The colour found was not white but, " & Hex($Colour)) EndIf EndFunc ;==>Color
I'm helping someone with a bot.
Edited by JamesB, 02 December 2007 - 10:18 PM.
#8
Posted 02 December 2007 - 10:18 PM
Opt("ColorMode", 1) HotKeySet("{F9}", "StartMe") HotKeySet("{F8}", "Terminate") Global $v = 2 Global $Switch While 1 Sleep(100) WEnd Func Terminate() $Switch = 0 MsgBox(0, "Bot", "Bot stopped!") EndFunc;==>Terminate Func StartMe() MsgBox(0, "Bot", "Bot started") If $v = 2 Then $Switch = 1 For $i = 1 To 15 MouseMove(496, 324, 1) MouseClick("right", 496, 324, 2, 5) If Not $Switch then ExitLoop Sleep(2000) MouseClick("left", 263, 495, 2, 5) MouseMove(263, 495, 1) If Not $Switch then ExitLoop Sleep(2000) MouseMove(495, 233, 1) MouseClick("left", 495, 233, 2, 5) MouseMove(495, 233, 1) If Not $Switch then ExitLoop Sleep(2000) Send(" ", 1) Next ElseIf $v = 1 Then MsgBox(0, "Bot", "Variable not set to 2!") EndIf EndFunc;==>StartMe Func Color() $Colour = PixelGetColor(202, 272) If $Colour = Hex(0xA7885D) Then MsgBox(0, "Colour", Hex($Colour)) Else MsgBox(0, "Colour", "The colour found was not white but, " & Hex($Colour)) EndIf EndFunc;==>Color
Visit the SciTE4AutoIt3 Download page for the latest versions Forum Rules
Live for the present,
Dream of the future,
Learn from the past.
#9
Posted 02 December 2007 - 10:20 PM
I had that before. Just in the wrong place.
Edited by JamesB, 02 December 2007 - 10:27 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




