Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[ System Monitor ]--
- --[ VARS ]--
- net = peripheral.wrap("right")
- mon = peripheral.wrap("top")
- --[ FUNCTIONS ]
- function listMFSU()
- local sReturn = ""
- local units = {"rcsteeltankvalvetile_1"}
- term.clear()
- term.setCursorPos(1,1)
- print("Name Stored/Capacity")
- for i=1,3 do
- sReturn = string.format("%8s %7d/%7d (%3d%%)",
- units[i],
- net.callRemote(units[i],"getEUStored"),
- net.callRemote(units[i],"getEUCapacity"),
- net.callRemote(units[i],"getEUStored")/net.callRemote("mfsu_0","getEUCapacity")*100)
- print(sReturn)
- end
- listOilTank()
- end
- function listOilTank()
- local valve = peripheral.wrap("rcsteeltankvalvetile_1")
- local tableInfo = valve.getTankInfo("unknown")
- local lines = 0
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("rcsteeltankvalvetile_1")
- for k, v in pairs(tableInfo) do
- for x, y in pairs(v) do
- if x == "amount" or x == "capacity" then
- lines = lines + 1
- mon.setCursorPos(1,lines +1)
- mon.write(lines..". "..x..": "..y)
- end
- end
- end
- end
- function run()
- while true do
- listOilTank()
- sleep(10)
- end
- end
- --[ MAIN ]--
- run()
Advertisement
Add Comment
Please, Sign In to add comment