You read the text.txt file into the text variable like this:
Then you can check to see if the name in ReadEOClient%A_Index% is found anywhere in the list of names with this line (must be like this, don't add parentheses or anything):
Code: Select all
if ReadEOClient%A_Index% in %text%
The file text.txt must include all the names separated by commas and nothing else. Don't add spaces after the commas or break them into separate lines. Spaces in a name are OK, just don't put spaces between the names. Just like this:
Code: Select all
bruno,jal,breno,jao,pedro,Big Tuf,Lizzy Scout,paulo
Demonstration script:
Code: Select all
ReadEOClient1 := "jao"
ReadEOClient2 := "max"
ReadEoClient3 := "Big Tuf"
; the following line would be replaced by the FileRead line in the actual script:
text := "bruno,jal,breno,jao,pedro,Big Tuf,Lizzy Scout,paulo"
; FileRead, text, text.txt
loop, 3
if ReadEOClient%A_Index% in %text%
MsgBox, % ReadEOClient%A_Index% " is in the list"
else
MsgBox, % ReadEOClient%A_Index% " was not found"