Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local input = peripheral.wrap("IE:hvCapacitor_4")
- local output = peripheral.wrap("IE:hvCapacitor_5")
- function input()
- inputenergy = input.getEnergyStored() / input.getMaxEnergyStored()
- inputenergy = inputenergy * 100
- end
- function output()
- outputenergy = output.getEnergyStored() / output.getMaxEnergyStored()
- outputenergy = outputenergy * 100
- end
- function energy()
- input()
- output()
- energy = inputenergy + outputenergy
- energy = energy / 2
- end
- while true do
- energy()
- if energy > 95 then
- rs.setOutput("top", false)
- else
- if energy < 25 then
- rs.setOutput("top", true)
- end
- end
- print(energy)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement