Switching a servo via transmitter & lua script

Hi all,
I’m having some difficulties toggling a servo through my transmitter.
I’d like to be able to read my transmitter switch position through a lua script, and have that determine the position of the servo.
I’m having no issues getting the servo to move with a script, but I’m a little confused by the RC IN and OUT, and how I’m able to utilize those.
I would greatly appreciate any help I can get!

I am not sure what RC IN and OUT refer to. I would think you would use an AUX output and assign that to an RC channel in QGC.
Also if you are using OPENTX you really don’t need a LUA script to to that. You can use Logical Switches and Special functions to override the channels output.

I suspect this question relates to ArduPilot onboard lua scripts (https://ardupilot.org/copter/docs/common-lua-scripts.html), so the question is better asked at discuss.ardupilot.org or the ArduPilot Discord

is it possible to share here a lua script to run on my cube orange running on px4 stack for commuication with my secondary GPS module which works on NMEA protocol. Becos I see that cube only has ubox protocol as default. All the other options are either fake or something else…