Advertisement
endminecraffter

endEnergyMonitor

Oct 1st, 2018
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.93 KB | None | 0 0
  1. --##################--
  2. -- Programm von endminecraffter
  3. -- https://pastebin.com/u/endminecraffter
  4. -- Server: MyFTB.de Deutsches Minecraft modded Netzwerk
  5. -- Benoetigte Mods/Apis: Mod Draconic Evolution , API bars(mWcHuiKX)
  6. -- Mon Size: Y: min 4 X: min 5
  7. --##################--
  8.  
  9. function wrapPs(peripheralName)
  10. periTab={}
  11. sideTab={}
  12. if peripheralName==nil then
  13. print("Fehler")
  14. end
  15. local peripherals = peripheral.getNames()
  16. local i2 = 1
  17. for i =1, #peripherals do
  18. if peripheral.getType(peripherals[i])==peripheralName then
  19. periTab[i2]=peripheral.wrap(peripherals[i])
  20. sideTab[i2]=peripherals[i]
  21. i2=i2+1
  22. end
  23. end
  24. if periTab~={} then
  25. return periTab,sideTab
  26. else
  27. return nil
  28. end
  29. end
  30.  
  31. os.loadAPI("bars")
  32.  
  33. mon = peripheral.wrap("top")
  34. mon.setBackgroundColor(colors.black)
  35. mon.clear()
  36. monitor = peripheral.wrap("top")
  37. local linkupdate = http.get("http://computercraft.mineagame.eu/index.html")
  38. local update = linkupdate.readAll()
  39. version = "1.3.2"
  40. PM = "-"
  41. tier = "1"
  42. label = "endEnergyMonitor"
  43. core = wrapPs("draconic_rf_storage")[1]
  44.  
  45. monX, monY = mon.getSize()
  46.  
  47. function loadmon()
  48. mon.setCursorPos(22,1)
  49. mon.write(label)
  50. mon.setCursorPos(2,4)
  51. mon.write("Tier ".. tier)
  52. mon.setCursorPos(19,26)
  53. mon.write("Ene")
  54. mon.setCursorPos(30,26)
  55. mon.write("Tra")
  56. mon.setCursorPos(39,4)
  57. mon.write("Energy:")
  58. mon.setCursorPos(38,6)
  59. mon.write("Transfer:")
  60. mon.setCursorPos(35,5)
  61. local energyStored = core.getEnergyStored()            
  62. local energyMax = core.getMaxEnergyStored()
  63.    if energyStored < 1000 then
  64.         mon.write(energyStored)
  65.     elseif energyStored < 1000000 then
  66.         mon.write(round((energyStored/1000),1))
  67.         mon.write("k")
  68.     elseif energyStored < 1000000000 then
  69.         mon.write(round((energyStored/1000000),1))
  70.         mon.write("M")
  71.     elseif energyStored < 1000000000000 then
  72.         mon.write(round((energyStored/1000000000),1))
  73.         mon.write("G")
  74.     elseif energyStored < 1000000000000000 then
  75.         mon.write(round((energyStored/1000000000000),1))
  76.         mon.write("T")
  77.     elseif energyStored < 1000000000000000000 then
  78.         mon.write(round((energyStored/1000000000000000),1))
  79.         mon.write("P")
  80.     elseif energyStored < 1000000000000000000000 then
  81.         mon.write(round((energyStored/1000000000000000000),1))
  82.         mon.write("E")
  83.     end
  84.     mon.write(" / ")
  85.     if energyMax < 1000 then
  86.         mon.write(energyMax)
  87.     elseif energyMax < 1000000 then
  88.         mon.write(round((energyMax/1000),1))
  89.         mon.write("k")
  90.     elseif energyMax < 1000000000 then
  91.         mon.write(round((energyMax/1000000),1))
  92.         mon.write("M")
  93.     elseif energyMax < 1000000000000 then
  94.         mon.write(round((energyMax/1000000000),1))
  95.         mon.write("G")
  96.     elseif energyMax < 1000000000000000 then
  97.         mon.write(round((energyMax/1000000000000),1))
  98.         mon.write("T")
  99.     elseif energyMax < 1000000000000000000 then
  100.         mon.write(round((energyMax/1000000000000000 ),1))
  101.         mon.write("P")
  102.     elseif energyMax < 1000000000000000000000 then
  103.         mon.write(round((energyMax/1000000000000000000),1))
  104.         mon.write("E")
  105.     end
  106.     mon.write("RF")
  107.  
  108. mon.setCursorPos(39,7)
  109. if PM == "-" then
  110. mon.setTextColor(colors.red)
  111. mon.write("-"..  getTransfer())
  112. mon.setTextColor(colors.white)
  113. elseif PM == "+" then
  114. mon.setTextColor(colors.green)
  115. mon.write("+".. getTransfer())
  116. mon.setTextColor(colors.white)
  117. end
  118. end
  119.  
  120.  
  121. function getTier()
  122. local energyMax = core.getMaxEnergyStored()
  123.   if energyMax < 50000000 then
  124.         tier = 1
  125.     elseif energyMax < 300000000 then
  126.         tier = 2
  127.     elseif energyMax < 2000000000 then
  128.         tier = 3
  129.     elseif energyMax < 10000000000 then
  130.         tier = 4
  131.     elseif energyMax < 60000000000 then
  132.         tier = 5
  133.     elseif energyMax < 500000000000 then
  134.         tier = 6
  135.     elseif energyMax < 3000000000000 then
  136.         tier = 7
  137.     else
  138.         tier = 8
  139.     end
  140. end
  141.  
  142. --if energy1 <= energy2 then
  143. --PM = "+"
  144. --else if energy1 >= energy2 then
  145. --PM = "-"
  146. --end
  147. --end
  148.  
  149. function getTransfer()
  150.     energy1 = core.getEnergyStored()
  151.     sleep(0.02)
  152.     energy2 = core.getEnergyStored()
  153.     if energy1 <= energy2 then
  154.         energyP = energy2 - energy1
  155.         PM = "+"
  156.         return energyP
  157.     else if energy1 >= energy2 then
  158.         PM = "-"
  159.         energyM = energy1 - energy2
  160.         return energyM
  161.     end
  162.     end
  163. end
  164.  
  165. function drawBox(xMin, xMax, yMin, yMax, title, bcolor, tcolor)
  166.     mon.setBackgroundColor(bcolor)
  167.     for xPos = xMin, xMax, 1 do
  168.         mon.setCursorPos(xPos, yMin)
  169.         mon.write(" ")
  170.     end
  171.     for yPos = yMin, yMax, 1 do
  172.         mon.setCursorPos(xMin, yPos)
  173.         mon.write(" ")
  174.         mon.setCursorPos(xMax, yPos)
  175.         mon.write(" ")
  176.     end
  177.     for xPos = xMin, xMax, 1 do
  178.         mon.setCursorPos(xPos, yMax)
  179.         mon.write(" ")
  180.     end
  181.     mon.setCursorPos(xMin+2, yMin)
  182.     mon.setBackgroundColor(colors.black)
  183.     mon.setTextColor(tcolor)
  184.     mon.write(" ")
  185.     mon.write(title)
  186.     mon.write(" ")
  187.     mon.setTextColor(colors.white)
  188. end
  189.  
  190. function drawBoxes()
  191. drawBox(1,17,3,15,"Core", colors.gray, colors.lightGray)
  192. drawBox(34,50,3,15,"Stats", colors.gray, colors.lightGray)
  193. end
  194.  
  195. function addBars()
  196.  
  197.         bars.add("E", "ver", core.getMaxEnergyStored(), round(core.getEnergyStored()-core.getMaxEnergyStored()), 20, 3, 0, 23
  198.         , colors.gray, colors.green)
  199.         bars.add("T", "ver", 2000000, 2000000, 31, 3, 0, 23 , colors.gray, colors.green)    
  200.  
  201.  
  202.     bars.screen()
  203. end
  204.  
  205. bars.construct(monitor)
  206.  
  207. function round(num, idp)
  208.     local mult = 10^(idp or 0)
  209.     return math.floor(num * mult + 0.5) / mult
  210. end
  211.  
  212.  
  213. local function drawL1(xPos, yPos)
  214.     mon.setCursorPos(xPos, yPos)
  215.     mon.setBackgroundColor(colorCore)
  216.     mon.write(" ")
  217.     mon.setCursorPos(xPos, yPos+1)
  218.     mon.write(" ")
  219.     mon.setCursorPos(xPos, yPos+2)
  220.     mon.write(" ")
  221.     mon.setCursorPos(xPos, yPos+3)
  222.     mon.write(" ")
  223.     mon.setCursorPos(xPos, yPos+4)
  224.     mon.setBackgroundColor(colorShield)
  225.     mon.write(" ")
  226.     mon.setCursorPos(xPos, yPos+5)
  227.     mon.setBackgroundColor(colorCore)
  228.     mon.write(" ")
  229.     mon.setCursorPos(xPos, yPos+6)
  230.     mon.write(" ")
  231.     mon.setCursorPos(xPos, yPos+7)
  232.     mon.setBackgroundColor(colorShield)
  233.     mon.write(" ")
  234.     mon.setCursorPos(xPos, yPos+8)
  235.     mon.setBackgroundColor(colorCore)
  236.     mon.write(" ")
  237. end
  238.  
  239. local function drawL2(xPos, yPos)
  240.     mon.setCursorPos(xPos, yPos)
  241.     mon.setBackgroundColor(colorCore)
  242.     mon.write(" ")
  243.     mon.setCursorPos(xPos, yPos+1)
  244.     mon.write(" ")
  245.     mon.setCursorPos(xPos, yPos+2)
  246.     mon.write(" ")
  247.     mon.setCursorPos(xPos, yPos+3)
  248.     mon.write(" ")
  249.     mon.setCursorPos(xPos, yPos+4)
  250.     mon.write(" ")
  251.     mon.setCursorPos(xPos, yPos+5)
  252.     mon.setBackgroundColor(colorShield)
  253.     mon.write(" ")
  254.     mon.setCursorPos(xPos, yPos+6)
  255.     mon.setBackgroundColor(colorCore)
  256.     mon.write(" ")
  257.     mon.setCursorPos(xPos, yPos+7)
  258.     mon.write(" ")
  259.     mon.setCursorPos(xPos, yPos+8)
  260.     mon.write(" ")
  261. end
  262.  
  263. local function drawL3(xPos, yPos)
  264.     mon.setCursorPos(xPos, yPos)
  265.     mon.setBackgroundColor(colorCore)
  266.     mon.write(" ")
  267.     mon.setCursorPos(xPos, yPos+1)
  268.     mon.write(" ")
  269.     mon.setCursorPos(xPos, yPos+2)
  270.     mon.setBackgroundColor(colorShield)
  271.     mon.write(" ")
  272.     mon.setCursorPos(xPos, yPos+3)
  273.     mon.setBackgroundColor(colorCore)
  274.     mon.write(" ")
  275.     mon.setCursorPos(xPos, yPos+4)
  276.     mon.write(" ")
  277.     mon.setCursorPos(xPos, yPos+5)
  278.     mon.write(" ")
  279.     mon.setCursorPos(xPos, yPos+6)
  280.     mon.setBackgroundColor(colorShield)
  281.     mon.write(" ")
  282.     mon.setCursorPos(xPos, yPos+7)
  283.     mon.setBackgroundColor(colorCore)
  284.     mon.write(" ")
  285.     mon.setCursorPos(xPos, yPos+8)
  286.     mon.write(" ")
  287. end
  288.  
  289. local function drawL4(xPos, yPos)
  290.     mon.setCursorPos(xPos, yPos)
  291.     mon.setBackgroundColor(colorCore)
  292.     mon.write(" ")
  293.     mon.setCursorPos(xPos, yPos+1)
  294.     mon.write(" ")
  295.     mon.setCursorPos(xPos, yPos+2)
  296.     mon.write(" ")
  297.     mon.setCursorPos(xPos, yPos+3)
  298.     mon.setBackgroundColor(colorShield)
  299.     mon.write(" ")
  300.     mon.setCursorPos(xPos, yPos+4)
  301.     mon.setBackgroundColor(colorCore)
  302.     mon.write(" ")
  303.     mon.setCursorPos(xPos, yPos+5)
  304.     mon.write(" ")
  305.     mon.setCursorPos(xPos, yPos+6)
  306.     mon.write(" ")
  307.     mon.setCursorPos(xPos, yPos+7)
  308.     mon.setBackgroundColor(colorShield)
  309.     mon.write(" ")
  310.     mon.setCursorPos(xPos, yPos+8)
  311.     mon.setBackgroundColor(colorCore)
  312.     mon.write(" ")
  313. end
  314.  
  315. local function drawL5(xPos, yPos)
  316.     mon.setCursorPos(xPos, yPos)
  317.     mon.setBackgroundColor(colorShield)
  318.     mon.write(" ")
  319.     mon.setCursorPos(xPos, yPos+1)
  320.     mon.setBackgroundColor(colorCore)
  321.     mon.write(" ")
  322.     mon.setCursorPos(xPos, yPos+2)
  323.     mon.write(" ")
  324.     mon.setCursorPos(xPos, yPos+3)
  325.     mon.write(" ")
  326.     mon.setCursorPos(xPos, yPos+4)
  327.     mon.write(" ")
  328.     mon.setCursorPos(xPos, yPos+5)
  329.     mon.write(" ")
  330.     mon.setCursorPos(xPos, yPos+6)
  331.     mon.write(" ")
  332.     mon.setCursorPos(xPos, yPos+7)
  333.     mon.write(" ")
  334.     mon.setCursorPos(xPos, yPos+8)
  335.     mon.write(" ")
  336. end
  337.  
  338. local function drawL6(xPos, yPos)
  339.     mon.setCursorPos(xPos, yPos)
  340.     mon.setBackgroundColor(colorCore)
  341.     mon.write(" ")
  342.     mon.setCursorPos(xPos, yPos+1)
  343.     mon.setBackgroundColor(colorShield)
  344.     mon.write(" ")
  345.     mon.setCursorPos(xPos, yPos+2)
  346.     mon.setBackgroundColor(colorCore)
  347.     mon.write(" ")
  348.     mon.setCursorPos(xPos, yPos+3)
  349.     mon.write(" ")
  350.     mon.setCursorPos(xPos, yPos+4)
  351.     mon.write(" ")
  352.     mon.setCursorPos(xPos, yPos+5)
  353.     mon.setBackgroundColor(colorShield)
  354.     mon.write(" ")
  355.     mon.setCursorPos(xPos, yPos+6)
  356.     mon.setBackgroundColor(colorCore)
  357.     mon.write(" ")
  358.     mon.setCursorPos(xPos, yPos+7)
  359.     mon.write(" ")
  360.     mon.setCursorPos(xPos, yPos+8)
  361.     mon.write(" ")
  362. end
  363.  
  364. local function drawL7(xPos, yPos)
  365.     mon.setCursorPos(xPos, yPos)
  366.     mon.setBackgroundColor(colorCore)
  367.     mon.write(" ")
  368.     mon.setCursorPos(xPos, yPos+1)
  369.     mon.write(" ")
  370.     mon.setCursorPos(xPos, yPos+2)
  371.     mon.write(" ")
  372.     mon.setCursorPos(xPos, yPos+3)
  373.     mon.setBackgroundColor(colorShield)
  374.     mon.write(" ")
  375.     mon.setCursorPos(xPos, yPos+4)
  376.     mon.setBackgroundColor(colorCore)
  377.     mon.write(" ")
  378.     mon.setCursorPos(xPos, yPos+5)
  379.     mon.write(" ")
  380.     mon.setCursorPos(xPos, yPos+6)
  381.     mon.setBackgroundColor(colorShield)
  382.     mon.write(" ")
  383.     mon.setCursorPos(xPos, yPos+7)
  384.     mon.setBackgroundColor(colorCore)
  385.     mon.write(" ")
  386.     mon.setCursorPos(xPos, yPos+8)
  387.     mon.setBackgroundColor(colorShield)
  388.     mon.write(" ")
  389. end
  390.  
  391. local function drawL8(xPos, yPos)
  392.     mon.setCursorPos(xPos, yPos)
  393.     mon.setBackgroundColor(colorCore)
  394.     mon.write(" ")
  395.     mon.setCursorPos(xPos, yPos+1)
  396.     mon.write(" ")
  397.     mon.setCursorPos(xPos, yPos+2)
  398.     mon.write(" ")
  399.     mon.setCursorPos(xPos, yPos+3)
  400.     mon.write(" ")
  401.     mon.setCursorPos(xPos, yPos+4)
  402.     mon.setBackgroundColor(colorShield)
  403.     mon.write(" ")
  404.     mon.setCursorPos(xPos, yPos+5)
  405.     mon.setBackgroundColor(colorCore)
  406.     mon.write(" ")
  407.     mon.setCursorPos(xPos, yPos+6)
  408.     mon.write(" ")
  409.     mon.setCursorPos(xPos, yPos+7)
  410.     mon.write(" ")
  411.     mon.setCursorPos(xPos, yPos+8)
  412.     mon.write(" ")
  413. end
  414.  
  415. local function drawL9(xPos, yPos)
  416.     mon.setCursorPos(xPos, yPos)
  417.     mon.setBackgroundColor(colorCore)
  418.     mon.write(" ")
  419.     mon.setCursorPos(xPos, yPos+1)
  420.     mon.setBackgroundColor(colorShield)
  421.     mon.write(" ")
  422.     mon.setCursorPos(xPos, yPos+2)
  423.     mon.setBackgroundColor(colorCore)
  424.     mon.write(" ")
  425.     mon.setCursorPos(xPos, yPos+3)
  426.     mon.write(" ")
  427.     mon.setCursorPos(xPos, yPos+4)
  428.     mon.write(" ")
  429.     mon.setCursorPos(xPos, yPos+5)
  430.     mon.write(" ")
  431.     mon.setCursorPos(xPos, yPos+6)
  432.     mon.write(" ")
  433.     mon.setCursorPos(xPos, yPos+7)
  434.     mon.setBackgroundColor(colorShield)
  435.     mon.write(" ")
  436.     mon.setCursorPos(xPos, yPos+8)
  437.     mon.setBackgroundColor(colorCore)
  438.     mon.write(" ")
  439. end
  440.  
  441. local function drawL10(xPos, yPos)
  442.     mon.setCursorPos(xPos, yPos)
  443.     mon.setBackgroundColor(colorCore)
  444.     mon.write(" ")
  445.     mon.setCursorPos(xPos, yPos+1)
  446.     mon.write(" ")
  447.     mon.setCursorPos(xPos, yPos+2)
  448.     mon.setBackgroundColor(colorShield)
  449.     mon.write(" ")
  450.     mon.setCursorPos(xPos, yPos+3)
  451.     mon.setBackgroundColor(colorCore)
  452.     mon.write(" ")
  453.     mon.setCursorPos(xPos, yPos+4)
  454.     mon.write(" ")
  455.     mon.setCursorPos(xPos, yPos+5)
  456.     mon.setBackgroundColor(colorShield)
  457.     mon.write(" ")
  458.     mon.setCursorPos(xPos, yPos+6)
  459.     mon.setBackgroundColor(colorCore)
  460.     mon.write(" ")
  461.     mon.setCursorPos(xPos, yPos+7)
  462.     mon.write(" ")
  463.     mon.setCursorPos(xPos, yPos+8)
  464.     mon.setBackgroundColor(colorShield)
  465.     mon.write(" ")
  466. end
  467.  
  468. local function drawL11(xPos, yPos)
  469.     mon.setCursorPos(xPos, yPos)
  470.     mon.setBackgroundColor(colorCore)
  471.     mon.write(" ")
  472.     mon.setCursorPos(xPos, yPos+1)
  473.     mon.write(" ")
  474.     mon.setCursorPos(xPos, yPos+2)
  475.     mon.write(" ")
  476.     mon.setCursorPos(xPos, yPos+3)
  477.     mon.write(" ")
  478.     mon.setCursorPos(xPos, yPos+4)
  479.     mon.write(" ")
  480.     mon.setCursorPos(xPos, yPos+5)
  481.     mon.write(" ")
  482.     mon.setCursorPos(xPos, yPos+6)
  483.     mon.setBackgroundColor(colorShield)
  484.     mon.write(" ")
  485.     mon.setCursorPos(xPos, yPos+7)
  486.     mon.setBackgroundColor(colorCore)
  487.     mon.write(" ")
  488.     mon.setCursorPos(xPos, yPos+8)
  489.     mon.write(" ")
  490. end
  491.  
  492. local function drawL12(xPos, yPos)
  493.     mon.setCursorPos(xPos, yPos)
  494.     mon.setBackgroundColor(colorShield)
  495.     mon.write(" ")
  496.     mon.setCursorPos(xPos, yPos+1)
  497.     mon.setBackgroundColor(colorCore)
  498.     mon.write(" ")
  499.     mon.setCursorPos(xPos, yPos+2)
  500.     mon.write(" ")
  501.     mon.setCursorPos(xPos, yPos+3)
  502.     mon.write(" ")
  503.     mon.setCursorPos(xPos, yPos+4)
  504.     mon.write(" ")
  505.     mon.setCursorPos(xPos, yPos+5)
  506.     mon.write(" ")
  507.     mon.setCursorPos(xPos, yPos+6)
  508.     mon.write(" ")
  509.     mon.setCursorPos(xPos, yPos+7)
  510.     mon.write(" ")
  511.     mon.setCursorPos(xPos, yPos+8)
  512.     mon.write(" ")
  513. end
  514.  
  515. local function drawL13(xPos, yPos)
  516.     mon.setCursorPos(xPos, yPos)
  517.     mon.setBackgroundColor(colorCore)
  518.     mon.write(" ")
  519.     mon.setCursorPos(xPos, yPos+1)
  520.     mon.write(" ")
  521.     mon.setCursorPos(xPos, yPos+2)
  522.     mon.write(" ")
  523.     mon.setCursorPos(xPos, yPos+3)
  524.     mon.setBackgroundColor(colorShield)
  525.     mon.write(" ")
  526.     mon.setCursorPos(xPos, yPos+4)
  527.     mon.setBackgroundColor(colorCore)
  528.     mon.write(" ")
  529.     mon.setCursorPos(xPos, yPos+5)
  530.     mon.write(" ")
  531.     mon.setCursorPos(xPos, yPos+6)
  532.     mon.setBackgroundColor(colorShield)
  533.     mon.write(" ")
  534.     mon.setCursorPos(xPos, yPos+7)
  535.     mon.setBackgroundColor(colorCore)
  536.     mon.write(" ")
  537.     mon.setCursorPos(xPos, yPos+8)
  538.     mon.write(" ")
  539. end
  540.  
  541.  
  542. function loadBall()
  543. colorCore = colors.cyan
  544. colorShield = colors.lightBlue
  545. if Tier == "8" then
  546. colorCore = colors.orange
  547. colorShield = colors.red
  548. end
  549.  
  550.  
  551.   yPos = 5
  552.    xPos = 3
  553.  
  554. drawL1(xPos,yPos)
  555.    drawL2(xPos+1,yPos)
  556.    drawL3(xPos+2,yPos)
  557.    drawL4(xPos+3,yPos)
  558.    drawL5(xPos+4,yPos)
  559.    drawL6(xPos+5,yPos)
  560.    drawL7(xPos+6,yPos)
  561.    drawL8(xPos+7,yPos)
  562.    drawL9(xPos+8,yPos)
  563.    drawL10(xPos+9,yPos)
  564.    drawL11(xPos+10,yPos)
  565.    drawL12(xPos+11,yPos)
  566.    drawL13(xPos+12,yPos)
  567.  
  568.             mon.setBackgroundColor(colors.black)
  569.             mon.setCursorPos(xPos, yPos)
  570.             mon.write("   ")
  571.             mon.setCursorPos(xPos+10, yPos)
  572.             mon.write("   ")
  573.             mon.setCursorPos(xPos, yPos+1)
  574.             mon.write(" ")
  575.             mon.setCursorPos(xPos+12, yPos+1)
  576.             mon.write(" ")
  577.             mon.setCursorPos(xPos, yPos+7)
  578.             mon.write(" ")
  579.             mon.setCursorPos(xPos+12, yPos+7)
  580.             mon.write(" ")
  581.             mon.setCursorPos(xPos, yPos+8)
  582.             mon.write("   ")
  583.             mon.setCursorPos(xPos+10, yPos+8)
  584.             mon.write("   ")
  585. end
  586.  
  587. function checkupdate()
  588. print("Aktuelle Version: ".. version)
  589. print("Neuste Version: ".. update)
  590. end
  591.  
  592. checkupdate()
  593.  
  594. loadBall()
  595. addBars()
  596. drawBoxes()
  597. getTier()
  598. term.write(round(2000000 - getTransfer()))
  599.  
  600. while true do
  601. getTransfer()
  602. loadmon()
  603. bars.set("E", "cur", round(core.getMaxEnergyStored()-core.getEnergyStored()) - 1)
  604. if PM == "-" then
  605. bars.set("T", "cur", 2000000)
  606. elseif PM == "+" then
  607. bars.set("T", "cur", round(2000000 - getTransfer()) - 1)
  608. end
  609. bars.screen()
  610. sleep(0.01)
  611. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement