Advertisement
ecco7777

CC energie anzeige monitor

Sep 26th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. n=peripheral.wrap("bottom")
  2. a,b,c,d=n.get(1)
  3. m=peripheral.wrap("top")
  4. m.setTextColor(1)
  5. m.setTextScale(1)
  6. while true do
  7. a,b,c,d=n.get(1)
  8. x=30/d["maxStorageL"]*d["energyL"]
  9. pro=100/d["maxStorageL"]*d["energyL"]
  10. y=0
  11. m.setBackgroundColor(32768)
  12. m.clear()
  13. m.setTextColor(1)
  14. m.setCursorPos(1,1)
  15. m.write(pro)m.setCursorPos(4,1)m.write("%                           ")
  16. m.setCursorPos(1,2)
  17. m.write("Aktuelle Energie:"..d["energyL"])
  18. m.setCursorPos(1,3)
  19. m.write("Maximale Energie:"..d["maxStorageL"])
  20. m.setCursorPos(1,5)
  21. if pro<20 then m.setBackgroundColor(16384) end
  22. if pro>20 and pro<60 then m.setBackgroundColor(2) end
  23. if pro>60 then m.setBackgroundColor(32) end
  24. while y<x do
  25. m.write(" ")
  26. y=y+1
  27. end
  28. sleep(0.5)
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement