Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lowproblem
- local reactor = peripheral.wrap("back")
- local monitor = peripheral.wrap("left")
- local function drawControls()
- monitor.setBackgroundColor(colors.gray)
- monitor.clear()
- term.redirect(monitor)
- monitor.setCursorPos(1, 1)
- monitor.setTextScale(1)
- paintutils.drawLine(1, 2, 2, 2, colors.lime)
- monitor.setCursorPos(4, 2)
- monitor.setBackgroundColor(colors.gray)
- monitor.write("Reactor Info")
- paintutils.drawLine(17, 2, 17, 2, colors.lime)
- paintutils.drawLine(18, 2, 18, 11, colors.lime)
- paintutils.drawLine(1, 2, 1, 11, colors.lime)
- paintutils.drawLine(1, 11, 2, 11, colors.lime)
- paintutils.drawLine(17, 11, 19, 11, colors.lime)
- end
- drawControls()
- while true do
- local heat = reactor.getTemperature() * 10
- local red = reactor.getRedstone()
- local coal = reactor.getCarbon()
- local ura = reactor.getFuel()
- monitor.clear()
- drawControls()
- monitor.setCursorPos(4, 4)
- monitor.setBackgroundColor(colors.gray)
- monitor.write("Temp: " .. heat .. " °C")
- monitor.setCursorPos(4, 6)
- monitor.write("RedStone: " .. math.floor(red) .. "%")
- monitor.setCursorPos(4, 8)
- monitor.write("Coal: " .. math.floor(coal) .. "%")
- monitor.setCursorPos(4, 10)
- monitor.write("Fuel: " .. math.floor(ura) .. "%")
- sleep(1)
- if heat > 35 or coal == 0 or ura == 0 or red == 0 then
- redstone.setOutput("top", true)
- sleep(1)
- redstone.setOutput("top", false)
- if coal == 0 then
- lowproblem = "LOW COAL"
- end
- if ura == 0 then
- lowproblem = "LOW FUEL"
- end
- if red == 0 then
- lowproblem = "LOW REDSTONE"
- end
- if heat > 100 then
- lowproblem = "HIGH TEMP"
- end
- monitor.clear()
- sleep(1)
- monitor.setCursorPos(1, 1)
- monitor.setBackgroundColor(colors.red)
- monitor.setTextScale(2)
- monitor.setTextColor(colors.white)
- sleep(0.1)
- monitor.setCursorPos(1, 2)
- monitor.write("ALARM")
- monitor.setCursorPos(1, 5)
- monitor.write(lowproblem)
- sleep(2)
- else
- redstone.setOutput("top", false)
- end
- end
Advertisement
Comments
-
- And how can i start the Program?
-
- pastebin get sNuHHNW7 startup.lua
- paste this into the computer after than click the computer again
-
Comment was deleted
Add Comment
Please, Sign In to add comment
Advertisement