Xenao

Affichage Draconic Zaip

Oct 29th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. pylon = peripheral.wrap("right")
  2. screen = peripheral.wrap("top")
  3.  
  4. screen.clear()
  5.  
  6. while true do
  7.  
  8. screen.setCursorPos(1,1)
  9. energy = pylon.getEnergyStored()
  10. os.sleep(0.05)
  11. diff = pylon.getEnergyStored()
  12. prod = (energy - diff)/1000
  13. screen.write("Consommation : ")
  14. screen.setCursorPos(16,1)
  15. screen.setTextColor(colors.white)
  16. screen.write(math.ceil(prod))
  17. screen.setCursorPos(18,1)
  18. screen.setTextColor(colors.green)
  19. screen.write("kRF/t")
  20.  
  21. screen.setCursorPos(1,2)
  22. maxenergy = pylon.getMaxEnergyStored()
  23. pourcent = energy/maxenergy*100
  24. screen.write("Batterie     : ")
  25. screen.setCursorPos(16,2)
  26. screen.setTextColor(colors.white)
  27. screen.write(math.ceil(pourcent))
  28. screen.setCursorPos(18,2)
  29. screen.setTextColor(colors.green)
  30. screen.write("%")
  31.  
  32. if pourcent <= 40
  33. then redstone.setOutput("bottom", true)
  34. else redstone.setOutput("bottom", false)
  35. end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment