Advertisement
shirkit

Wall

Mar 31st, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. local tArgs = {...}
  2. local length = tonumber(tArgs[1]) or 0
  3. local height = tonumber(tArgs[2]) or 0
  4.  
  5. local slot = 1
  6.  
  7. function doWork()
  8.     for i = 1, height, 1 do
  9.         for j = 2, length, 1 do
  10.             turtle.dig()
  11.             turtle.forward()
  12.             turtle.turnRight()
  13.             turtle.turnRight()
  14.            
  15.             place()
  16.             turtle.turnRight()
  17.             turtle.turnRight()
  18.         end
  19.        
  20.         print("desce")
  21.        
  22.         turtle.digDown()
  23.         turtle.down()
  24.         place("up")
  25.         turtle.turnRight()
  26.         turtle.turnRight()
  27.     end
  28. end
  29.  
  30. function place(dir)
  31.     if turtle.getItemCount(slot) == 1 then
  32.         if slot == 16 then
  33.             print("Put more blocks")
  34.             while turtle.getItemCount(slot) == 1 do
  35.                 sleep(1)
  36.             end
  37.             slot = 1
  38.         else
  39.             slot = slot + 1
  40.         end
  41.         turtle.select(slot)
  42.         place(dir)
  43.     end
  44.    
  45.     if dir == "up" then
  46.         turtle.placeUp()
  47.     elseif dir == "down" then
  48.         turtle.placeDown()
  49.     else
  50.         turtle.place()
  51.     end
  52.  
  53. end
  54. doWork()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement