Run a script using servo activation as trigger

Hi! I’m an undergraduate student, new to Mission Planner.
I want to know if it’s possible to run a script (Lua or python) using a certain servo’s position as the trigger.
The particular problem I want to solve is saving or printing somewhere the altitude of the plane when the servo changes its position. This needs to be achieved at any point of the mission.

sure, the possible with onboard lua scripting


Check out this example,

Note that you will have to run the dev version of the code to use this binding.