Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("FuncApi")
- local args = {...}
- local usage = "[distance] [wide] [side]"
- local side = "right"
- x = args[1]
- y = args[2]
- side = args[3]
- if y == nil then
- y = 1
- end
- FuncApi.argStartup(args, 3, usage)
- for s = 1,y do
- for i = 1,x do
- FuncApi.forward(1,"x",1)
- FuncApi.dig(0)
- FuncApi.dig(1)
- FuncApi.checkFuel()
- if (i % 12 == 0) then
- turtle.select(15)
- turtle.placeUp()
- turtle.select(1)
- end
- end
- FuncApi.gohome(1)
- if (side == "left") then
- FuncApi.turnLeft()
- for i = 1,s do
- FuncApi.forward(3,"y",-1)
- end
- FuncApi.turnRight()
- elseif ( side == "right") then
- FuncApi.turnRight()
- for i = 1,s do
- FuncApi.forward(3,"y",1)
- end
- FuncApi.turnLeft()
- else
- if y ~= 1 then
- error("Not a valid side")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement