Guest User

Something a little cleaner to read

a guest
Mar 16th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.96 KB | None | 0 0
  1. local Sizelength = 2
  2. local sizeFront = 2
  3.  
  4. function verwood()
  5.   local height = 0
  6.   local detectx = turtle.detect
  7.  
  8.   local goUp = function()
  9.     turtle.digUp()
  10.     turtle.up()
  11.     height = height + 1
  12.   end
  13.  
  14.   local goDown = function()
  15.     turtle.digDown()
  16.     turtle.down()
  17.     height = height - 1
  18.   end
  19.  
  20.   local turnAround = function()
  21.     turtle.turnRight()
  22.     turtle.turnRight()
  23.   end
  24.  
  25.   function chop4left()
  26.       while goUp() do
  27.         turtle.dig()
  28.       end
  29.  
  30.       turtle.turnRight()
  31.       turtle.forward()
  32.       turtle.turnLeft()
  33.       goDown()
  34.  
  35.       while height>0 do
  36.         turtle.dig()
  37.         goDown()
  38.         turtle.digDown()
  39.       end
  40.  
  41.       turtle.turnRight()
  42.       turtle.back()
  43.       turtle.back()
  44.   end  
  45.  
  46.   if detectx() then
  47.     turtle.dig()
  48.     turtle.forward()
  49.   end
  50.   if not detectx() then
  51.     turtle.back()
  52.     goUp()
  53.  
  54.     while detectx() do
  55.       turtle.dig()
  56.       goUp()
  57.     end
  58.  
  59.     for i = 1, height do
  60.       goDown()  
  61.     end
  62.   else
  63.     turtle.forward()
  64.     turtle.turnLeft()
  65.  
  66.     if detectx() then
  67.       chop4left()
  68.     else
  69.       turnAround()
  70.       while detectx() do
  71.         turtle.dig()
  72.         goUp()
  73.       end
  74.       turtle.turnLeft()
  75.       turtle.forward()
  76.       turtle.turnRight()
  77.       while height > 0 do
  78.         turtle.dig()
  79.         goDown()
  80.       end
  81.       turtle.turnLeft()
  82.       turtle.back()
  83.       turtle.back()
  84.     end
  85.   end
  86. end
  87.  
  88. function walkver()
  89.   if turtle.detect() then
  90.     verwood()
  91.   end
  92. end
  93.  
  94. local stepsback = Sizelength * 2 + 1
  95.  
  96. function minefront()
  97.   for i = 0, sizeFront do
  98.     turtle.forward()
  99.     walkver()
  100.   end
  101. end
  102.  
  103. for i = 0, Sizelength do
  104.   minefront()
  105.   turtle.turnLeft()
  106.   walkver()
  107.   turtle.forward()
  108.   turtle.turnLeft()
  109.   minefront()
  110.   turtle.turnRight()
  111.   walkver()
  112.   turtle.forward()
  113.   turtle.turnRight()
  114.   walkver()
  115. end
  116.  
  117. turtle.turnRight()
  118.  
  119. for i = 0, stepsback do
  120.   turtle.forward()
  121. end
  122.  
  123. turtle.turnLeft()
Advertisement
Add Comment
Please, Sign In to add comment