Advertisement
mrkarp

Untitled

Nov 30th, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1.  
  2. -- Get Variables (args number of control rods)
  3. function getVars(numberRods)
  4. -- Fuel
  5. fuelMax = reactor.getFuelAmountMax()
  6. fuelAmount = reactor.getFuelAmount()
  7.  
  8. -- Waste
  9. wasteMax = reactor.getFuelAmountMax()
  10. wasteAmount = reactor.getWasteAmount()
  11.  
  12. -- Control Rods
  13. for i = 0, numberRods do
  14. 'r'..i = (100-(reactor.getControlRodLevel(i)))
  15. end
  16.  
  17. -- Temps
  18. casingTemp = reactor.getCasingTemperature()
  19. fuelTemp = reactor.getFuelTemperature()
  20.  
  21. -- Flux
  22. rfStored = reactor.getEnergyStored()
  23. rfStoredFormat = rfStored / 1000
  24. rfPerTick = reactor.getEnergyProducedLastTick()
  25.  
  26. -- Strings
  27. fuelAmountText = math.floor(((reactor.getFuelAmount()/reactor.getFuelAmountMax())*100)+0.5)
  28. wasteAmountText = math.floor(((reactor.getWasteAmount()/reactor.getFuelAmountMax())*100)+0.5)
  29. casingTempText = math.floor(reactor.getCasingTemperature()*100)+0.5
  30. end
  31.  
  32. -- Title Function (cursorPosX, cursorPosY, Title, Color)
  33. function setTitles(curX, curY, title, color)
  34. -- Titles
  35. monitor.setCursorPos(curX, curY)
  36. monitor.setTextColor(colors..'.'..color)
  37. monitor.write(title)
  38. end
  39.  
  40. -- Draw Bars ProgressBar.SetTable("name", max, current, xMin, xMax, y)
  41. function drawBars(name, maxAmount, currentAmount, xMin, xMax, y)
  42. ProgressBar.SetTable(name, maxAmount, currentAmount, xMin, xMax, y)
  43. end
  44.  
  45. if not fs.exists('ProgressBar') then
  46. print('Downloading ProgressBar API...')
  47. pastebin get rzxj0kkm ProgressBar
  48. else
  49. print('You have the ProgressBar API')
  50. end
  51.  
  52. -- Load ProgressBar API
  53. os.loadAPI("ProgressBar")
  54. ProgressBar.SetPeripheral("back")
  55.  
  56. -- Vars
  57. emptyflag = 0
  58. offlineflag = 0
  59. flashflag = 0
  60.  
  61. -- Peripherals
  62. reactor = peripheral.wrap('BigReactors-Reactor_1')
  63. monitor = peripheral.wrap('back')
  64.  
  65. -- Monitor Settings
  66. monitor.setTextScale(1)
  67. monitor.setBackgroundColor(colors.black)
  68.  
  69. while true do
  70. monitor.clear()
  71. sleep(1)
  72. getVars(4)
  73. -- Titles
  74. setTitles(1, 1, "Fuel Levels:", yellow)
  75. setTitles(20, 2, fuelAmountText.." % Fuel", yellow)
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement