Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- if #tArgs ~= 2 then
- error("Usage: Walls <Height> <Length>")
- end
- x = 1
- height = tArgs[1]
- length = tArgs[2]/2
- print("Building "..height.." high.")
- print("Building "..tArgs[2].." long.")
- function up()
- for i = 1,height do
- slot()
- turtle.up()
- turtle.placeDown()
- end
- end
- function down()
- for i = 1,height-1 do
- slot()
- turtle.down()
- turtle.placeUp()
- end
- end
- function spin()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function two()
- up()
- turtle.forward()
- turtle.down()
- down()
- turtle.forward()
- spin()
- turtle.place()
- spin()
- end
- function slot()
- x = 1
- while turtle.getItemCount(x) < 1 do
- x = x+1
- turtle.select(x)
- end
- end
- function wall()
- for i = 1,length do
- two()
- end
- end
- turtle.select(1)
- wall()
Advertisement
Add Comment
Please, Sign In to add comment