mdc_tjc

mc_stairs

Mar 25th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This program digs a 5 x 5 stairwell down to bedrock
  2.  
  3. -- Functions
  4. function cut(blocks)  -- this function is used to cut the initial run of five steps
  5.   for z = 1, blocks do
  6.     turtle.dig()
  7.     turtle.forward()
  8.     end
  9.   end
  10.  
  11. function cutStep()  -- this function cuts a 4 block high step
  12.   for y = 1, (size - 1) do
  13.     turtle.dig()
  14.     turtle.forward()
  15.     turtle.digDown()
  16.     turtle.digUp()
  17.     turtle.up()
  18.     turtle.digUp()
  19.     turtle.down()
  20.     turtle.down()
  21.     end
  22.   end
  23.  
  24. -- Main program control section
  25.  
  26. size = 5
  27. for a = 1, size do  -- Cut the initial steps
  28.   turtle.digDown()
  29.   turtle.down()
  30.   cut(size - a)
  31.      if (size - (a + 1)) > 0 then
  32.       for b = 1, (size - (a + 1)) do
  33.         turtle.back()
  34.       end
  35.     end
  36.   end
  37.  
  38. for c = 2, 17 do  -- Cut subsequent courses of steps
  39.   turtle.turnRight()
  40.   cutStep()
  41.   end
Advertisement
Add Comment
Please, Sign In to add comment