May 20, 20251 yr I'm trying to implement looping behavior in an AAO MSFS 2024 script. Here is what I've got in the editor: :loop·\n 49907·(>K:ROTOR_BRAKE)·\n (WAIT:100)·\n (L:SWITCH_499_A,·number)·0.5·>=·if{·(GOTO:loop)·}·\n However it doesn't appear that the GOTO ever executes. Here is what I'm seeing when I watch the script: Call: 49907 (>K:ROTOR_BRAKE) Pr2: 49907 (>K:ROTOR_BRAKE) Call: (WAIT:100) Call: BLK:C:\Users\xxx\OneDrive\Documents\LorbyAxisAndOhs Files\Scripts\af3ad8fa-1b30-4c2f-8d4c-f584da6af864,(L:SWITCH_499_A, number) 0.5 >= if{ (GOTO:af3ad8fa-1b30-4c2f-8d4c-f584da6af864|loop) } Pr1: 0.711 0.5 >= if{ (GOTO:af3ad8fa-1b30-4c2f-8d4c-f584da6af864|loop) } Pr2: (GOTO:af3ad8fa-1b30-4c2f-8d4c-f584da6af864|loop) The above watch seems to confirm that the predicate is true (which is what I'm seeing in the behavior window), so the GOTO presumably should execute. If I unroll the loop, I get the behavior that I expect, but I would prefer to use the loop along with a precise termination predicate. Interestingly, C:\Users\xxx\OneDrive\Documents\LorbyAxisAndOhs Files\Scripts is empty, so I'm wondering if that has something to do with my problem? Does anyone know what I'm doing wrong? Thanks!
May 20, 20251 yr Commercial Member 9 minutes ago, geoffda said: Does anyone know what I'm doing wrong? Add (END) as the last line of a multiline script. :loop·\n 49907·(>K:ROTOR_BRAKE)·\n (WAIT:100)·\n (L:SWITCH_499_A,·number)·0.5·>=·if{·(GOTO:loop)·}·\n (END) 9 minutes ago, geoffda said: Interestingly, C:\Users\xxx\OneDrive\Documents\LorbyAxisAndOhs Files\Scripts is empty, so I'm wondering if that has something to do with my problem This folder is where you save script files. When you don't have any, the folder is empty. Please refer to the AAO manual about what script files are and what to use them for (like checklists and conversation type ops, like a virtual flight attendant) Edited May 20, 20251 yr by Lorby_SI LORBY-SI
May 20, 20251 yr Author Thanks so much! It might be worth adding some documentation around that. I see it in the AAO Specific RPN Commands section, but that is the only place it is mentioned and none of the examples use it. Anyway, thank you again for your quick response.
May 21, 20251 yr Commercial Member 10 hours ago, geoffda said: Thanks so much! It might be worth adding some documentation around that. I see it in the AAO Specific RPN Commands section, but that is the only place it is mentioned and none of the examples use it. Anyway, thank you again for your quick response. That is because this is more of a bug than a feature. The app shouldn't be doing this, but sometimes adding the "(END)" is the only way to make it obey the GOTO. LORBY-SI
Create an account or sign in to comment