Custom auto mission functionality

I am trying to make an intuitive way for a user to setup auto missions with a rover. I have added extra functionality to my rover in Lua so that in manual mode, I just check the RC switch to use these functionalities. How can I trigger them in an Auto mission?

I have tried using the ID of an arbitrary “DO_” command and this works, but it’s not exactly what I want. Could the SCRIPT_TIME command work? does this command refer to the LUA script or python? There’s nothing in the LUA examples about it.

Ok I think I just use something like this in lua to obtain it. I still need to try it in the simulator.

“auto_last_id, cmd, arg1, arg2, arg3, arg4 = vehicle:nav_script_time()”

You’d use Lua. The relevant example is here:

ardupilot/libraries/AP_Scripting/examples/copter-nav-script-time.lua at master · ArduPilot/ardupilot (github.com)