Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boiler = peripheral.wrap("solid_fueled_boiler_firebox_0")
- turbine = peripheral.wrap("steam_turbine_housing_1")
- mon = peripheral.wrap("left")
- function roundNum(val, decimal)
- if decimal then
- return math.floor(((val * 10^decimal) + 0.5) / (10^decimal))
- end
- end
- while true do
- local connected = turbine.isAddedToEnergyNet()
- local help = turbine.needsMaintenance()
- local temp = roundNum(boiler.getTemperature(), 0)
- mon.setTextScale(2)
- local x,y = mon.getSize()
- mon.clear()
- if temp < 100 or boiler.needsFuel() == true then
- mon.setTextColor(colors.red)
- elseif temp < 400 then
- mon.setTextColor(colors.orange)
- elseif temp > 400 then
- mon.setTextColor(colors.lime)
- end
- local fuel = boiler.needsFuel()
- mon.setCursorPos(1,1)
- if fuel == true then
- mon.write("FUEL LOW")
- end
- mon.setCursorPos(x/2-1,2)
- mon.write("HEAT%")
- mon.setCursorPos(x/2-1,3)
- mon.write(temp / 5 .. " %")
- if help=="true" then
- mon.setTextColor(colors.red)
- mon.setCursorPos(x/2-1,y-2)
- mon.write("POWER")
- mon.setCursorPos(x/2-2,y-1)
- mon.write("OFFLINE")
- end
- if help=="false" then
- mon.setTextColor(colors.lime)
- mon.setCursorPos(x/2-1,y-2)
- mon.write("POWER")
- mon.setCursorPos(x/2-1,y-1)
- mon.write("ONLINE")
- end
- sleep(0.2)
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement