Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pylon = peripheral.wrap("right")
- screen = peripheral.wrap("top")
- screen.clear()
- while true do
- screen.setCursorPos(1,1)
- energy = pylon.getEnergyStored()
- os.sleep(0.05)
- diff = pylon.getEnergyStored()
- prod = (energy - diff)/1000
- screen.write("Consommation : ")
- screen.setCursorPos(16,1)
- screen.setTextColor(colors.white)
- screen.write(math.ceil(prod))
- screen.setCursorPos(18,1)
- screen.setTextColor(colors.green)
- screen.write("kRF/t")
- screen.setCursorPos(1,2)
- maxenergy = pylon.getMaxEnergyStored()
- pourcent = energy/maxenergy*100
- screen.write("Batterie : ")
- screen.setCursorPos(16,2)
- screen.setTextColor(colors.white)
- screen.write(math.ceil(pourcent))
- screen.setCursorPos(18,2)
- screen.setTextColor(colors.green)
- screen.write("%")
- if pourcent <= 40
- then redstone.setOutput("bottom", true)
- else redstone.setOutput("bottom", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment