Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- ---- Adam's TEV Display (Small)
- ---- Copyright 2022 Adam Mathieson
- --
- -- Pull in Command Line Args
- args = {...}
- -- Globals
- _tevs = {
- args[1],args[2],args[3],args[4]
- }
- _monit = peripheral.wrap(args[5])
- _dir = "/disk10/TEV/"
- term.redirect(_monit)
- term.setBackgroundColor(colors.black)
- term.clear()
- while true do
- i = 0
- for _, V in pairs(_tevs) do
- file = fs.open(_dir..V.."/currentTemp", "r")
- tmp = tonumber(file.readAll())
- file.close()
- str = "TEV_"..V
- if (i == 0) then
- term.setCursorPos(1,1)
- else
- if (i == 1) then
- term.setCursorPos(30-string.len(str),1)
- else
- if (i == 2) then
- term.setCursorPos(1,5)
- else
- if (i == 3) then
- term.setCursorPos(30-string.len(str),5)
- end
- end
- end
- end
- if (tmp > 2000) then
- term.setBackgroundColor(colors.green)
- term.setTextColor(colors.black)
- else
- if (tmp > 1000) then
- term.setBackgroundColor(colors.orange)
- term.setTextColor(colors.black)
- else
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.black)
- end
- end
- term.write(str)
- i = i + 1
- end
- -- Yield to system
- os.queueEvent("looperEvent");
- os.pullEvent();
- os.sleep(0.5)
- end
Add Comment
Please, Sign In to add comment