Advertisement
Guest User

room

a guest
Nov 27th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. print("Si papi")
  2.  
  3. local args = {...}
  4.  
  5. count = 0
  6. direction = 1
  7. length = tonumber(args[1])
  8. width = tonumber(args[2])
  9. height = tonumber(args[3])
  10.  
  11. function dig()
  12.  while turtle.detect() do
  13.   turtle.refuel()
  14.   turtle.dig()
  15.   sleep(1)
  16.  end
  17.  turtle.forward()
  18. end
  19.  
  20. function digUp()
  21.  for i=1, height, 1 do
  22.   while turtle.detectUp() do
  23.    turtle.refuel()
  24.    turtle.digUp()
  25.   sleep(1)
  26.   end
  27.  turtle.up()
  28.  end
  29. end
  30.  
  31. function goDown()
  32.  for i=1, height, 1 do
  33.   turtle.down()
  34.  end
  35. end
  36.  
  37. function digColumn()
  38.  dig()
  39.  digUp()
  40.  goDown()
  41. end
  42.  
  43. function digRow()
  44.  for x=1, length, 1 do
  45.   digColumn()
  46.  end
  47. end
  48.  
  49. for i=1, width, 1 do
  50.  
  51.   digRow()
  52.  
  53.   if direction == 1 then
  54.    turtle.turnRight()
  55.   end
  56.  
  57.   if direction == -1 then
  58.    turtle.turnLeft()
  59.   end
  60.  
  61.   if i < width then
  62.    dig()
  63.    digUp()
  64.    goDown()
  65.   end
  66.  
  67.   if direction == 1 then
  68.    turtle.turnRight()
  69.   end
  70.    
  71.   if direction == -1 then
  72.    turtle.turnLeft()
  73.   end
  74.  
  75.   direction = direction * -1
  76.  
  77.   function digRow()
  78.    for x=1, length - 1, 1 do
  79.     digColumn()
  80.    end
  81.   end
  82.  
  83. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement