Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- ---- Adam's TEV Monitor
- ---- Copyright 2022 Adam Mathieson
- --
- -- Pull in Command Line Args
- args = {...}
- -- Globals
- _tevs = {}
- _dir = "/disk10/TEV/"
- function Split(s, delimiter)
- result = {};
- for match in (s..delimiter):gmatch("(.-)"..delimiter) do
- table.insert(result, match);
- end
- return result;
- end
- periphs = peripheral.getNames()
- for _, V in pairs(periphs) do
- if (peripheral.getType(peripheral.wrap(V)) == "Thermal Evaporation Block") then
- tev = peripheral.wrap(V)
- table.insert(_tevs, tev)
- -- File Structure Setup
- fs.makeDir(_dir..Split(peripheral.getName(tev), "_")[2].."/")
- end
- end
- while true do
- for _, V in pairs(_tevs) do
- file = fs.open(_dir..Split(peripheral.getName(V), "_")[2].."/currentTemp", "w")
- file.writeLine(string.format("%i", V.getTemperature()))
- file.close()
- end
- -- Yield to system
- os.queueEvent("looperEvent");
- os.pullEvent();
- os.sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement