Advertisement
Guest User

cell

a guest
Sep 2nd, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. m = peripheral.wrap("left")
  2. m.setTextScale(1)
  3. m.clear()
  4.  
  5. while true do
  6. local connectors = peripheral.getNames()
  7. local cell, energy, max, pc = {}, {}, {}, {}
  8.  
  9. for k,v in pairs(connectors) do
  10. if peripheral.getType(v) == "cofh_thermalexpansion_energycell" then
  11. local acell = peripheral.wrap(v)
  12. energy[k] = acell.getEnergyStored(v)
  13. max[k] = acell.getMaxEnergyStored(v)
  14. pc[k] = tonumber(energy[k])*10/max[k].."%"
  15. m.setCursorPos(2,2)
  16. end
  17. end
  18. local u = 0
  19. for k,v in pairs(energy) do
  20. if u == 0 then
  21. m.setCursorPos(2,2)
  22. m.write(tonumber(energy[k]).."/".." Rf")
  23.  
  24. u = u+1
  25. elseif u == 1 then
  26.  
  27. u = u+1
  28. elseif u == 2 then
  29. print("hhhhhhhhhhhhh")
  30. end
  31. end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement