Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------Variable----------
- side = "bottom"
- Max = 10000000
- temp = 1
- Reactor = peripheral.wrap(side)
- Glasse = peripheral.wrap("top")
- width = 100
- storageUnit = {}
- --------------------------
- storageUnit["bar"] = Glasse.addBox(4,14,0,5,0xCC0000,0.9)
- storageUnit["bar"].setZ(2)
- --------Programs----------
- function check()
- ReactorEnergy = Reactor.getEnergyStored()
- Pourcent = ReactorEnergy / Max * 100
- end
- function OnOff()
- if Pourcent > 80 then
- Reactor.setActive(false)
- elseif Pourcent < 20 then
- Reactor.setActive(true)
- end
- end
- function GlasseTerminal()
- storageUnit["bar"].setWidth(width / Max * ReactorEnergy)
- Glasse.addText(10,25,ReactorEnergy.."/"..Max.." : "..Pourcent)
- Glasse.sync()
- end
- while true do
- check()
- OnOff()
- GlasseTerminal()
- print(ReactorEnergy.." / "..Max.." : "..Pourcent)
- sleep(temp)
- end
- --------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement