Guest User

Untitled

a guest
Oct 12th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.31 KB | None | 0 0
  1. rednet.open("left")
  2.  
  3. while true do
  4.  
  5.   os.pullEvent()
  6.   local y
  7.   y = os.pullEvent()
  8.  
  9.   write( "What's your order?" )
  10.   local input = read()
  11.   y = input
  12.  
  13.   if input == "Hearty_Breakfast" then
  14.  
  15.     local count = turtle.getItemCount( 1 )
  16.     if count >= 16 then
  17.       print( "Funds Sufficient" )
  18.       turtle.transferTo( 2, count - 16 )
  19.       turtle.dropDown( 16 )
  20.       turtle.select( 2 )
  21.       turtle.dropUp()
  22.       turtle.select( 1 )
  23.       rs.setBundledOutput( "front", colors.white )
  24.       sleep(3)
  25.       rs.setBundledOutput( "front", 0 )
  26.     else
  27.       print( "Insufficient Funds" )
  28.     end
  29.    
  30.   elseif input == "Apple_Pie" then
  31.  
  32.     local count = turtle.getItemCount( 1 )
  33.     if count >= 10 then
  34.       print( "Funds Sufficient" )
  35.       turtle.transferTo( 2, count - 10)
  36.       turtle.dropDown( 10 )
  37.       turtle.select( 2 )
  38.       turtle.dropUp()
  39.       turtle.select( 1 )
  40.       rs.setBundledOutput( "front", colors.red )
  41.       sleep(3)
  42.       rs.setBundledOutput( "front", 0 )
  43.     else
  44.       print( "Insufficient Funds" )
  45.     end
  46.  
  47.   elseif input == "Pancakes" then
  48.  
  49.     local count = turtle.getItemCount( 1 )
  50.     if count >= 9 then
  51.       print( "Funds Sufficient" )
  52.       turtle.transferTo( 2, count - 9)
  53.       turtle.dropDown( 9 )
  54.       turtle.select( 2 )
  55.       turtle.dropUp()
  56.       turtle.select( 1 )
  57.       rs.setBundledOutput( "front", colors.orange )
  58.       sleep(3)
  59.       rs.setBundledOutput( "front", 0 )
  60.     else
  61.       print( "Insufficient Funds" )
  62.     end
  63.  
  64.   elseif input == "Citrus_Salad" then
  65.  
  66.     local count = turtle.getItemCount( 1 )
  67.     if count >= 7 then
  68.       print( "Funds Sufficient" )
  69.       turtle.transferTo( 2, count - 7)
  70.       turtle.dropDown( 7 )
  71.       turtle.select( 2 )
  72.       turtle.dropUp()
  73.       turtle.select( 1 )
  74.       rs.setBundledOutput( "front", colors.magenta )
  75.       sleep(3)
  76.       rs.setBundledOutput( "front", 0 )
  77.     else
  78.       print( "Insufficient Funds" )
  79.     end
  80.  
  81.   elseif input == "Chocolate_Bacon" then
  82.  
  83.     local count = turtle.getItemCount( 1 )
  84.     if count >= 7 then
  85.       print( "Funds Sufficient" )
  86.       turtle.transferTo( 2, count -7 )
  87.       turtle.dropDown( 7 )
  88.       turtle.select( 2 )
  89.       turtle.dropUp()
  90.       turtle.select( 1 )
  91.       rs.setBundledOutput( "front", colors.lightblue )
  92.       sleep(3)
  93.       rs.setBundledOutput( "front", 0 )
  94.     else
  95.       print( "Insufficient Funds" )
  96.     end
  97.  
  98.  
  99.   elseif input == "Maple_Candied_Bacon" then
  100.  
  101.     local count = turtle.getItemCount( 1 )
  102.     if count >= 7 then
  103.       print( "Funds Sufficient" )
  104.       turtle.transferTo( 2, count - 7)
  105.       turtle.dropDown( 7 )
  106.       turtle.select( 2 )
  107.       turtle.dropUp()
  108.       turtle.select( 1 )
  109.       rs.setBundledOutput( "front", colors.yellow )
  110.       sleep(3)
  111.       rs.setBundledOutput( "front", 0 )
  112.     else
  113.       print( "Insufficient Funds" )
  114.     end
  115.  
  116.   elseif input == "Sausage_in_Bread" then
  117.  
  118.     local count = turtle.getItemCount( 1 )
  119.     if count >= 6 then
  120.       print( "Funds Sufficient" )
  121.       turtle.transferTo( 2, count - 6)
  122.       turtle.dropDown( 6 )
  123.       turtle.select( 2 )
  124.       turtle.dropUp()
  125.       turtle.select( 1 )
  126.       rs.setBundledOutput( "front", colors.lime )
  127.       sleep(3)
  128.       rs.setBundledOutput( "front", 0 )
  129.     else
  130.       print( "Insufficient Funds" )
  131.     end
  132.  
  133.   elseif input == "Maple_Syrup_Waffles" then
  134.  
  135.     local count = turtle.getItemCount( 1 )
  136.     if count >= 6 then
  137.       print( "Funds Sufficient" )
  138.       turtle.transferTo( 2, count - 6)
  139.       turtle.dropDown( 6 )
  140.       turtle.select( 2 )
  141.       turtle.dropUp()
  142.       turtle.select( 1 )
  143.       rs.setBundledOutput( "front", colors.pink )
  144.       sleep(3)
  145.       rs.setBundledOutput( "front", 0 )
  146.     else
  147.       print( "Insufficient Funds" )
  148.     end
  149.  
  150.   elseif input == "McPam" then
  151.  
  152.     local count = turtle.getItemCount( 1 )
  153.     if count >= 5 then
  154.       print( "Funds Sufficient" )
  155.       turtle.transferTo( 2, count - 5)
  156.       turtle.dropDown( 5 )
  157.       turtle.select( 2 )
  158.       turtle.dropUp()
  159.       turtle.select( 1 )
  160.       rs.setBundledOutput( "front", colors.Gray )
  161.       sleep(3)
  162.       rs.setBundledOutput( "front", 0 )
  163.     else
  164.       print( "Insufficient Funds" )
  165.     end
  166.  
  167.   elseif input == "Cherry_Yogurt" then
  168.  
  169.     local count = turtle.getItemCount( 1 )
  170.     if count >= 5 then
  171.       print( "Funds Sufficient" )
  172.       turtle.transferTo( 2, count - 5)
  173.       turtle.dropDown( 5 )
  174.       turtle.select( 2 )
  175.       turtle.dropUp()
  176.       turtle.select( 1 )
  177.       rs.setBundledOutput( "front", colors.lightGray )
  178.       sleep(3)
  179.       rs.setBundledOutput( "front", 0 )
  180.     else
  181.       print( "Insufficient Funds" )
  182.     end
  183.  
  184.   elseif input == "Strawberry_Yogurt" then
  185.  
  186.     local count = turtle.getItemCount( 1 )
  187.     if count >= 5 then
  188.       print( "Funds Sufficient" )
  189.       turtle.transferTo( 2, count - 5)
  190.       turtle.dropDown( 5 )
  191.       turtle.select( 2 )
  192.       turtle.dropUp()
  193.       turtle.select( 1 )
  194.       rs.setBundledOutput( "front", colors.cyan )
  195.       sleep(3)
  196.       rs.setBundledOutput( "front", 0 )
  197.     else
  198.       print( "Insufficient Funds" )
  199.     end
  200.  
  201.   elseif input == "Soft_Pretzel" then
  202.  
  203.     local count = turtle.getItemCount( 1 )
  204.     if count >= 4 then
  205.       print( "Funds Sufficient" )
  206.       turtle.transferTo( 2, count - 4)
  207.       turtle.dropDown( 4 )
  208.       turtle.select( 2 )
  209.       turtle.dropUp()
  210.       turtle.select( 1 )
  211.       rs.setBundledOutput( "front", colors.purple )
  212.       sleep(3)
  213.       rs.setBundledOutput( "front", 0 )
  214.     else
  215.       print( "Insufficient Funds" )
  216.     end
  217.  
  218.   elseif input == "Donut" then
  219.  
  220.     local count = turtle.getItemCount( 1 )
  221.     if count >= 3 then
  222.       print( "Funds Sufficient" )
  223.       turtle.transferTo( 2, count - 3)
  224.       turtle.dropDown( 3 )
  225.       turtle.select( 2 )
  226.       turtle.dropUp()
  227.       turtle.select( 1 )
  228.       rs.setBundledOutput( "front", colors.blue )
  229.       sleep(3)
  230.       rs.setBundledOutput( "front", 0 )
  231.     else
  232.       print( "Insufficient Funds" )
  233.     end
  234.  
  235.   elseif input == "Orange_Juice" then
  236.  
  237.     local count = turtle.getItemCount( 1 )
  238.     if count >= 3 then
  239.       print( "Funds Sufficient" )
  240.       turtle.transferTo( 2, count - 3)
  241.       turtle.dropDown( 3 )
  242.       turtle.select( 2 )
  243.       turtle.dropUp()
  244.       turtle.select( 1 )
  245.       rs.setBundledOutput( "front", colors.brown )
  246.       sleep(3)
  247.       rs.setBundledOutput( "front", 0 )
  248.     else
  249.       print( "Insufficient Funds" )
  250.     end
  251.    
  252.   elseif input == "Milk" then
  253.  
  254.     local count = turtle.getItemCount( 1 )
  255.     if count >= 2 then
  256.       print( "Funds Sufficient" )
  257.       turtle.transferTo( 2, count - 2)
  258.       turtle.dropDown( 2 )
  259.       turtle.select( 2 )
  260.       turtle.dropUp()
  261.       turtle.select( 1 )
  262.       rs.setBundledOutput( "front", colors.green )
  263.       sleep(3)
  264.       rs.setBundledOutput( "front", 0 )
  265.     else
  266.       print( "Insufficient Funds" )
  267.     end
  268.  
  269.   elseif input == "Lemonade" then
  270.  
  271.     local count = turtle.getItemCount( 1 )
  272.     if count >= 1 then
  273.       print( "Funds Sufficient" )
  274.       turtle.transferTo( 2, count - 1)
  275.       turtle.dropDown( 1 )
  276.       turtle.select( 2 )
  277.       turtle.dropUp()
  278.       turtle.select( 1 )
  279.       rs.setBundledOutput( "front", colors.black )
  280.       sleep(3)
  281.       rs.setBundledOutput( "front", 0 )
  282.     else
  283.       print( "Insufficient Funds" )
  284.     end
  285.   end
  286.  
  287. end
Advertisement
Add Comment
Please, Sign In to add comment