Guest User

Untitled

a guest
Feb 17th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. --ByteZz's ByteElevator--
  2. --vAlpha0.1 2/17/14--
  3.  
  4. --Programmer Notes:
  5.  
  6. --Currently only supports going up--
  7. --More functionality coming shortly!--
  8.  
  9. elevator = function()
  10. print("Elevating "..elevateCount.." blocks")
  11. for elevateLoop = 1, elevateCount do
  12. turtle.up()
  13.  
  14. end
  15. menuScreen()
  16. end
  17.  
  18. menuScreen = function()
  19. print("ByteElevator vA0.1")
  20. print("Current Elevate Count: "..elevateCount")
  21. print("Change Elevate Count: 1")
  22. print("Help Me!: 2")
  23. print("Elevate Now! : 3")
  24. print("Choose answer using '1', '2' or '3': ")
  25. menuSelect = read()
  26. tonumber(menuSelect)
  27. term.clear()
  28. term.setCursorPos(1,1)
  29.  
  30. end
  31.  
  32. resetScreen = function()
  33. term.write("Please press any key to continue...")
  34. os.pullEvent("key")
  35. term.clear()
  36. term.setCursorPos(1,1)
  37. end
  38.  
  39. helpScreen = function()
  40. print("Hi, this is the ByteElevator help screen!")
  41. resetScreen()
  42. print("This application is simple; it wants to make your Turtle an elevator!")
  43. resetScreen()
  44. print("You simply need to step on it, run the code and the elevator will take you up!")
  45. term.write("Press any key to return to the home screen...")
  46. os.pullEvent("key")
  47. term.clear()
  48. term.setCursorPos(1,1)
  49.  
  50. end
  51.  
  52. countOrHelp = function()
  53. if menuSelect == 1 then
  54. print("The current elevate count is "..elevateCount")
  55. print("Would you like to change the elevate count? (y/n)")
  56. helpMenuSelect = read()
  57. if helpMenuSelect == "y" then
  58. print("Input new elevate count in numbers:")
  59. elevateCount = read()
  60. tonumber(elevateCount)
  61. term.clear()
  62. term.setCursorPos(1,1)
  63. menuScreen()
  64. elseif menuSelect == 2 then
  65. helpScreen()
  66. else
  67. elevator()
  68.  
  69. end
  70.  
  71.  
  72.  
  73. elevateCount = 0
  74.  
  75. local menuSelect = 0
  76.  
  77. local helpMenuSelect = ""
  78.  
  79. menuScreen()
Advertisement
Add Comment
Please, Sign In to add comment