Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function displayFile(file_name, hold_time, monitor_name)
- -- count number of lines in the file
- local lines = 0
- for line in io.lines(file_name) do
- lines = lines + 1
- end
- parallel.waitForAny(
- function()
- -- run the editor
- shell.run(string.format("monitor %s edit %s", monitor_name, file_name))
- end,
- function()
- -- simulate a down key press every hold_time seconds
- for i = 1, lines do
- sleep(hold_time)
- os.queueEvent("key", keys.down)
- end
- end
- )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement