Dodedodo33

BC Meat v1.0 place

May 30th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. function moveForward()
  2.    while not turtle.forward() do
  3.       print("Stuck, retrying")
  4.       sleep(1)
  5.    end
  6. end
  7.  
  8. function moveUp()
  9.    while not turtle.up() do
  10.       print("Stuck, retrying")
  11.       sleep(1)
  12.    end
  13. end
  14.  
  15. function placeSlot(x)
  16.    turtle.select(x)
  17.    turtle.placeDown()
  18. end
  19.  
  20. function clearDirt()
  21.    turtle.select(16)
  22.    turtle.digDown()
  23. end
  24.  
  25. function deploy()
  26.   for i = 2,4 do
  27.     moveForward()
  28.     clearDirt()
  29.     placeSlot(1)
  30.     placeSlot(i)
  31.   end
  32. end
  33.  
  34. function moveToPlace()
  35.    turtle.turnLeft()
  36.    turtle.turnLeft()
  37.    turtle.select(16)
  38.    turtle.digUp()
  39.    for i = 1,2 do
  40.       moveUp()
  41.       turtle.placeDown()
  42.    end
  43. end
  44.  
  45. function goHome()
  46.    turtle.turnLeft()
  47.    turtle.turnLeft()
  48.    for i = 1,3 do
  49.       moveForward()
  50.    end
  51.    turtle.select(16)
  52.    for i = 1,2 do
  53.       turtle.digDown()
  54.       turtle.down()
  55.    end
  56.    turtle.placeUp()
  57. end
  58.    
  59.  
  60. moveToPlace()
  61. deploy()
  62. goHome()
Advertisement
Add Comment
Please, Sign In to add comment