Advertisement
RobotBubble

ClickGameMenu

Nov 1st, 2017
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local x, y = 1,4
  2. local x2, y2 = 1,6
  3. local x3, y3 = 1,8
  4. local x4, y4 = 1,10
  5. local x5, y5 = 1,12
  6. local x6, y6 = 1,14
  7. local x7, y7 = 1,16
  8. local choice1 = "[ ] Menu "
  9. local choice2 = "[ ] 2048 "
  10. local choice3 = "[ ] Reaction "
  11. local choice4 = "[ ] Stackerz "
  12. local choice5 = "[ ] TypeTest "
  13.  
  14. term.clear()
  15. term.setCursorPos(1, 1)
  16. term.setTextColor(colors.lightGray)
  17. print("--------------------------")
  18. print("---")
  19. term.setTextColor(colors.lightBlue)
  20. term.setCursorPos(4, 2)
  21. print("Bubble Bot Computers")
  22. term.setTextColor(colors.lightGray)
  23. term.setCursorPos(24, 2)
  24. print("---")
  25. print("--------------------------")
  26. local function drawMenu()
  27. sleep(.1)
  28. term.setCursorPos(x, y)
  29. term.setTextColor(colors.white)
  30. write(choice1)
  31. term.setCursorPos(x2, y2)
  32. write(choice2)
  33. term.setCursorPos(x3, y3)
  34. write(choice3)
  35. term.setCursorPos(x4, y4)
  36. write(choice4)
  37. term.setCursorPos(x5, y5)
  38. write(choice5)
  39. end
  40.  
  41. drawMenu()
  42.  
  43. while true do
  44. local event, button, cx, cy = os.pullEvent()
  45. if event == "mouse_click" then
  46. if cx >= x and cx < choice1:len() and cy == y and button == 1 then
  47. term.clear()
  48. term.setCursorPos(1, 1)
  49. term.setTextColor(colors.white)
  50. shell.run("menu")
  51. elseif cx >= x2 and cx < choice2:len() and cy == y2 and button == 1 then
  52. term.clear()
  53. term.setCursorPos(1, 1)
  54. term.setTextColor(colors.white)
  55. shell.run("2048")
  56. elseif cx >= x3 and cx < choice3:len() and cy == y3 and button == 1 then
  57. term.clear()
  58. term.setCursorPos(1, 1)
  59. term.setTextColor(colors.white)
  60. shell.run("reaction")
  61. elseif cx >= x4 and cx < choice3:len() and cy == y4 and button == 1 then
  62. term.clear()
  63. term.setCursorPos(1, 1)
  64. term.setTextColor(colors.white)
  65. shell.run("stackerz")
  66. elseif cx >= x5 and cx < choice3:len() and cy == y5 and button == 1 then
  67. term.clear()
  68. term.setCursorPos(1, 1)
  69. term.setTextColor(colors.white)
  70. shell.run("typetest")
  71. end
  72. end
  73. end
Advertisement
RAW Paste Data Copied
Advertisement