diff --git a/src/bin/TurtleCtl.hx b/src/bin/TurtleCtl.hx index 4dd8a0c..f74bead 100644 --- a/src/bin/TurtleCtl.hx +++ b/src/bin/TurtleCtl.hx @@ -1,5 +1,6 @@ package bin; +import lib.turtle.Helper; import kernel.turtle.TurtleMutex; import kernel.turtle.Turtle; import lib.turtle.InvManager; @@ -110,6 +111,11 @@ class TurtleCtl extends CLIAppBase { return Future.sync(false); } }, [String("direction")]); + + registerAsyncSubcommand("tunnel", (args) -> { + var len = args.getInt("length"); + return asynPerform(Helper.combine.bind([Turtle.dig.bind(Front), Turtle.forward, Turtle.dig.bind(Up)]), len); + }, [Int("length")]); } private function asynPerform(op:Void->Outcome, times:Int):Future {