[AutoIt] Check element exist in loop

01/30/2016 16:47 KaoriChanMaster#1
Hello.
I have that function:

Code:
Func atak()
	Local $oFrame = _IEFrameGetCollection($oIE, 1)
	Local $tagas = _IETagNameGetCollection($oFrame, "a")
		For $taga In $tagas
			If StringInStr($taga.id,"npvpattack_") Then
				_IEAction($taga,"click")
				Sleep(Round(Random(100, 165), 2))
			EndIf
		Next
EndFunc
And i want to do that:
If $tagas exist or no errors > do "For" loop > at start in loop chekec if no errors > find string with id="xx" then > if no error > ieaction with sleep > else sleep()

Can someone help me with this?