streqicity

bottlefiller

Apr 6th, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. function CheckForEmptyBottles()
  2. deficit=0
  3. turtle.select(1)
  4. bottles=turtle.getItemCount(1)
  5. if bottles<64 then
  6. turtle.suck()
  7. end
  8. end
  9. function FillChest()
  10. for i=2,15 do
  11. turtle.select(i)
  12. turtle.dropUp()
  13. end
  14. end
  15. function SlotCheck()
  16. deficit=0
  17. for i=2,15 do
  18. turtle.select(16)
  19. water=turtle.compareTo(i)
  20. if water==false then
  21. deficit=deficit+1
  22. end
  23. end
  24. return deficit
  25. end
  26. function Refill(bottles)
  27. turtle.select(1)
  28. for i=1,bottles do
  29. turtle.placeDown()
  30. end
  31. end
  32. while true do
  33. CheckForEmptyBottles()
  34. FillChest()
  35. fred=SlotCheck()
  36. Refill(fred)
  37. sleep(1)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment