Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cableSide = "back"
- energyCell = "right"
- p = peripheral.wrap(energyCell)
- function green()
- rs.setBundledOutput(cableSide, colors.green+colors.yellow+colors.orange+colors.red)
- end
- function yellow()
- rs.setBundledOutput(cableSide, colors.yellow+colors.orange+colors.red)
- end
- function orange()
- rs.setBundledOutput(cableSide, colors.orange+colors.red)
- end
- function red()
- rs.setBundledOutput(cableSide, colors.red)
- end
- while true do
- mom = p.getEnergyStored(energyCell)
- max = p.getMaxEnergyStored(energyCell)
- y = max*0.75
- o = max*0.50
- r = max*0.25
- if mom > y then
- green()
- elseif mom > o then
- yellow()
- elseif mom > r then
- orange()
- else
- red()
- end
- while mom==0 do
- mom = p.getEnergyStored(energyCell)
- green()
- sleep(0.5)
- rs.setBundledOutput(cableSide, 0)
- sleep(0.5)
- end
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment