Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("top")
- local b = peripheral.wrap(boiler)
- mon.clear()
- --Adjust the textscale if you have a bigger/smaller monitor
- --Increments of 0.5
- mon.setTextScale(1)
- mon.setTextColor(512)
- mon.setCursorPos(1,1)
- mon.write("Boiler status:")
- while true do
- tank = b.getTanks("top")
- local i = 3
- for k,v in pairs(tank)do
- mon.setCursorPos(1,i)
- mon.clearLine()
- mon.setTextColor(512)
- if v["name"] ~=nil then
- mon.write(v["name"] .. ": ")
- end
- mon.setTextColor(colors.orange)
- if v["amount"] ~=nil and v["capacity"] ~=nil then
- mon.setCursorPos(9,i)
- tmp = (v["amount"] / v["capacity"]) *100
- tmp = string.match(tostring(tmp),"[^%.]+")
- mon.write(tmp .. "%")
- end
- i = i +1
- end
- mon.setCursorPos(1,i)
- mon.clearLine()
- mon.setTextColor(512)
- temp = string.match(tostring(b.getTemperature()),"[^%.]+")
- mon.write("Temp: ")
- mon.setTextColor(colors.orange)
- mon.write( temp .."'C")
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement