Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can't get GOTO to work in my script

Featured Replies

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!

  • 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 by Lorby_SI

LORBY-SI

  • 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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.