Advertisement
colhaydutu

craft

Aug 29th, 2023 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. local monitor = peripheral.wrap("right")
  2. local cableSide = "back"
  3. local white = colors.white
  4. local orange = colors.orange
  5. local red = colors.red
  6.  
  7. local function drawScreen()
  8. monitor.setBackgroundColor(colors.black)
  9. monitor.clear()
  10. monitor.setCursorPos(3, 1)
  11. monitor.setTextScale(1)
  12. monitor.setBackgroundColor(colors.blue)
  13. monitor.setTextColor(colors.white)
  14. monitor.write("[CRAFTING TERMINAL]")
  15.  
  16. monitor.setCursorPos(3, 3)
  17. monitor.setTextScale(1)
  18. monitor.setBackgroundColor(colors.red)
  19. monitor.setTextColor(colors.white)
  20. monitor.write("[ 1 ]")
  21.  
  22. monitor.setCursorPos(10, 3)
  23. monitor.setBackgroundColor(colors.red)
  24. monitor.setTextColor(colors.white)
  25. monitor.write("[ 2 ]")
  26.  
  27. monitor.setCursorPos(17, 3)
  28. monitor.setBackgroundColor(colors.red)
  29. monitor.setTextColor(colors.white)
  30. monitor.write("[ 3 ]")
  31.  
  32. monitor.setCursorPos(3, 6)
  33. monitor.setBackgroundColor(colors.red)
  34. monitor.setTextColor(colors.white)
  35. monitor.write("[ 4 ]")
  36.  
  37. monitor.setCursorPos(10, 6)
  38. monitor.setBackgroundColor(colors.red)
  39. monitor.setTextColor(colors.white)
  40. monitor.write("[ 5 ]")
  41.  
  42. monitor.setCursorPos(17, 6)
  43. monitor.setBackgroundColor(colors.red)
  44. monitor.setTextColor(colors.white)
  45. monitor.write("[ 6 ]")
  46. end
  47.  
  48. drawScreen()
  49.  
  50. while true do
  51. local event, side, x, y = os.pullEvent("monitor_touch")
  52.  
  53. if x >= 3 and x <= 8 and y == 3 then
  54. rs.setBundledOutput(cableSide, white, true)
  55. elseif x >= 10 and x <= 15 and y == 3 then
  56. rs.setBundledOutput(cableSide, white, false)
  57. elseif x >= 17 and x <= 22 and y == 3 then
  58. rs.setBundledOutput(cableSide, orange, true)
  59. elseif x >= 3 and x <= 8 and y == 6 then
  60. rs.setBundledOutput(cableSide, orange, false)
  61. elseif x >= 10 and x <= 15 and y == 6 then
  62. rs.setBundledOutput(cableSide, red, true)
  63. elseif x >= 17 and x <= 22 and y == 6 then
  64. rs.setBundledOutput(cableSide, red, false)
  65. end
  66. drawScreen()
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement