Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function history_check_load(id, max)
- if id and id ~= ""
- and not data.history[id] then
- data.history[id] = { max = 50, table = {} }
- if max then
- data.history[id].max = max
- end
- local f = io.open(id, "r")
- -- Read history file
- if f then
- for line in f:lines() do
- if util.table.hasitem(data.history[id].table, line) == nil then
- table.insert(data.history[id].table, line)
- if #data.history[id].table >= data.history[id].max then
- break
- end
- end
- end
- f:close()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement