May 24, 20224 yr I'm trying to set up my own profile for my X-Touch to use with a couple planes but currently focusing on the PMDG 737. What I'd like to do is assign one button to turn on the lights for engine start (beacon only), one for taxi lights (beacon, taxi, runway turn maybe) and one for takeoff (basically everything). I'd like each button to switch the lights to specific states, for example, after landing I want to go from takeoff light config to taxi light config. I can't seem to find a tutorial or even any suggestion for how to do this. I'm assuming the correct way would be to create a script that sets each desired state and then assign this new script to a button push. I've been going through all the pre-made scripts that I can find and I see lots of "toggle" scripts for lights and a few "set" scripts. The set scripts don't seem to be doing anything and while the toggle scripts work they won't work for my purpose since going from say taxi to take off would then again toggle the taxi lights to the wrong position. I'm also not great with coding/scripting in general but I can follow instructiosn well and usually can figure out how to modify stuff. Any help would be greatly appreciated!
May 24, 20224 yr Below is the scripts that I use for Landing Lights on and off, it also does a few other things like turn the ignition switches to continuous. You can find the K events Here https://aviation.allanville.com/misc/fsx-pmdg-737-ngx they are the same as FSX. Simply go to Script editor and create a new script and place the below scripts into it (Not the name "LAND ON" but the portion below it) save as new. Then assign it to a button/switch. LAND ON 2 (>K:#69751) (SLEEP:400) 2 (>K:#69753) (SLEEP:250) 2 (>K:#69736) (SLEEP:250) 1 (>K:#69742) 2 (>K:#69743) 2 (>K:#69744) 2 (>K:#69745) 2 (>K:#69746) (SLEEP:400) 1 (>K:#69747) (SLEEP:400) 1 (>K:#69748) LAND OFF 0 (>K:#69743) 0 (>K:#69744) 0 (>K:#69745) 0 (>K:#69746) (SLEEP:400) 0 (>K:#69747) (SLEEP:400) 0 (>K:#69748) (SLEEP:250) 1 (>K:#69751) (SLEEP:400) 1 (>K:#69753) ________________________________________________________________________________ Jeremy 9800X3D OC'd -30 +200MHZ | 64GB CL30 RAM | RTX 5080 | Windows 11 23H2| Bravo Throttle | Alpha Yoke | CH Pedals | Logitech Radio Panel | SmoothTrack | AAO
May 24, 20224 yr Author Thanks so much!! This is doing exactly what I want. I did discover that I can also put a space, and a note after each number as a sort of comment for what the switch is and it seems I can use line breaks instead of spaces in the script so I can see the items as list and that seems to work too. So my first test looks like so... 2·(>K:#69754·LIGHTS_LOGO)·(SLEEP:50) 2·(>K:#69755·POS_STROBE)·(SLEEP:150) 1·(>K:#69756·ANT_COL)·(SLEEP:250) Any reason this might break something and I should leave the string separated by spaces and without the notes?
May 24, 20224 yr Commercial Member 40 minutes ago, P1NBA11ER said: (>K:#69754·LIGHTS_LOGO) This is wrong, AAO will not recognize this command. The parentheses are not for decoration, they are part of the command. 2·(>K:#69754)·(SLEEP:50)··//·LIGHTS_LOGO 2·(>K:#69755)·(SLEEP:150)·//·POS_STROBE 1·(>K:#69756)·(SLEEP:250)·//·ANT_COL No other text etc. allowed. If you want to add comments, you have to do it at the end of the line, with "// my comment" In AAO, the RPN implementation is - Case sensitive - Allergic to space characters missing or being in the wrong place - Angry when you start putting parentheses or braces in funny places because you think that you have to "structure" the code (they are part of the commands and cannot be used any other way) - Generally unforgiving of any syntax errors or experiments. You cannot think or type outside the box, it must be exactly like specified in the AAO manual, chapter "Scripting" and in the simulator's SDK documentation. Edited May 24, 20224 yr by Lorby_SI LORBY-SI
May 24, 20224 yr Author So if I want to add a comment would it look like this? 1·(>K:#69749)·(SLEEP:50)·//TAXI·1·(>K:#69757)·(SLEEP:90)·//WING·2·(>K:#69754·)·(SLEEP:50)·//LIGHTS_LOGO
May 24, 20224 yr Commercial Member 4 minutes ago, P1NBA11ER said: So if I want to add a comment would it look like this? 1·(>K:#69749)·(SLEEP:50)·//TAXI·1·(>K:#69757)·(SLEEP:90)·//WING·2·(>K:#69754·)·(SLEEP:50)·//LIGHTS_LOGO No. Comments are only possible at the end of a line, not right in the middle of the code (how would the parser know where the comment ends?) 1·(>K:#69749)·(SLEEP:50)·//TAXI 1·(>K:#69757)·(SLEEP:90)·//WING 2·(>K:#69754·)·(SLEEP:50)·//LIGHTS_LOGO Edited May 24, 20224 yr by Lorby_SI LORBY-SI
May 24, 20224 yr Author Ah yes, got it. So I can use a comment and then a line break, so I'm just moving my "note" on which switch I'm firing to the end. This is all very exciting. So many new possibilities for my X-Touch.
May 24, 20224 yr Commercial Member 2 minutes ago, P1NBA11ER said: So I can use a comment and then a line break Correct. The entire part after the // is treated as a comment up to the line break. If your scripts get bigger, consider using script files instead. LORBY-SI
May 24, 20224 yr If you want to use the "newer" ROTOR_BRAKE events instead of the hash tag events, here is a listing: https://www.dropbox.com/s/gkuyrw02ch5ji99/B737_Scripts_ROTORBRAKE.zip?dl=0 | i7-14700KF - 4080 SUPER | 32 GB RAM | Win 11 Pro | HC Bravo | AAO | StreamDeck |
May 24, 20224 yr Author What would be the advantage to using these over the ones I've set up already?
May 26, 20224 yr On 5/24/2022 at 5:39 PM, P1NBA11ER said: What would be the advantage to using these over the ones I've set up already? Each has an advantage. The number on a ROTOR_BRAKE event breaks down as XX(X)YY where X is the related L:var in the format of (L:switch_XX(X)_73X, number) so by looking at the event you immediately know the related READ variable. The YY is the action (01 and 02) for up/down switches, (07 and 08) for left/right knob rotation. For example: event 39701(>K:ROTOR_BRAKE) arms/disarms the LNAV button on the MCP to read the state, L:switch_397_73X, number would give the state (Armed of OFF) The equivalent hash tag event would be 69632+397 -> 1(>K:#70029) For the hash tag events you have to subtract 69632 (PMDG base constant) from the event number to get the related L:var. However, the hash tag event is easier to use with the SET events. To SET the MCP altitude window to 31,000' you would use: 31000 (>K:#14505) The ROTOR_BRAKE event is harder to use for parameter passing | i7-14700KF - 4080 SUPER | 32 GB RAM | Win 11 Pro | HC Bravo | AAO | StreamDeck |
Archived
This topic is now archived and is closed to further replies.