Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = peripheral.wrap("top")
- while (true) do
- local moni = nil
- local linepos = 1
- local t = p.getNamesRemote()
- for mons = 1, #t do
- if string.find(string.lower(t[mons]), "monitor") then
- moni = peripheral.wrap(t[mons])
- end
- end
- if moni == nil then
- moni = peripheral.wrap("left")
- end
- moni.clear()
- moni.setCursorPos(1,1)
- for i = 1, #t do
- moni.setCursorPos(1,linepos)
- if string.find(string.lower(t[i]), "tank") then
- data = p.callRemote(t[i], "getTankInfo","")
- if (data[1]["rawName"] ~= nil) and (data[1]["amount"] ~= nil) and (data[1]["capacity"] ~= nil) then
- moni.write(data[1]["rawName"]..": "..data[1]["amount"].."/"..data[1]["capacity"])
- linepos = linepos + 1
- end
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement