Advertisement
mcfeuersturm

test

Aug 13th, 2019
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. local mouseWidth = 0
  2. local mouseHeight = 0
  3. reactor = peripheral.find("BigReactors-Reactor")
  4. m = peripheral.wrap("right")
  5.  
  6. --reactor.setActive(false)
  7.  
  8. redstone.setOutput("left", false)
  9.  
  10. m.clear()
  11. m.setTextColour(colors.blue)
  12. m.setTextScale(1)
  13. m.setCursorPos(7,1)
  14. m.write("Reaktor-Programm")
  15. m.setTextColour(colors.white)
  16. m.setCursorPos(1,3)
  17. energy = reactor.getEnergyProducedLastTick()
  18. energy2 = math.ceil(energy, 0.1)
  19. estored = reactor.getEnergyStored()/100
  20. fuelconsum = reactor.getFuelConsumedLastTick()
  21. fuelconsum2 = math.ceil(fuelconsum, 0.1)
  22. fuel = reactor.getFuelAmount()
  23. waste = reactor.getWasteAmount()
  24. m.write("RF/T : ")
  25. if energy2 == 0 then
  26. m.setTextColour(colors.red)
  27. else
  28. m.setTextColour(colors.green)
  29. end
  30. m.write(energy2)
  31. m.setCursorPos(1,4)
  32. m.setTextColour(colors.white)
  33. m.write("KRF : ")
  34. if estored == 0 then
  35. m.setTextColour(colors.red)
  36. else
  37. m.setTextColour(colors.green)
  38. end
  39. m.write(estored)
  40. m.setCursorPos(1,5)
  41. m.setTextColour(colors.white)
  42. m.write("MB/t : ")
  43. if fuelconsum2 == 0 then
  44. m.setTextColour(colors.red)
  45. else
  46. m.setTextColour(colors.green)
  47. end
  48. m.write(fuelconsum2)
  49. m.setCursorPos(1,6)
  50. m.setTextColour(colors.white)
  51. m.write("Yellorium: ")
  52. if fuel == 0 then
  53. m.setTextColour(colors.red)
  54. else
  55. m.setTextColour(colors.green)
  56. end
  57. m.write(fuel)
  58. m.setTextColour(colors.white)
  59. m.setCursorPos(1,7)
  60. m.write("Waste : ")
  61. if waste >= 1000 then
  62. m.setTextColour(colors.red)
  63. else
  64. m.setTextColour(colors.green)
  65. end
  66. m.write(waste)
  67. m.setTextColour(colors.white)
  68. m.setTextScale(1)
  69. m.setCursorPos(1,8)
  70. m.setBackgroundColour((colours.lime))
  71. m.setCursorPos(20,3)
  72. m.write(" An ")
  73.  
  74. m.setBackgroundColour((colors.red))
  75. m.setCursorPos(20,6)
  76. m.write(" Aus ")
  77. m.setBackgroundColour((colors.black))
  78. sleep(1)
  79.  
  80. function cCP()
  81. event,p1,p2,p3 = os.pullEvent("monitor_touch")
  82. mouseWidth = p2
  83. mouseHeight = p3
  84. if mouseWidth > 20 and mouseWidth < 26 and mouseHeight == 3 then
  85. reactor.setActive(true)
  86. redstone.setOutput("left", true)
  87. shell.run("Reactor")
  88. elseif mouseWidth > 20 and mouseWidth < 26 and mouseHeight == 6 then
  89. reactor.setActive(false)
  90. redstone.setOutput("left", false)
  91. shell.run("reboot")
  92. end
  93.  
  94. end
  95.  
  96. function wirelessStart()
  97. local senderId, message, protocol = rednet.receive()
  98.  
  99. if message == "start" then
  100. reactor.setActive(true)
  101. redstone.setOutput("left", true)
  102. shell.run("Reactor")
  103. elseif message == "stop" then
  104. reactor.setActive(false)
  105. redstone.setOutput("left", false)
  106. shell.run("reboot")
  107. end
  108.  
  109. function touch()
  110. repeat
  111. event,p1,p2,p3 = os.pullEvent("monitor_touch")
  112. if event=="monitor_touch" then
  113. mouseWidth = p2
  114. mouseHeight = p3
  115. cCP()
  116. end
  117. until event=="char" and p1==("x")
  118. end
  119.  
  120. parallel.waitForAll(wirelessStart, cCP, touch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement