Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- write to file when exiting the player or switching file
- function on_file_end(event)
- local message = totaltime .. "s, " .. timeloaded .. filename
- local file = io.open(logpath, "a")
- local lines = {}
- if not paused then totaltime = totaltime + os.clock() - lasttime end
- if file_exists(logpath) then
- for l in file:lines() do
- if not l:find(message, 1, true) then
- lines[#lines+1] = l
- file:write(message)
- end
- end
- file:close()
- mp.osd_message("test")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment