Mission Planner Plugin: Control Servo Based on Flight Mode (Solved)

Hello, I am new to Mission Planner plugins.

I want to start by controlling a servo based on the flight mode of my copter.

Can anyone suggest how to check the current flight mode and set PWM for servo 10 within a Mission Planner plugin? Or recommend some example related to servo control?

Thank you!

Should be an easy task for a Lua script right on the drone (assuming you have a flight controller that can run Lua)

https://ardupilot.org/copter/docs/common-lua-scripts.html

@Allister Thank you for your response. I have been working with Lua scripts for over a year, and it is indeed an easy solution. However, I want to learn C# coding with Mission Planner plugins, so I am looking for suggestions and examples related to that.