Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Check arguments for correct formatting
- local args = { ... }
- if #args ~= 1 then --Check if it's not exactly 3 arguments.
- shell.run("clear")
- print("Invalid number of arguments")
- print("turtletower [height]")
- do return end
- end
- for i = 1, 1 do --Step through each argument and make sure it is a number greater than 1.
- if tonumber(args[i]) < 2 then
- shell.run("clear")
- print("Invalid arguments")
- print("All measurements must be numbers greater than 1")
- do return end
- end
- end
- --------------------------------------------------
- --commandline arguments [height]
- length = tonumber(args[1]) --length of tunnel
- slotnum = 1
- function checkSlots()
- if turtle.getItemCount(slotnum) < 1 then
- slotnum = slotnum + 1
- turtle.select(slotnum)
- end
- return
- end
- for i = 1, length do
- -- Add Some Flooring
- turtle.placeDown()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- -- Dig Most of the Tunnel
- turtle.placeDown()
- turtle.digUp()
- turtle.up()
- turtle.digUp()
- turtle.up()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.down()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.down()
- turtle.placeDown()
- turtle.back()
- turtle.turnLeft()
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment