Guest User

Untitled

a guest
Jul 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.77 KB | None | 0 0
  1. function menu1()
  2. rednet.open("right")
  3. itemid = ""
  4. count = 0
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. print(" -Retriever System OS--------------------------- ")
  8. print("|                                               |")
  9. print("| 1. Cobble   -- 2. Wooden Planks  -- 3. Dirt   |")
  10. print("| 4. Gravel   --                                |")
  11. print("|                                               |")
  12. print(" ----------------------------------------------- ")
  13. while true do
  14. event, param1, param2 = os.pullEvent()
  15. if event == "char" and param1 == "n" then menu2() end
  16. if event == "char" and param1 == "1" then cobble() end
  17. if event == "char" and param1 == "2" then woodplank() end
  18. if event == "char" and param1 == "3" then dirt() end
  19. if event == "char" and param1 == "4" then gravel() end
  20. end
  21. end
  22.  
  23.  
  24. function menu2()
  25. rednet.open("right")
  26. itemid = ""
  27. count = 0
  28. term.clear()
  29. term.setCursorPos(1,1)
  30. print(" -Retriever System OS--------------------------- ")
  31. print("|                                               |")
  32. print("| 1. Cobble   -- 2. Wooden Planks  -- 3. Dirt   |")
  33. print("| 4. Gravel   --                                |")
  34. print("|                                               |")
  35. print(" ----------------------------------------------- ")
  36. while true do
  37. event, param1, param2 = os.pullEvent()
  38. if event == "char" and param1 == "n" then menu3() end
  39. if event == "char" and param1 == "1" then cobble() end
  40. if event == "char" and param1 == "2" then woodplank() end
  41. if event == "char" and param1 == "3" then dirt() end
  42. if event == "char" and param1 == "4" then gravel() end
  43. end
  44. end
  45.  
  46.  
  47. function menu3()
  48. rednet.open("right")
  49. itemid = ""
  50. count = 0
  51. term.clear()
  52. term.setCursorPos(1,1)
  53. print(" -Retriever System OS--------------------------- ")
  54. print("|                                               |")
  55. print("| 1. Cobble   -- 2. Wooden Planks  -- 3. Dirt   |")
  56. print("| 4. Gravel   --                                |")
  57. print("|                                               |")
  58. print(" ----------------------------------------------- ")
  59. while true do
  60. event, param1, param2 = os.pullEvent()
  61. if event == "char" and param1 == "n" then menu1() end
  62. if event == "char" and param1 == "1" then cobble() end
  63. if event == "char" and param1 == "2" then woodplank() end
  64. if event == "char" and param1 == "3" then dirt() end
  65. if event == "char" and param1 == "4" then gravel() end
  66. end
  67. end
  68.  
  69.  
  70. function cobble()
  71. itemid = "cobble"
  72. term.clear()
  73. term.setCursorPos(1,1)
  74. print(" -Retriever System OS--------------------------- ")
  75. print("|                                               |")
  76. print("| Cobble comes in Stacks of 64                  |")
  77. print("| Number of stacks you'd like? :                |")
  78. print("|                                               |")
  79. print(" ----------------------------------------------- ")
  80. term.setCursorPos(33, 4)
  81. count = io.read()
  82. count = tonumber(count)
  83. if count > 0 then
  84.  counting()
  85.  else
  86.  menu1()
  87. end
  88. end
  89.  
  90.  
  91. function woodplank()
  92. itemid = "woodplank"
  93. term.clear()
  94. term.setCursorPos(1,1)
  95. print(" -Retriever System OS--------------------------- ")
  96. print("|                                               |")
  97. print("| Woodend planks come one by one                |")
  98. print("| Number of planks you'd like? :                |")
  99. print("|                                               |")
  100. print(" ----------------------------------------------- ")
  101. term.setCursorPos(33, 4)
  102. count = io.read()
  103. count = tonumber(count)
  104. if count > 0 then
  105.  counting()
  106.  else
  107.  menu1()
  108. end
  109. end
  110.  
  111.  
  112. function dirt()
  113. print("ok dirt")
  114. sleep(1)
  115. menu1()
  116. end
  117.  
  118.  
  119. function gravel()
  120. print("ok gravel")
  121. sleep(1)
  122. menu1()
  123. end
  124.  
  125. function counting()
  126. if count > 0 then
  127.  rednet.broadcast(itemid)
  128.  sleep(0.35)
  129.  count = count - 1
  130.  counting()
  131.  else
  132.  menu1()
  133. end
  134. end
  135.  
  136. menu1()
Add Comment
Please, Sign In to add comment