Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function writeFileToMonitor(side, file)
- if not fs.exists(file) then
- print("File Not Found")
- return
- end
- local monitor = peripheral.wrap(side)
- monitor.clear()
- local handle = fs.open(file, "r")
- local line = handle.readLine()
- while line ~= nil do
- monitor.write(line .. "\n")
- line = handle.readLine()
- end
- handle.close()
- end
- local args = { ... }
- if #args == 2 then
- writeFileToMonitor(args[1], args[2])
- else
- print("Usage: toMonitor <side> <file>")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement