Advertisement
Guest User

parede

a guest
Oct 20th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. -- Usage: wall length height
  2.  
  3. input = {...}
  4. wallLength = tonumber(input[1])
  5. wallHeight = tonumber(input[2])
  6.  
  7. currentSlot = 1
  8.  
  9. function gotoNextSlotIfEmpty()
  10.   if turtle.getItemCount(currentSlot) == 0 then
  11.     currentSlot = currentSlot + 1
  12.     turtle.select(currentSlot)
  13.   end
  14. end
  15.  
  16. turtle.select(currentSlot)
  17. gotoNextSlotIfEmpty()
  18. gotoNextSlotIfEmpty()
  19. turtle.up()
  20.  
  21. for height = 1, wallHeight do
  22.  
  23.   for length = 1, wallLength do
  24.     turtle.placeDown()
  25.     gotoNextSlotIfEmpty()
  26.     if length ~= wallLength then
  27.       turtle.forward()
  28.     end
  29.   end
  30.  
  31.   if height ~= wallHeight then
  32.     turtle.turnRight()
  33.     turtle.turnRight()
  34.     turtle.up()
  35.   end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement