A2020

6 Foods

Jan 25th, 2016
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.98 KB | None | 0 0
  1. --This goes on the Computer that will handle the orders
  2. --Always name/label computers before working with them example: label set Orders
  3. --To import into the computer use pastebin get xxxxxx startup
  4. --startup will be the name of the program and in this case startup will auto execute everytime the computer reboot or the server restarts
  5. --Wireless modem goes on top by default
  6. --Use a 5 wide 3 tall advanced monitor on bottom by default
  7. --Use advanced computer as well
  8.  
  9.  
  10. mon = peripheral.wrap("bottom") --change here if you want monitor in other location right, left, top, bottom
  11. modem = peripheral.wrap("top") --same here
  12. local orderChannel = 55 --random channel from 1 to 65000 don't touch unless conflicts with other computers on server
  13. modem.open(orderChannel)
  14.  
  15.  
  16. function burger()
  17.  
  18. modem.transmit(orderChannel, orderChannel, "Burger") --Keyword to get burgers
  19.   mon.setBackgroundColor(128)
  20.   mon.setCursorPos(6,10)
  21.   mon.write("--Processing--")
  22. sleep(0.75)
  23.  
  24. modem.transmit(orderChannel, orderChannel, "Clear") --Liberating the system
  25.   mon.setCursorPos(6,10)
  26.   mon.write("----Ready-----")
  27. end --burger function
  28.  
  29.  
  30. function fries()
  31.  
  32. modem.transmit(orderChannel, orderChannel, "Fries") --Keyword to get fries
  33.  
  34.   mon.setBackgroundColor(128)
  35.   mon.setCursorPos(6,10)
  36.   mon.write("--Processing--")
  37. sleep(0.75)
  38.  
  39. modem.transmit(orderChannel, orderChannel, "Clear") --Liberating the system
  40.   mon.setCursorPos(6,10)
  41.   mon.write("----Ready-----")
  42.  
  43. end --fries function
  44.  
  45. function soda()
  46.  
  47. modem.transmit(orderChannel, orderChannel, "Drinks") --Keyword to get sodas
  48.   mon.setBackgroundColor(128)
  49.   mon.setCursorPos(6,10)
  50.   mon.write("--Processing--")
  51. sleep(0.75)
  52.  
  53. modem.transmit(orderChannel, orderChannel, "Clear") --Liberating the system
  54.   mon.setCursorPos(6,10)
  55.   mon.write("----Ready-----")
  56.  
  57. end --soda function
  58.  
  59. function cheese()
  60.  
  61. modem.transmit(orderChannel, orderChannel, "CheeseB") --Keyword to get sodas
  62.   mon.setBackgroundColor(128)
  63.   mon.setCursorPos(6,10)
  64.   mon.write("--Processing--")
  65. sleep(0.75)
  66.  
  67. modem.transmit(orderChannel, orderChannel, "Clear") --Liberating the system
  68.   mon.setCursorPos(6,10)
  69.   mon.write("----Ready-----")
  70.  
  71. end --cheese function
  72.  
  73. function bacon()
  74.  
  75. modem.transmit(orderChannel, orderChannel, "BaconB") --Keyword to get sodas
  76.   mon.setBackgroundColor(128)
  77.   mon.setCursorPos(6,10)
  78.   mon.write("--Processing--")
  79. sleep(0.75)
  80.  
  81. modem.transmit(orderChannel, orderChannel, "Clear") --Liberating the system
  82.   mon.setCursorPos(6,10)
  83.   mon.write("----Ready-----")
  84.  
  85. end --bacon function
  86.  
  87. function shake()
  88.  
  89. modem.transmit(orderChannel, orderChannel, "Shake") --Keyword to get sodas
  90.   mon.setBackgroundColor(128)
  91.   mon.setCursorPos(6,10)
  92.   mon.write("--Processing--")
  93. sleep(0.75)
  94.  
  95. modem.transmit(orderChannel, orderChannel, "Clear") --Liberating the system
  96.   mon.setCursorPos(6,10)
  97.   mon.write("----Ready-----")
  98.  
  99. end --shake function
  100.  
  101.  
  102. function welcome()
  103.  
  104. mon.setBackgroundColor(2048)
  105. mon.clear()
  106.  
  107. mon.setTextScale(2)
  108. mon.setCursorPos(8,1)
  109. mon.write("Welcome to")
  110.  
  111. mon.setCursorPos(8,2)
  112. mon.write("BamsBurgers")
  113.  
  114.  
  115. mon.setCursorPos(10,4)
  116. mon.write("Home of")
  117. mon.setCursorPos(7,5)
  118. mon.write("the BamBurger")
  119. mon.setCursorPos(8,6)
  120. mon.write("Can I take")
  121. mon.setCursorPos(8,7)
  122. mon.write("your order?")
  123.  
  124. mon.setCursorPos(8,9)
  125. mon.setBackgroundColor(32768)
  126. mon.write("Place order")
  127.  
  128.  
  129. while true do
  130.  
  131.  event, side, xPos, yPos = os.pullEvent("monitor_touch")
  132.  
  133.   if xPos <=15 and xPos >= 5 and yPos <=9 and yPos >=9 then
  134.   mon.setBackgroundColor(2048)
  135.   mon.clear()
  136.  
  137.   mon.setTextScale(2)
  138.  
  139.   mon.setCursorPos(8,1)
  140.   mon.write("Right click")
  141.   mon.setCursorPos(7,2)
  142.   mon.write("item to order")
  143.  
  144.   mon.setBackgroundColor(32768)
  145.   mon.setCursorPos(2,4)
  146.   mon.write("Burger")
  147.  
  148.   mon.setCursorPos(16,4)
  149.   mon.write("Milkshake")
  150.  
  151.   mon.setCursorPos(2,6)
  152.   mon.write("CheeseBurger")
  153.  
  154.   mon.setCursorPos(17,6)
  155.   mon.write("Smoothie")
  156.  
  157.   mon.setCursorPos(2,8)
  158.   mon.write("BaconBurger")    
  159.  
  160.   mon.setCursorPos(20,8)
  161.   mon.write("Fries")
  162.  
  163.   mon.setCursorPos(25,1)
  164.   mon.write("X")
  165.  
  166.  
  167.   while true do
  168.  
  169.  event, side, xPos, yPos = os.pullEvent("monitor_touch")
  170.  
  171.   if xPos <=7 and xPos >= 2 and yPos <=4 and yPos >=4 then
  172.   burger()
  173.   end --if burger
  174.  
  175.   if xPos <=13 and xPos >= 2 and yPos <=6 and yPos >=6 then
  176.   cheese()
  177.   end --if cheese
  178.  
  179.   if xPos <=12 and xPos >= 2 and yPos <=8 and yPos >=8 then
  180.   bacon()
  181.   end --if bacon
  182.  
  183.   if xPos <=24 and xPos >= 16 and yPos <=4 and yPos >=4 then
  184.   shake()
  185.   end --if shake
  186.  
  187.   if xPos <=24 and xPos >= 17 and yPos <=6 and yPos >=6 then
  188.   soda()
  189.   end --if soda
  190.  
  191.   if xPos <=24 and xPos >= 20 and yPos <=8 and yPos >=8 then
  192.   fries()
  193.   end --if fries
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.   if xPos <=20 and xPos >= 20 and yPos <=1 and yPos >=1 then
  206.   welcome()
  207.   end --if X  
  208.  
  209.   end --waiting selection
  210.  
  211.   end --place order clicked
  212.  
  213. end --waiting place order click
  214.  
  215. end --welcome function
  216.  
  217.  
  218.  
  219. welcome()
Advertisement
Add Comment
Please, Sign In to add comment