local handle = io.open("test","r") local line = handle:lines() local data = {} --A table which will later store all lines collected from the file repeat table.insert(data,line) line = handle:lines() --Will iterate over all lines in the file until line == nil --Will continue to insert data into the table until nil handle:close() stringData = print(tostring(data)) print(stringData) bannedStrings = { ".EnderOS/.userInfo", ".EnderOS/.passInfo" } for i = 1,2 do match = string.find(data,bannedStrings[i]) if match ~= nil then return error("There is a banned string in here!") else return print("No banned strings detected") end end
Pretty much, it is not iterating correctly and I eventually got this (Pretty proud for doing this btw)
If anyone can point out where i'm incorrectly iterating the file lines that would be amazing.
print(stringData)is for debugging (Forgot to take it out)