Advertisement
PhyscoKillerMonkey

Stairs

Mar 6th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. local tArgs = { ... }
  2. if #tArgs == 1 then
  3.     height = tonumber(tArgs[1])
  4. else
  5.     print("Usage: stairs <current height>")
  6.     return
  7. end
  8.  
  9. function forward(num)
  10.     for x = 1, num do
  11.         while not turtle.forward() do
  12.             turtle.dig()
  13.         end
  14.     end
  15. end
  16.  
  17. function down(num)
  18.     for x = 1, num do
  19.         while not turtle.down() do
  20.             turtle.digDown()
  21.         end
  22.     end
  23. end
  24.  
  25. function up(num)
  26.     for x = 1, num do
  27.         while not turtle.up() do
  28.             turtle.digUp()
  29.         end
  30.     end
  31. end
  32.  
  33. for x = 1, height do
  34.     forward(1)
  35.     turtle.digUp()
  36.     down(1)
  37.     turtle.digDown()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement