Advertisement
Guest User

main

a guest
Dec 9th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. local mon = peripheral.wrap("monitor_0")
  2. local r1 = peripheral.wrap("BigReactors-Reactor_0")
  3. local timeout = os.startTimer(1)
  4. local im = paintutils.loadImage("bg")
  5.  
  6. mon.clear()
  7. term.redirect(mon)
  8. paintutils.drawImage(im, 1, 1)
  9.  
  10. while true do
  11. timeout = os.startTimer(1)
  12. mon.setCursorPos(1,1)
  13. mon.setTextColor(colors.blue)
  14. mon.write("CTRL Rods:")
  15. mon.setCursorPos(16,2)
  16. mon.setTextColor(colors.lightBlue)
  17. mon.write("+>")
  18. mon.setCursorPos(1,2)
  19. mon.write("Degrees C")
  20. mon.setCursorPos(1,3)
  21. mon.setTextColor(colors.blue)
  22. mon.write("Casing: ")
  23. mon.setTextColor(colors.white)
  24. mon.write(math.floor(r1.getCasingTemperature()))
  25. mon.setCursorPos(1,4)
  26. mon.setTextColor(colors.blue)
  27. mon.write("Fuel  : ")
  28. mon.setTextColor(colors.white)
  29. mon.write(math.floor(r1.getFuelTemperature()))
  30. mon.setCursorPos(13,2)
  31. mon.setTextColor(colors.lightBlue)
  32. mon.write("<-")
  33. mon.setCursorPos(15,2)
  34. mon.setTextColor(colors.white)
  35. mon.write("%")
  36. mon.setCursorPos(14,1)
  37. mon.setTextColor(colors.white)
  38. mon.write(math.floor(r1.getControlRodLevel(0,100)))
  39. mon.setCursorPos(9,12)
  40. mon.setTextColor(colors.white)
  41. mon.write("ON")
  42. mon.setCursorPos(14,12)
  43. mon.setTextColour(colors.white)
  44. mon.write("OFF")
  45.  
  46. event = {os.pullEvent()}
  47. if event[1] == "monitor_touch" then
  48. event,side,x,y = os.pullEvent()
  49. if x == 17 and y == 2 then
  50. r1.setAllControlRodLevels(r1.getControlRodLevel(0)+10)
  51.  
  52. elseif x == 13 and y == 2 then
  53. r1.setAllControlRodLevels(r1.getControlRodLevel(0)-10)
  54.  
  55. elseif event[1] == "timer" and event[2] == timeout then
  56. timeout = os.startTimer(1)
  57.  
  58. elseif x >= 7 and x <= 11 and y >= 11 and y <= 12 then
  59. r1.setActive(true)
  60.  
  61. elseif x >= 13 and x <=17 and y >= 11 and y <=12 then
  62. r1.setActive(false)
  63.  
  64. end
  65. end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement