# This is supposed to loop...

## Recommended Posts

It works well for awhile, but at some point, it ends up failing...

```AutoItSetOption("SendKeyDelay", 200)
AutoItSetOption("SendKeyDownDelay", 200)
Sleep(8000)
Send("{ESCAPE}")
Sleep(100)
Send("{ESCAPE}")
Sleep(100)
Send("{ESCAPE}")
Sleep(100)
For \$I = 1 To 100000 Step 1
FIND()
Next

Func FIND()
Send("{F1}")
Sleep(2000)
Send("{LEFT DOWN}")
For \$I = 1 To 1000 Step 1
Send("{TAB}")
If PixelGetColor(1181, 689) = 15262896 And PixelGetColor(1225, 689) = 15262896 Then
\$I = 1000
Send("{LEFT UP}")
PULL()
EndIf
Next
EndFunc

Func PULL()
If PixelGetColor(1181, 689) = 15234280 And PixelGetColor(1225, 689) = 15234280 Then
\$I = 1000
Return
EndIf
Sleep(500)
Send("^3")
Send("^3")
Send("^3")
Sleep(3000)
If PixelGetColor(1181, 689) = 15234280 And PixelGetColor(1225, 689) = 15234280 Then
\$I = 1000
Return
EndIf
If PixelGetColor(1181, 689) = 15262896 And PixelGetColor(1225, 689) = 15262896 Then
Send("^1")
Send("^1")
Send("^1")
\$J = 0
Do
\$J = (\$J + 1)
Until (PixelGetColor(1083, 25) = 16777215 And PixelGetColor(1083, 26) = 16777215 And PixelGetColor(1083, 27) = 16777215 And PixelGetColor(1083, 28) = 16777215 And PixelGetColor(1083, 29) = 16777215 And PixelGetColor(1083, 30) = 16777215 And PixelGetColor(1083, 31) = 16777215 And PixelGetColor(1083, 32) = 16777215 And PixelGetColor(1083, 33) = 16777215 And PixelGetColor(1083, 34) = 16777215 And PixelGetColor(1083, 35) = 16777215 And PixelGetColor(1083, 36) = 16777215 And PixelGetColor(1083, 37) = 16777215 And PixelGetColor(1083, 38) = 16777215) Or \$J = 200
Sleep(500)
Sleep(200)
Send("^3")
Send("^3")
Send("^3")
Sleep(4000)
EndIf
If PixelGetColor(1181, 689) = 15234166 And PixelGetColor(1225, 689) = 15234166 Then
\$I = 1000
Sleep(3000)
ATTACK()
EndIf
EndFunc

Func ATTACK()
Send("^1")
Send("^1")
Send("^1")
Sleep(1000)
Send("^2")
Send("^2")
Send("^2")
KILL()
EndFunc

Func KILL()
For \$I = 1 To 1000 Step 1
Sleep(1000)
If PixelGetColor(1165, 746) = 508167 Then
Send("^6")
Send("^6")
Send("^6")
EndIf
If PixelGetColor(1181, 689) = 15234166 And PixelGetColor(1225, 689) = 15234166 Then
Else
Sleep(500)
Sleep(500)
Sleep(500)
Sleep(500)
Sleep(500)
Sleep(500)
\$I = 1000
CURE()
EndIf
Next
EndFunc

Func CURE()
Sleep(1000)
Send("^0")
Send("^0")
Send("^0")
Sleep(4000)
EndFunc```

##### Share on other sites

So, some questions: Where is it failing at, what do you want it to do, do you get an error message? what are you trying to control, etc.

-_-------__--_-_-____---_-_--_-__-__-_ ^^â‚¬Ã±â€ Â®Ã¸ÃžÃ¿ Ã«Ã—Ã¯Â§â€ Â§ wÃ¯â€ hÃ¸Âµâ€  Æ’Ã«@Â®, wÃ¯â€ hÃ¸Âµâ€  â€ Ã¯mÃ«, @Ã±d wÃ¯â€ hÃ¸Âµâ€  @ â€ Ã¯mÃ¯dÃ¯â€ Ã¿ Æ’Ã¸Â® !Ã¯Æ’Ã«. â‚¬Ã—Ã¯Â§â€  Ã±Ã¸â€ , bÂµâ€  Ã¯Ã±Â§â€ Ã«@d wÃ¯â€ hÃ¯Ã±, Ã±@Ã¿, â€ hÂ®Ã¸ÂµghÃ¸Âµâ€  â€ hÃ« Ã«Â§Â§Ã«Ã±Â§Ã« Ã¸Æ’ !Ã¯Æ’Ã«.

##### Share on other sites

Im not sure where its failing... its for a game... no errors...

The Find function finds what it needs, but sometimes, it doesnt continue to the Kill function... it skips it and manages to find another enemy... so the old enemy just sits there and whails away on me, and kills me...

##### Share on other sites

Its FFXI...

It finds a mob... then it continues to kill it... then cures myself, and its supposed to loop...

But sometimes it finds the mob and engages it... then just looks for another without killing it, or sometimes it turns around in the middle of the battle until the mob kills me.

Any idea?

##### Share on other sites

What happens once it gets to CURE for the last time?!

It doesnt seem to do anything once its finished cure, not even start looping from the start again.

##### Share on other sites

it does, it goes back to the beginning

##### Share on other sites

It doesnt actually go back to the beginning. Once all of the For loops have finished, and the values have reached the For limit, it calls the other functions and when it reaches Cure once all of the functions have reached the highest value nothing happens.

Is that right?!

Please correct me if I am wrong.

Hiyoal

##### Share on other sites

you are wrong, it goes on forever til i stop it

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...