Jump to content
Sign in to follow this  
london-simmer

Using Macros in the script editor

Recommended Posts

Hi,

This example is from the AAO manual and I want to execute it from the script editor (not from a file).

<Macro·Name=“strobelightmacro“>A:LIGHT·STROBE,·Bool</Macro>
(@strobelightmacro)·1·==·if{·1·(>K:STROBES_TOGGLE)·}
(A:LIGHT·STROBE,·Bool)·1·==·if{·1·(>K:STROBES_TOGGLE)·}

The Red Led on the editor is on to indicate something is wrong.

Question is, does the script editor supports macros?

https://imgur.com/a/6icp5q3

 

Thanks.

 

Share this post


Link to post
Share on other sites

Generally speaking, yes. Remember that macros are a global thing, once established, they are valid everywhere, not just in this script. 

I would suggest using a multi line script for this. And I am not entirely sure that it would work with the "Test" button, you may have to run it with the extra dialog.

<Macro·Name=“strobelightmacro“>A:LIGHT·STROBE,·Bool</Macro>·\n
(@strobelightmacro)·1·==·if{·1·(>K:STROBES_TOGGLE)·}·\n
(A:LIGHT·STROBE,·Bool)·1·==·if{·1·(>K:STROBES_TOGGLE)·}·\n

On a side note, to avoid typing too much, I usually prefer using registers. They have the added benefit that they can be updated too during processing.

(A:LIGHT·STROBE,·Bool)·s0
l0·1·==·if{·1·(>K:STROBES_TOGGLE)·}
l0·0·==·if{·...·}

 


LORBY-SI

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...