Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pushIngredient (ingredientName)
- if going==true then
- for i,v in ipairs(chest.list()) do
- if v.name==ingredientName then
- station.pullItems("bottom",i,1)
- return
- end
- end
- print("Try restocking, couldn't find ",ingredientName,"!")
- going=false
- removeIngredients()
- end
- end
- function removeIngredients ()
- chest.pullItems("front",1)
- chest.pullItems("front",2)
- chest.pullItems("front",3)
- chest.pullItems("front",4)
- chest.pullItems("front",5)
- chest.pullItems("front",6)
- end
- function makeSandwich (sandwichName, count)
- going=true
- while count>0 do
- pushIngredient("minecraft:bread")
- if sandwichName=="simple" then
- pushIngredient("minecraft:cooked_chicken")
- pushIngredient("farmersdelight:onion")
- pushIngredient("farmersdelight:tomato")
- end
- if sandwichName=="complex" then
- pushIngredient("minecraft:cooked_chicken")
- pushIngredient("farmersdelight:bacon_and_eggs")
- pushIngredient("farmersdelight:onion")
- pushIngredient("farmersdelight:tomato")
- end
- if sandwichName=="super" then
- pushIngredient("minecraft:cooked_chicken")
- pushIngredient("farmersdelight:bacon_and_eggs")
- pushIngredient("farmersdelight:onion")
- pushIngredient("farmersdelight:tomato")
- pushIngredient("create_confectionery:bar_of_ruby_chocolate")
- end
- count=count-1
- end
- going=false
- end
- chest=peripheral.wrap("bottom")
- station=peripheral.wrap("front")
- going=false
- while true do
- print("what kind of sandwich do you want (simple, complex, super), and how many?")
- makeSandwich(read(), tonumber(read()))
- print("Finished!")
- end
Add Comment
Please, Sign In to add comment