Advertisement
buttercheetah

Untitled

May 16th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. local component = require("component")
  2. local event = require("event")
  3. local m = component.modem
  4. nu = 0
  5. m.open(75)
  6. m.broadcast(70, "ping")
  7. while nu < 10 then
  8. local _, _, from, port, _, message = event.pull("modem_message")
  9. os.sleep(1)
  10. nu = nu + 1
  11. end
  12. if message == "pong then
  13. goto name
  14. else
  15. goto pizend
  16. end
  17. ::name::
  18. os.execute("cls")
  19. print("name for order")
  20. name = io.read("*l")
  21. ::sizes::
  22. os.execute("cls")
  23. print("Currently only one pizza can be ordered at a time")
  24. print("what size pizza would you like?")
  25. print("S - small M - medium L - large XL - Extra Large")
  26. size = io.read("*l")
  27. if size == "S" then
  28. Asize = "small"
  29. goto afters
  30. elseif size == "s" then
  31. Asize = "small"
  32. goto afters
  33. elseif size == "M" then
  34. Asize = "medium"
  35. goto afters
  36. elseif size == "m" then
  37. Asize = "medium"
  38. goto afters
  39. elseif size == "l" then
  40. Asize = "large"
  41. goto afters
  42. elseif size == "L" then
  43. Asize = "large"
  44. goto afters
  45. elseif size == "XL" then
  46. Asize = "extra large"
  47. goto afters
  48. elseif size == "xl" then
  49. Asize = "extra large"
  50. goto afters
  51. else
  52. goto sizes
  53. end
  54. ::afters::
  55. os.execute("cls")
  56. print("type all topping you want")
  57. toppings = io.read("*l")
  58. if toppings == nil then
  59. toppings = plain
  60. end
  61. ::hsi::
  62. os.execute("cls")
  63. print("any special instructions?")
  64. si = io.read("*l")
  65. if not si then
  66. si = "none"
  67. end
  68. ::DOP::
  69. os.execute("cls")
  70. print("do you want pickup or delivery?")
  71. print("p - pickup d - delivery")
  72. dops = io.read("*l")
  73. if dops == "p" then
  74. adop = "pickup"
  75. address = "in store"
  76. elseif dops == "d" then
  77. adop = "delivery"
  78. os.execute("cls")
  79. print("what is the delivery address?")
  80. address = io.read("*l")
  81. else
  82. goto DOP
  83. end
  84. ::cor::
  85. os.execute("cls")
  86. print("is this order correct?")
  87. print(name .. " ordered a " .. Asize .. " pizza with the toppings of " .. toppings .. " for " .. adop .. " at " .. address .. ". with the special instructions of " .. si)
  88. print("y/n")
  89. correct = io.read("*l")
  90. if correct == "y" then
  91. print("order sent")
  92. elseif correct == "n" then
  93. goto sizes
  94. else
  95. goto cor
  96. end
  97. m.broadcast(420, name .. " ordered a " .. Asize .. " pizza with the toppings of " .. toppings .. " for " .. adop .. " at " .. address .. ". with the special instructions of " .. si)
  98. goto pizzend
  99. ::pizend::
  100. os.execute("cls")
  101. print("error could not connect")
  102. os.sleep(2)
  103. ::pizzend::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement