Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("right")
- local reactor = peripheral.wrap("BiggerReactors_Reactor_1")
- function clear()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- end
- function draw_text(x, y, text, text_color, bg_color)
- mon.setBackgroundColor(bg_color)
- mon.setTextColor(text_color)
- mon.setCursorPos(x, y)
- mon.write(text)
- end
- function running()
- if reactor.active() == true then
- return "ONLINE"
- elseif reactor.active() == false then
- return "OFFLINE"
- end
- end
- function running_color()
- if reactor.active() == true then
- return colors.green
- elseif reactor.active() == false then
- return colors.red
- end
- end
- function buffer()
- if math.floor((reactor.battery().stored()/reactor.battery().capacity()) * 100) <= 10 then
- reactor.setActive(true)
- end
- if math.floor((reactor.battery().stored()/reactor.battery().capacity()) * 100) >= 90 then
- reactor.setActive(false)
- end
- end
- while true do
- clear()
- draw_text(2, 2, "Power: ", colors.yellow, colors.black)
- draw_text(10, 2, running(), running_color(), colors.black)
- draw_text(2, 4, "RF/tick: ".. reactor.battery().producedLastTick(), colors.yellow, colors.black)
- draw_text(2, 6, "Stored (RF): ".. math.floor((reactor.battery().stored()/reactor.battery().capacity()) * 100) .."%", colors.yellow, colors.black)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement