March 15, 20242 yr Hi All I'm trying to get a simple script working with a three position switch. Currently, I have the following: (L:F28_OH_EmerLt_Toggle_Switch,·Number)·sp0 0·sp1 l0·0·==·if{ ··1·sp0 ··1·sp1 }·els{ ··l0·1·==·if{ ····l1·1·==·if{ ······2·sp0 ····}·els{ ······l1·0·==·if{ ········0·sp0 ······} ····} ··}·els{ ····l0·2·==·if{ ······0·sp0 ····} ··} } l0·(>L:F28_OH_EmerLt_Toggle_Switch,·Number) I need to access a component variable called 'PreviousPos' so the switch can cycle through 0>1>2>1>0, rather than just 0-1-2-0... The variable is shown in the DevMode behaviour panel (Under Component Variables, (O:) Vars), but is there any way to access it in a script? Thanks!!
March 15, 20242 yr Commercial Member No, accessing O: or I: variables is not possible. And in this case it is IMO also not required. Take a look at the seq and iseq RPN operators that AAO has. Those will make your life a lot easier with this kind of sequencial triggering (and they aren't limited to just 3 positions either) 0·1·2·1·(L:F28_OH_EmerLt_Toggle_Switch,·Number)·(L:F28_OH_EmerLt_Toggle_Switch_idx)·4·iseq·(>L:F28_OH_EmerLt_Toggle_Switch,·Number)·(>L:F28_OH_EmerLt_Toggle_Switch_idx) In the AAO manual there is a long list of all available RPN operators and commands with generic examples. The app has many more of those than the default RPN code in MSFS. (btw: the "L:..._idx" variable is an invented one. You can name it whatever you want, it just has to be unique for every iseq sequence. For convenience sakes I always reuse the name of the variable that is being manipulated ) Edited March 15, 20242 yr by Lorby_SI LORBY-SI
Archived
This topic is now archived and is closed to further replies.