Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkForDrinks()
- for i = 1,15 do
- turtle.select(i)
- if i == 15 then
- if turtle.getItemCount() == 0 then
- print("No drinks in Inventory.")
- end
- end
- function checkForFood()
- turtle.select(16)
- if turtle.getItemCount(turtle.getSelectedSlot())>0 then
- turtle.drop(1)
- print ("Here you go sir.")
- elseif turtle.getItemCount(turtle.getSelectedSlot())<0 then
- print ("No food in Inventory.")
- end
- if turtle.getItemCount(turtle.getSelectedSlot())>0 then
- turtle.drop()
- print("Here you go sir.")
- break
- end
- end
- end
- write ("Do sir want some drinks or food? ")
- want = read()
- if want == ("drinks") then
- checkForDrinks()
- elseif want == ("food") then
- checkForFood()
- elseif want == ("no") then
- print ("Very well")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement