Advertisement
StreamerYT

IC2,OC : ENERGY (MINEOS)

Aug 25th, 2020 (edited)
1,778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local GUI = require("GUI")
  2. local system = require("System")
  3.  
  4. local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 60, 20, 0xE1E1E1))
  5.  
  6. local xxx1 = window:addChild(GUI.text(2, 2, 0x4B4B4B, " "))
  7. local xxx2 = window:addChild(GUI.text(2, 4, 0x4B4B4B, " "))
  8. local xxx3 = window:addChild(GUI.text(2, 5, 0x4B4B4B, " "))
  9. local xxx4 = window:addChild(GUI.text(2, 7, 0x4B4B4B, " "))
  10. local xxx5 = window:addChild(GUI.text(2, 8, 0x4B4B4B, " "))
  11.  
  12. window.onResize = function(newWidth, newHeight)
  13.   window.backgroundPanel.width, window.backgroundPanel.height = newWidth, newHeight
  14.   layout.width, layout.height = newWidth, newHeight
  15. end
  16.  
  17. workspace:draw()
  18.  
  19.  
  20. local c = require "component"
  21.  
  22. local EUx = 0
  23. local RFx = 0
  24. local space = "          "
  25.  
  26. xxx1.text = "Написал программу: StreamerYT"
  27.  
  28. while true do
  29. -- ========== EU энергия ==========
  30.  
  31. local EU = 0
  32. local EUmax = 0
  33.  
  34. for a, n in c.list("mfe") do
  35. ec = c.proxy(a)
  36. EUmax = EUmax + ec.getEUCapacity()
  37. EU = EU + ec.getStored()
  38. end
  39.  
  40. for a, n in c.list("mfsu") do
  41. ec = c.proxy(a)
  42. EUmax = EUmax + ec.getEUCapacity()
  43. EU = EU + ec.getStored()
  44. end
  45.  
  46. EUp = math.floor((100 / EUmax) * EU)
  47. xxx2.text = "EU: (" .. EUp.. "%) " .. math.floor(EU) .. " / " .. math.floor(EUmax) .. "" .. space
  48. EUx = math.floor(EU - EUx)
  49. --xxx3.text = "Накапливается: " .. EUx .. " EU/s" .. space
  50.  
  51. -- ========== ========== ==========
  52.  
  53.  
  54.  
  55. -- ========== RF энергия ==========
  56.  
  57. local RF = 0
  58. local RFmax = 0
  59.  
  60. for a, n in c.list("tile_thermalexpansion_cell_resonant_name") do
  61. ec = c.proxy(a)
  62. RFmax = RFmax + ec.getMaxEnergyStored()
  63. RF = RF + ec.getEnergyStored()
  64. end
  65.  
  66. RFp = math.floor((100 / RFmax) * RF)
  67. xxx4.text = "RF: (" .. RFp.. "%) " .. math.floor(RF) .. " / " .. math.floor(RFmax) .. "" .. space
  68. RFx = math.floor(RF - RFx)
  69. --xxx5.text = "Накапливается: " .. RFx .. " RF/s" .. space)
  70.  
  71. -- ========== ========== ==========
  72.  
  73. EUx = EU
  74. RFx = RF
  75. --os.sleep(1)
  76. end
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement