Advertisement
Guest User

pushit

a guest
Jul 25th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. function push()
  2. while turtle.detect() == true do
  3.   turtle.dig()
  4.   sleep(.4)
  5.   end
  6. end
  7.  
  8. function step()
  9. if turtle.forward() then
  10.   else
  11.   push()
  12.   turtle.forward()
  13.   end
  14. end
  15.  
  16. function flip()
  17.   for i=1, 40 do
  18.   push()
  19.   turtle.digUp()
  20.   turtle.up()
  21.   end
  22.  
  23.   for p=1, 40 do
  24.   turtle.down()
  25.   end
  26. end
  27.  
  28. function drop()
  29.   turtle.digDown()
  30.   turtle.placeDown()
  31. end
  32.  
  33.  
  34. function ret()
  35.   turtle.turnLeft()  
  36.   for i=1, 62 do
  37.   step()
  38.   end
  39.  
  40.   turtle.turnRight()
  41.  
  42.   for m=1, 11 do
  43.   step()
  44.   end
  45. end
  46.  
  47.  
  48. for x=1, 62 do
  49.  
  50.   flip() --1
  51.   turtle.select(1)
  52.   drop()
  53.   step()
  54.  
  55.   flip()  --2
  56.   turtle.select(2)
  57.   drop()
  58.   step()
  59.  
  60.   flip()  --3
  61.   turtle.select(3)
  62.   drop()
  63.   step()
  64.  
  65.   flip()  --4
  66.   turtle.select(4)
  67.   drop()
  68.   step()
  69.  
  70.   flip()  --5
  71.   turtle.select(5)
  72.   drop()
  73.   step()
  74.  
  75.   flip()  --6
  76.   turtle.select(6)
  77.   drop()
  78.   step()
  79.  
  80.   flip()  --7
  81.   turtle.select(7)
  82.   drop()
  83.   step()
  84.  
  85.   flip()  --8
  86.   turtle.select(8)
  87.   drop()
  88.   step()
  89.  
  90.   flip()  --9
  91.   turtle.select(9)
  92.   drop()
  93.   step()
  94.  
  95.   flip()  --10
  96.   turtle.select(10)
  97.   drop()
  98.   step()
  99.  
  100.   flip()  --11
  101.   turtle.select(11)
  102.   drop()
  103.   step()
  104.  
  105.   for v=1, 11 do
  106.   turtle.back()
  107.   end
  108.  
  109.   turtle.turnRight()
  110.   push()
  111.   step()
  112.   turtle.turnLeft()
  113. end
  114.  
  115. ret()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement