Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args={...}
- --Gets the values provided as args at start of program and asignes them to lenght, rows and height
- local lenght = tonumber(args[1])
- local rows = tonumber(args[2])
- local height = tonumber(args[3])
- --Sets maximun values for lenght, number of rows and height of tunnel
- local lenghtl=128
- local rowsl=16
- local heightl=15
- --Checks that values have been provided
- if lenght==nil or rows==nil or height==nil then
- print("Lenght, number and height must be provided")
- print("Please use as:\nstripmine [lenght] [rows] [height]")
- --Checks so that the provided values don't exceed the maximun limit
- elseif lenght>lenghtl and rows>rowsl and height>7 then
- print("Value exceeding limit was detected. The limits are -\n")
- print("Lenght: "..lenghtl.."\nRows: "..rowsl.."\nHeight: "..heightl)
- else
- --Loop to put turtle at correct initial vertical position
- for i=0, height do
- if turtle.detectUp() then
- turtle.digUp()
- end
- turtle.up()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment