Advertisement
Xatrix97

reaktor_capacitor

Jan 18th, 2019 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.50 KB | None | 0 0
  1. ------------------------------------------------------------------
  2. --                      Version 0.1.1                        --
  3. ------------------------------------------------------------------
  4.  
  5.  
  6. ------------------------Reaktoren---------------------------------
  7.     local reaktor0 = peripheral.wrap("BigReactors-Reactor_0")
  8.  
  9. ------------------------Monitore----------------------------------
  10.  
  11.     local mon1 = peripheral.wrap("monitor_0")  --4:3 Monitor
  12. --  local mon2 = peripheral.wrap("monitor_4")
  13.  
  14. ------------------------Capacitor----------------------------------
  15.  
  16.   local cap1 = peripheral.wrap("tile_blockcapacitorbank_name_0")
  17.   --local cap2 = peripheral.wrap("tile_blockcapacitorbank_name_1")
  18.  
  19.  
  20. while true do
  21. ------------------------Reaktoren---------------------------------
  22.  
  23.  
  24.     local reaktor0_energy = reaktor0.getEnergyStored()
  25.     local reaktor0_status = reaktor0.getActive()
  26.  
  27. ------------------------Capacitor----------------------------------
  28.  
  29.   local cap1_energy = cap1.getEnergyStored()
  30.   local cap2_energy = 0
  31.  
  32. -----------------------AN - AUS - Automatik------------------------
  33.  
  34.         if reaktor0_energy >=       9800000 then
  35.             reaktor0.setActive(false)
  36.         elseif reaktor0_energy <= 5000 then
  37.             reaktor0.setActive(true)
  38.         end
  39.  
  40. ------------------------Anzeige1-----------------------------------
  41. -------------------------------------------------------------------
  42.  
  43.     mon1.clear()
  44.     mon1.setBackgroundColor(colors.black)
  45.  
  46.     mon1.setCursorPos(1,1)
  47.     mon1.setTextColor(colors.orange)
  48.     mon1.write("Reaktor 1")
  49.  
  50. -----------------------Status--------------------------------------
  51.  
  52.     mon1.setCursorPos(1,2)
  53.     mon1.setTextColor(colors.yellow)
  54.     mon1.write("Status: ")
  55.         if reaktor0_status == true then
  56.             mon1.setTextColor(colors.lime)
  57.         elseif reaktor0_status == false then
  58.             mon1.setTextColor(colors.red)
  59.         end
  60.     mon1.write(reaktor0_status)
  61.  
  62. -----------------------Energie-------------------------------------
  63.  
  64.     mon1.setCursorPos(1,3)
  65.     mon1.setTextColor(colors.blue)
  66.     mon1.write("Energie: ")
  67.     mon1.write(math.floor(reaktor0_energy / 100000))
  68.     mon1.write(" MioRF / 100MioRF")
  69.  
  70. -----------------------Capacitor-----------------------------------
  71.  
  72.   mon1.setCursorPos(1,6)
  73.   mon1.setTextColor(colors.purple)
  74.   mon1.write("Capacitor 1")
  75.   mon1.setCursorPos(1,7)
  76.     mon1.setTextColor(colors.green)
  77.     mon1.write("Speicher: ")
  78.     mon1.write(math.floor(cap1_energy / 100000))
  79.     mon1.write(" MioRF / 10MioRF")
  80.  
  81.   mon1.setCursorPos(1,9)
  82.   mon1.setTextColor(colors.purple)
  83.   mon1.write("Capacitor 2")
  84.   mon1.setCursorPos(1,10)
  85.   mon1.setTextColor(colors.green)
  86.   mon1.write("Speicher: ")
  87.   mon1.write(math.floor(cap2_energy / 100000))
  88.   mon1.write(" MioRF")
  89.  
  90. ------------------------Anzeige2-----------------------------------
  91. -------------------------------------------------------------------
  92.  
  93. --[[    mon2.clear()
  94.  
  95.     mon2.setCursorPos(1,1)
  96.     mon2.setTextColor(colors.white)
  97.     mon2.write("Reaktor 1")
  98.  
  99. -----------------------Status--------------------------------------
  100.  
  101.     mon2.setCursorPos(1,2)
  102.     mon2.setTextColor(colors.yellow)
  103.     mon2.write("Status: ")
  104.         if reaktor0_status == true then
  105.                 mon2.setTextColor(colors.lime)
  106.         elseif reaktor0_status == false then
  107.                 mon2.setTextColor(colors.red)
  108.         end     mon2.write(reaktor0_status)
  109.  
  110. -----------------------Energie-------------------------------------
  111.     mon2.setCursorPos(1,3)
  112.     mon2.setTextColor(colors.blue)
  113.     mon2.write("Energie: ")
  114.     mon2.write(math.floor(reaktor0_energy / 100000))
  115.     mon2.write(" MioRF")
  116. ]]--
  117.     sleep(0.010) -- 10 Millisekunden Pause
  118. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement