Guest User

Untitled

a guest
Jan 1st, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. local bridge = peripheral.wrap("top")
  2. local cell1 = peripheral.wrap("cofh_thermalexpansion_energycell_0")
  3. local mfe1 = peripheral.wrap("mfe_0")
  4. bridge.clear()
  5.  
  6. -- Variabeln --
  7. local height = 150
  8. local width = 30
  9. reset = 0
  10.  
  11. if cell1:match"thermalexpansion_energycell" then
  12.  
  13. rfp = bridge.addText(19,173, "0", 0xffffff)
  14.  
  15. back = bridge.addBox(9, 14, 0, 5, 0x000000, 1)
  16. cap = bridge.addGradientBox(10, 15, 0, 5, 0xff0038, 1, 0x37c500, 1, 1)
  17.  
  18. cap.setWidth(width)
  19. cap.setHeight(height)
  20. back.setWidth(width+2)
  21. back.setHeight(height+2)
  22.  
  23. label = bridge.addText(19,5,"RF",0xffffff)
  24.  
  25. else
  26. print("kein rf")
  27. end
  28.  
  29. eup = bridge.addText(19, 373, "0", 0xffffff)
  30.  
  31. back = bridge.addBox(9, 214, 0, 5, 0x000000, 1)
  32. cap = bridge.addGradientBox(10, 215, 0, 5, 0xff0038, 1, 0x37c500, 1, 1)
  33.  
  34. cap.setWidth(width)
  35. cap.setHeight(height)
  36. back.setWidth(width+2)
  37. back.setHeight(height+2)
  38.  
  39. label = bridge.addText(19,205,"EU",0xffffff)
  40.  
  41.  
  42. while true do
  43.  
  44.  
  45. --math --
  46.  
  47. rfs = cell1.getEnergyStored("west")
  48. rfm = cell1.getMaxEnergyStored("west")
  49. rfb = rfs/rfm*100
  50. rfa = math.floor(rfb+0.5)
  51.  
  52. heightrf = height*((100-rfa)/100)
  53.  
  54. eus = mfe1.getEUStored()
  55. eum = mfe1.getEUCapacity()
  56. eub = eus/eum*100
  57. eua = math.floor(eub+0.5)
  58.  
  59. heighteu = height*((100-eua)/100)
  60. -- draw text --
  61.  
  62. rfp.setText(tostring(rfa).."%")
  63. eup.setText(tostring(eua).."%")
  64.  
  65. -- draw box --
  66.  
  67.  
  68. amorf = bridge.addBox(9, 14, 0, 61.5, 0x000000, 1)
  69. amorf.setHeight(heightrf)
  70. amorf.setWidth(width+2)
  71.  
  72. amoeu = bridge.addBox(9, 214, 0, 61.5, 0x000000, 1)
  73. print("1")
  74. amoeu.setHeight(heighteu)
  75. amoeu.setWidth(width+2)
  76.  
  77. reset = reset+1
  78.  
  79. if reset == 2400 then
  80. shell.run("selbst2")
  81. end
  82.  
  83. end
Advertisement
Add Comment
Please, Sign In to add comment