Advertisement
Guest User

milk.lua

a guest
Jan 26th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. while true do
  2.     -- Get milk
  3.     turtle.place()
  4.  
  5.     -- turn and place milk
  6.     turtle.turnLeft()
  7.     turtle.turnLeft()
  8.     turtle.drop()
  9.     os.sleep(5)
  10.    
  11.     -- Suck out all of the items
  12.     while not turtle.suck() do
  13.     end
  14.     while turtle.suck() do
  15.     end
  16.  
  17.     -- Place all that is not a bucket
  18.     local bucket_id = 0
  19.     for i = 1, 16 do
  20.         turtle.select(i)
  21.         if turtle.getItemDetail(i) ~= nil then
  22.             if not string.match(turtle.getItemDetail(i).name, "bucket") then
  23.                 turtle.drop()
  24.             else
  25.                 bucket_id = i
  26.             end
  27.         end
  28.  
  29.     end
  30.    
  31.     -- Turn back to cow
  32.     turtle.turnRight()
  33.     turtle.turnRight()
  34.     turtle.select(bucket_id)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement