rcboffa
New member
Hi All,
OpenTX Lua scripting question. I have a number of logical switches and special functions that I copy from model to model and I'm trying to create a script that I can run with each new model that will will create all of them. Basically a model init script. I've been able to use the model.setLocgicalSwitch() function but I can't find any reference for parameter values. For example:
model.setLogicalSwitch(2, {func=4,v1=1,v2=-99, ["and"]=24})
If I wanted to set v1 to be a switch position like SA- or L01 what would I pass in? Is there a lookup table that can tell me that 24 is SH↑ or whatever it is. I can probably figure out the physical switches, but I have no idea how to set it to another logical switch.
Thanks for any help,
Adam
OpenTX Lua scripting question. I have a number of logical switches and special functions that I copy from model to model and I'm trying to create a script that I can run with each new model that will will create all of them. Basically a model init script. I've been able to use the model.setLocgicalSwitch() function but I can't find any reference for parameter values. For example:
model.setLogicalSwitch(2, {func=4,v1=1,v2=-99, ["and"]=24})
If I wanted to set v1 to be a switch position like SA- or L01 what would I pass in? Is there a lookup table that can tell me that 24 is SH↑ or whatever it is. I can probably figure out the physical switches, but I have no idea how to set it to another logical switch.
Thanks for any help,
Adam