Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Find all of our peripherals
- battery = peripheral.wrap("bottom")
- -- Check if we have a battery
- if battery == nil then
- error("ER: No battery connected to computer")
- end
- while true do
- local maxEnergy = matrix.getMaxEnergy()/2.5
- local currEnergy = matrix.getEnergy()/2.5
- battery.getEnergy()
- if currEnergy / maxEnergy < 0.5 then
- redstone.setAnalogOutput("back", 15)
- end
- os.sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement