Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Simple MFSU monitor
- local mon = peripheral.wrap("monitor_5")
- local gen = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_0")
- local cable = peripheral.wrap("back")
- ringIt = false
- ringTime = 30
- ticks = 0
- function UpdateData(stored, max)
- -- print(stored)
- if stored >= 40000000 then
- rs.setBundledOutput("back", colors.red)
- rs.setBundledOutput("back", colors.gray)
- mon.setCursorPos(10,20)
- mon.setTextColor(colors.red)
- mon.write("Error, Starting alarm")
- elseif stored <= 50000000 then
- rs.setBundledOutput("back", 0)
- rs.setBundledOutput("back", colors.green)
- mon.setCursorPos(10,13)
- mon.setTextColor(colors.white)
- mon.write("Every thing is ok")
- end
- end
- while true do
- local stored = math.floor(gen.getEnergyStored())
- local max = math.floor(gen.getMaxEnergyStored())
- local percent = stored/max*100
- mon.clear()
- mon.setCursorPos(10,10)
- mon.setTextScale(1.0)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.lime)
- mon.write(stored.." RF/t ")
- mon.setCursorPos(10,11)
- mon.setTextColor(colors.yellow)
- mon.write("Energy is at ".. math.floor(percent).."%")
- UpdateData(stored, max)
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement