Advertisement
Guest User

movement

a guest
May 31st, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. local puppy = true
  2.  
  3. while puppy do
  4. local success, blockbelow =  turtle.inspectDown()
  5.  
  6. if blockbelow.name == "minecraft:cobblestone" then -- Makes the turtle move forward
  7.   turtle.forward()
  8.  
  9. elseif blockbelow.name == "minecraft:brick_block" then  -- Makes the turtle pick up all the eggs from a chest
  10.  for n =1, 16 do
  11.  
  12.    turtle.suck()
  13.    
  14.   end
  15.  turtle.turnLeft()
  16.  turtle.turnLeft()
  17.  turtle.forward()
  18.  
  19. elseif blockbelow.name == "minecraft:redstone_block" then -- Makes the turtle turn left
  20.   turtle.turnLeft()
  21.   turtle.forward()
  22.  
  23. elseif blockbelow.name == "minecraft:iron_block" then     --Makes the turtle turn Right
  24. turtle.turnRight()
  25. turtle.forward()
  26.  
  27. elseif blockbelow.name == "minecraft:diamond_block" then -- Does not make it pick up anythingt from a chest but continue on its path
  28. turtle.forward()
  29.  
  30. elseif blockbelow.name == "minecraft:log" then -- Makes turtle move forward
  31. turtle.forward()
  32.  
  33.  
  34.  elseif blockbelow.name == "minecraft:gold_block" then -- Makes turtle put away the eggs it got on its trip in a chest and then return to the starting point
  35.  turtle.turnRight()
  36.  for n = 1, 16 do
  37.    turtle.select(n)
  38.    turtle.drop()
  39.  end
  40.  turtle.turnLeft()
  41.  turtle.turnLeft()
  42.  turtle.forward()
  43.  
  44.  puppy = false                                          -- Shuts down turtle
  45.  elseif blockbelow.name == "minecraft:quartz_block" then
  46.  turtle.turnLeft()
  47.  turtle.forward()
  48.  else
  49. turtle.turnRight()                                      -- Makes the turtle find its path again
  50. turtle.forward()
  51. end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement