Advertisement
VGToolBox

8bitMonkeyProg

Feb 17th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Don't need this
  2. function pack(...)
  3.     retVal = {}
  4.     for i, v in ipairs(arg) do
  5.         table.insert(retVal, v)
  6.     end
  7.     return retVal
  8. end
  9.  
  10. --Don't need this either
  11. function writeToMonitors(monitors, word)
  12.     for i, v in ipairs(monitors) do
  13.         v.setCursorPos(1,1)
  14.         v.write(word)
  15.     end
  16. end
  17.  
  18. function getAllPeripherals(filter)
  19.         retVal = {}
  20.         filter = filter or false
  21.         peripherals = peripheral.getNames()
  22.         if not filter then
  23.                 return peripherals
  24.         end
  25.         for i,v in ipairs(peripherals) do
  26.                 if peripheral.getType(v) == filter then
  27.                         table.insert(retVal, peripheral.wrap(v))
  28.                 end
  29.         end
  30.         return retVal
  31. end
  32.  
  33.  
  34.  
  35. monitors = getAllPeripherals("monitor")
  36.  
  37. local reactor1 = peripheral.wrap("BigReactors-Reactor_0")
  38. while true do
  39.  
  40.     for i,v in ipairs(monitors) do
  41.        
  42.  
  43.         local mon = v
  44.  
  45.         mon.clear()
  46.         mon.setTextColor(colors.white)
  47.         mon.setTextScale(1)
  48.  
  49.  
  50.         mon.setCursorPos(1,1)
  51.         mon.write("STATUS: ")
  52.  
  53.         if reactor1.getActive(true) then
  54.             mon.setBackgroundColor(colors.lime)
  55.             mon.write("ACTIVE")
  56.         else
  57.             mon.setBackgroundColor(colors.red)
  58.             mon.write("INACTIVE")
  59.         end
  60.  
  61.         mon.setBackgroundColor(colors.black)
  62.  
  63.         mon.setCursorPos(1,4)
  64.         mon.write("Energy Production: " .. math.floor(reactor1.getEnergyProducedLastTick()) .. " RF/t")
  65.  
  66.         mon.setCursorPos(1,5)
  67.         mon.write("Energy Stored:     " .. math.floor(reactor1.getEnergyStored()) .. " RF")
  68.  
  69.         mon.setCursorPos(1,7)
  70.         mon.write("Fuel Tank          " .. reactor1.getFuelAmountMax() .. " mB")
  71.  
  72.  
  73.         mon.setCursorPos(1,8)
  74.         mon.write("Fuel Available:    " .. math.floor(reactor1.getFuelAmount()) .. " mB")
  75.  
  76.         mon.setCursorPos(1,9)
  77.         mon.write("Fuel Usage:        " .. reactor1.getFuelConsumedLastTick() .. " mB/t")
  78.  
  79.         mon.setCursorPos(1,10)
  80.         mon.write("Fuel Temperature:  " .. math.floor(reactor1.getFuelTemperature()) .." C")
  81.  
  82.         mon.setCursorPos(1,11)
  83.         mon.write("Casing Temperature:" .. math.floor(reactor1.getCasingTemperature()) .. " C")
  84.     end
  85.     sleep(5)
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement