Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local m = component.modem
- nu = 0
- m.open(75)
- m.broadcast(70, "ping")
- while nu < 10 then
- local _, _, from, port, _, message = event.pull("modem_message")
- os.sleep(1)
- nu = nu + 1
- end
- if message == "pong then
- goto name
- else
- goto pizend
- end
- ::name::
- os.execute("cls")
- print("name for order")
- name = io.read("*l")
- ::sizes::
- os.execute("cls")
- print("Currently only one pizza can be ordered at a time")
- print("what size pizza would you like?")
- print("S - small M - medium L - large XL - Extra Large")
- size = io.read("*l")
- if size == "S" then
- Asize = "small"
- goto afters
- elseif size == "s" then
- Asize = "small"
- goto afters
- elseif size == "M" then
- Asize = "medium"
- goto afters
- elseif size == "m" then
- Asize = "medium"
- goto afters
- elseif size == "l" then
- Asize = "large"
- goto afters
- elseif size == "L" then
- Asize = "large"
- goto afters
- elseif size == "XL" then
- Asize = "extra large"
- goto afters
- elseif size == "xl" then
- Asize = "extra large"
- goto afters
- else
- goto sizes
- end
- ::afters::
- os.execute("cls")
- print("type all topping you want")
- toppings = io.read("*l")
- if toppings == nil then
- toppings = plain
- end
- ::hsi::
- os.execute("cls")
- print("any special instructions?")
- si = io.read("*l")
- if not si then
- si = "none"
- end
- ::DOP::
- os.execute("cls")
- print("do you want pickup or delivery?")
- print("p - pickup d - delivery")
- dops = io.read("*l")
- if dops == "p" then
- adop = "pickup"
- address = "in store"
- elseif dops == "d" then
- adop = "delivery"
- os.execute("cls")
- print("what is the delivery address?")
- address = io.read("*l")
- else
- goto DOP
- end
- ::cor::
- os.execute("cls")
- print("is this order correct?")
- print(name .. " ordered a " .. Asize .. " pizza with the toppings of " .. toppings .. " for " .. adop .. " at " .. address .. ". with the special instructions of " .. si)
- print("y/n")
- correct = io.read("*l")
- if correct == "y" then
- print("order sent")
- elseif correct == "n" then
- goto sizes
- else
- goto cor
- end
- m.broadcast(420, name .. " ordered a " .. Asize .. " pizza with the toppings of " .. toppings .. " for " .. adop .. " at " .. address .. ". with the special instructions of " .. si)
- goto pizzend
- ::pizend::
- os.execute("cls")
- print("error could not connect")
- os.sleep(2)
- ::pizzend::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement