Willibilly19

Walls

Dec 22nd, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tArgs = {...}
  2.  
  3. if #tArgs ~= 2 then
  4.   error("Usage: Walls <Height> <Length>")
  5. end
  6.  
  7. x = 1
  8. height = tArgs[1]
  9. length = tArgs[2]/2
  10. print("Building "..height.." high.")
  11. print("Building "..tArgs[2].." long.")
  12.  
  13.  
  14.  
  15.  
  16. function up()
  17.  for i = 1,height do
  18.   slot()
  19.   turtle.up()
  20.   turtle.placeDown()
  21.  end
  22. end
  23.  
  24. function down()
  25.  for i = 1,height-1 do
  26.   slot()
  27.   turtle.down()
  28.   turtle.placeUp()
  29.  end
  30. end
  31.  
  32. function spin()
  33.  turtle.turnLeft()
  34.  turtle.turnLeft()
  35. end
  36.  
  37. function two()
  38.  up()
  39.  turtle.forward()
  40.  turtle.down()
  41.  down()
  42.  turtle.forward()
  43.  spin()
  44.  turtle.place()
  45.  spin()
  46. end
  47.  
  48. function slot()
  49.  x = 1
  50.  while turtle.getItemCount(x) < 1 do
  51.   x = x+1
  52.   turtle.select(x)
  53.  end
  54. end
  55.  
  56. function wall()
  57.  for i = 1,length do
  58.   two()
  59.  end
  60. end
  61.  
  62. turtle.select(1)
  63. wall()
Advertisement
Add Comment
Please, Sign In to add comment