Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Main program initilizing")
- local reactor = peripheral.wrap("back")
- local cell = peripheral.wrap("right")
- local glasses = peripheral.wrap("left")
- rt = false
- while true do
- cellState = cell.getEnergyStored()
- cellPercent = ((cellState / 80000000) * 100)
- if ((cellPercent < 20) and (rt == false)) then
- reactor.setActive(true)
- rt = true
- print("Reactor is on")
- end
- if ((cellPercent > 90) and (rt == true)) then
- reactor.setActive(false)
- rt = false
- print("Reactor is off")
- end
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement