Advertisement
Guest User

startup

a guest
Dec 7th, 2019
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.68 KB | None | 0 0
  1. -- create the peripheral variable --
  2. reactor = "BigReactors-Reactor_0"
  3. monitor = "monitor_4"
  4.  
  5. r = peripheral.wrap(reactor)
  6. m = peripheral.wrap(monitor)
  7.  
  8. -- Clear the moitor and picking information
  9. x, y = m.getSize()
  10. m.clear()
  11. m.setCursorPos(1, 1)
  12. --
  13.  
  14. -- Collecting the Reactor Information --
  15. function react()
  16.   status = r.getActive()
  17.   energy = r.getEnergyStored()
  18.   tick = r.getEnergyProducedLastTick()
  19.   fuelT = r.getFuelTemperature()
  20.   caseT = r.getCasingTemperature()
  21.   fuel = r.getFuelAmount()
  22. end
  23.  
  24. -- function the monitor --
  25. function status2()
  26. m.clear()
  27. m.setCursorPos(1, 1)
  28. m.setTextColor(colors.white)
  29. m.setTextScale(1)
  30. m.write("Status: ")
  31.  
  32. if status == true then
  33.   m.setTextColor(colors.lime)
  34.   m.write("True")
  35. elseif status == false then
  36.   m.setTextColor(colors.red)
  37.   m.write("False")
  38. end
  39. end
  40.  
  41. function temperature()
  42.   m.setTextColor(colors.white)
  43.   m.setCursorPos(1, 3)
  44.   m.write("Fuel Heat: " .. math.floor(fuelT) .. " C")
  45.  
  46.  
  47.   m.setCursorPos(1, 4)
  48.   m.write("Casing Heat: " .. math.floor(caseT) .. " C")
  49. end
  50.  
  51. function Energy()
  52.   m.setCursorPos(1, 6)
  53.   if math.floor(energy) < 10000000 then
  54.     m.write("Stored: " .. math.floor(energy) .." Rf")
  55.   elseif math.floor(energy) == 10000000 then
  56.     m.write("Stored: ")
  57.     m.setTextColor(colors.lime)
  58.     m.write("Full")
  59.   end
  60.   m.setTextColor(colors.white)
  61.   m.setCursorPos(1, 7)
  62.   m.write("Making: " .. math.floor(tick) .. " Rf/t")
  63. end
  64.  
  65. function fuel3()
  66.   m.setCursorPos(1, 9)
  67.   -- porcentagem --
  68.   porcent = (100*fuel)/99907
  69.  
  70.   -- end --
  71.   m.write("Fuel: " .. porcent .. "%" )
  72. end
  73.  
  74. while true do
  75. react()
  76. status2()
  77. temperature()
  78. Energy()
  79. fuel3()
  80. sleep(1)
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement