Advertisement
Guest User

autoReactor

a guest
Apr 26th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. local Colour2 = term.isColor()
  2. if Colour2 == true then
  3. term.setBackgroundColour(colors.blue)
  4. end
  5. term.clear()
  6. term.setCursorPos(9,9)
  7. term.write("InfiniSoft Reactor Control v2.1")
  8. while true do
  9. local r = peripheral.find("BigReactors-Reactor")
  10. local Energy = r.getEnergyStored()
  11. if Energy < 8000000 then
  12. r.setActive(true)
  13. sleep(0.1)
  14. elseif Energy > 9000000 then
  15. r.setActive(false)
  16. sleep(0.1)
  17. end
  18. local m = peripheral.wrap("left")
  19. local Colour = m.isColour()
  20. if Colour == true then
  21. m.setBackgroundColor(colors.blue)
  22. m.clear()
  23. m.setCursorPos(1,1)
  24. end
  25. local Active = r.getActive()
  26. local RF = r.getEnergyProducedLastTick()
  27. local Fuel = r.getFuelAmount()
  28. local Reactivity = r.getFuelReactivity()
  29. m.setCursorPos(1,1)
  30. if Colour == true then
  31. m.setTextColor(colors.lime)
  32. end
  33. m.write("Energy: ")
  34. if Colour == true then
  35. m.setTextColor(colors.white)
  36. end
  37. m.write(Energy)
  38. m.setCursorPos(1,2)
  39. if Colour == true then
  40. m.setTextColor(colors.lime)
  41. end
  42. m.write("Active: ")
  43. if Colour == true then
  44. m.setTextColor(colors.white)
  45. end
  46. m.write(Active)
  47. m.write(" ")
  48. m.setCursorPos(1,3)
  49. if Colour == true then
  50. m.setTextColor(colors.lime)
  51. end
  52. m.write("RF/t: ")
  53. if Colour == true then
  54. m.setTextColor(colors.white)
  55. end
  56. m.write(RF)
  57. m.setCursorPos(1,4)
  58. if Colour == true then
  59. m.setTextColor(colors.lime)
  60. end
  61. m.write("Fuel: ")
  62. if Colour == true then
  63. m.setTextColor(colors.white)
  64. end
  65. m.write(Fuel)
  66. m.write("     ")
  67. m.setCursorPos(1,5)
  68. if Colour == true then
  69. m.setTextColor(colors.lime)
  70. end
  71. m.write("Fuel Reactivity: ")
  72. if Colour == true then
  73. m.setTextColor(colors.white)
  74. end
  75. m.write(Reactivity)
  76. sleep(0.01)
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement