Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- arg = {...}
- length = arg[1]
- height = arg[2]
- cSlot = 1
- slots = 16
- turtle.select(13)
- turtle.refuel()
- turtle.select(1)
- if (length == nil or height == nil) then
- print ("Usage: wall <length> <heigth>")
- return
- end
- function empty()
- if (turtle.getItemCount(slots) == 0) then
- print(string.format("I am empty. Please load more mats in slot %d to continue.", slots))
- while (turtle.getItemCount(slots) == 0 ) do
- sleep(1)
- end
- end
- if (turtle.getItemCount(cSlot) == 0) then
- cSlot = cSlot + 1
- turtle.select(cSlot)
- end
- end
- function plcUp()
- if (turtle.detectUp()) then
- turtle.digUp()
- end
- turtle.placeUp()
- end
- function plcDown()
- if (turtle.detectDown()) then
- turtle.digDown()
- end
- turtle.placeDown()
- end
- function plcBehind()
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- end
- for i=0, (height/3-1), 1 do
- for j=1,(length - 1), 1 do
- empty()
- if (j>1) then
- plcBehind()
- end
- plcUp()
- plcDown()
- turtle.forward()
- end
- plcDown()
- plcBehind()
- turtle.up()
- plcDown()
- turtle.up()
- plcDown()
- turtle.up()
- turtle.turnRight()
- turtle.turnRight()
- end
- print("\nSurface complete.")
Add Comment
Please, Sign In to add comment