Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function checkForDrinks()
  2. for i = 1,15 do
  3. turtle.select(i)
  4. if i == 15 then
  5. if turtle.getItemCount() == 0 then
  6. print("No drinks in Inventory.")
  7. end
  8. end
  9. function checkForFood()
  10. turtle.select(16)
  11. if turtle.getItemCount(turtle.getSelectedSlot())>0 then
  12. turtle.drop(1)
  13. print ("Here you go sir.")
  14. elseif turtle.getItemCount(turtle.getSelectedSlot())<0 then
  15. print ("No food in Inventory.")
  16. end
  17. if turtle.getItemCount(turtle.getSelectedSlot())>0 then
  18. turtle.drop()
  19. print("Here you go sir.")
  20. break
  21. end
  22. end
  23. end
  24. write ("Do sir want some drinks or food? ")
  25. want = read()
  26. if want == ("drinks") then
  27. checkForDrinks()
  28. elseif want == ("food") then
  29. checkForFood()
  30. elseif want == ("no") then
  31. print ("Very well")
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement