MikiCZEch

1x2 (CC Turtle)

Jun 9th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. xr=read()
  2. x=xr
  3. x=x-1
  4. xc=0
  5. ct=0
  6.  
  7. turtle.select(16)
  8. count = turtle.getItemCount(16)
  9. if count > 0 then
  10.  while xc<x do
  11.   turtle.dig()
  12.   ok = turtle.forward()
  13.   if ok then
  14.    turtle.digDown()
  15.    if ct >= 8 then
  16.     tok = turtle.placeDown()
  17.     if tok then
  18.      ct = 0
  19.     end
  20.    else
  21.     ct=ct+1
  22.    end
  23.    xc=xc+1
  24.   end
  25.  end
  26.  turtle.turnLeft() turtle.turnLeft()
  27.  while xc>0 do
  28.   ok = turtle.forward()
  29.   if ok then xc=xc-1 end
  30.  end
  31. end
Add Comment
Please, Sign In to add comment