Advertisement
kpvw

Stairs

Dec 15th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local tArgs = {...}
  2.  
  3. toDep = tonumber(tArgs[1])
  4. toWid = tonumber(tArgs[2])
  5.  
  6. print("Digging staircase "..toWid.." blocks wide and "..toDep.." blocks deep.")
  7.  
  8. function staircase(dep)
  9.  for i=1, dep do
  10.   turtle.digDown()
  11.   turtle.digUp()
  12.   turtle.up()
  13.   turtle.digUp()
  14.   turtle.down()
  15.   turtle.down()
  16.   if i < dep then
  17.    turtle.dig()
  18.    turtle.forward()
  19.   end
  20.  end
  21.  for i=1, dep do
  22.   turtle.back()
  23.   turtle.up()
  24.  end
  25. end
  26.  
  27. for i=1, toWid do
  28.  staircase(toDep)
  29.  turtle.turnRight()
  30.  turtle.forward()
  31.  turtle.turnLeft()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement