hi, this is probably a noob question but i did write a script to search for a text in a .txt file but it seems to be not working and i cant seem to figure out why any help would be appretiated
#include <File.au3>
Dim $array
$file = @ScriptDir & '\DEBUG.log.txt'
$find = 'Unable to Log in: Invalid Login or PIN'
If $file <> '' Then
_FileReadToArray($file, $array)
For $i = 1 To UBound($array) - 1
if StringInStr($array[$i], $find) Then
MsgBox(64, 'Failed', 'Login Failed')
Else
MsgBox(64, 'Passed','Login Succesfull')
EndIf
Next
Else
MsgBox(64, 'Failed','Empty file')
EndIf
the file contains the $find phrase but the script still returns Login Succesfull and it turns it into an infinite loop.