Impshial

fusionData

Oct 19th, 2018
142
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Set variables
  2. local mon = peripheral.wrap("right")
  3. local reactor = peripheral.wrap("left")
  4. local x = 1
  5.  
  6. --Variables from Reactor
  7. --local ActivationEnergy = peripheral.call("left", "getActivationEnergy", "left")
  8.  local methods = peripheral.isPresent("left") and peripheral.getMethods("left") or {"No methods"}
  9. -- local methods = peripheral.call("left", "getAdvancedMethodsData")
  10. --local methods = peripheral.call("left", "getTankInfo","right")
  11.  
  12. -- output reactor methods to monitor
  13. mon.clear()
  14. mon.setCursorPos(1,1)
  15. mon.setBackgroundColor(colors.blue)
  16. mon.setTextColor(colors.yellow)
  17. --mon.setBackgroundColor(colors.black)
  18. mon.write("Fusion Reactor Data")
  19. mon.setCursorPos(1,2)
  20. mon.setTextColor(colors.white)
  21. mon.write("----------------------")
  22. while true do
  23.  
  24. os.startTimer(.25)
  25.  
  26. os.pullEvent("timer")
  27.  
  28. x = 3
  29. mon.setCursorPos(1,x)
  30. mon.write("Activation Energy: "..peripheral.call("left", "getActivationEnergy", "left"))
  31. mon.setCursorPos(1,5)
  32. mon.write("Tank Info: ")
  33. local tankinfo = peripheral.call("left", "getTankInfo", "left")
  34.  
  35. x = 6
  36.  
  37. --for k, v in pairs(tankinfo) do
  38. --  print(k, v[1], v[2], v[3])
  39. --end
  40.  
  41. --while tankinfo[n] ~= nil do
  42. --  mon.setCursorPos(1,x)
  43. --  x = x + 1
  44. --  --mon.write("  "..i.." = "..tankinfo[n])
  45. --  mon.write("   ")
  46. --  mon.write(tankinfo[n])
  47. --n = n + 1
  48. --end
  49. for i = 1, #tankinfo do
  50.     mon.setCursorPos(1,x)
  51.     x = x + 1
  52.     --mon.write("  "..i.." = "..tankinfo[i])
  53.     mon.write("   ")
  54.     mon.write(tankinfo[i])
  55. end
  56.  
  57. x = x + 1
  58. mon.setCursorPos(1,x)
  59. mon.write("Energy Stored: "..peripheral.call("left", "getEnergyStored", "left"))
  60. x = x + 2
  61. mon.setCursorPos(1,x)
  62. mon.write("MJ Stored: "..peripheral.call("left", "getMJStored", "left"))
  63.  
  64. x = x + 2
  65. mon.setCursorPos(1,x)
  66. mon.write("Max Energy Stored: "..peripheral.call("left", "getMaxEnergyStored", "left"))
  67.  
  68. x = x + 2
  69. mon.setCursorPos(1,x)
  70. mon.write("Max MJ Received: "..peripheral.call("left", "getMaxMJReceived", "left"))
  71. x = x + 2
  72. mon.setCursorPos(1,x)
  73. mon.write("Max MJ Stored: "..peripheral.call("left", "getMaxMJStored", "left"))
  74. x = x + 2
  75. mon.setCursorPos(1,x)
  76. mon.write("Min MJ Received: "..peripheral.call("left", "getMinMJReceived", "left"))
  77.  
  78. end
  79. --for i = 1, #methods do
  80. --  mon.setCursorPos(1,x)
  81. --  x = x + 1
  82. --  mon.write(i.." = "..methods[i])
  83. --  --mon.write(methods[i])
  84. --end
  85.  
  86. --x = x + 1
  87. --mon.setCursorPos(1,x)
  88. --mon.write("MJ Stored: "..peripheral.call("left", "getMJStored", "left"))
RAW Paste Data