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.

How to use AAO with the Maddog?

Featured Replies

I'm rather word not allowed what concerns Lvars and stuff. For the CRJ I've used someone else's script. Could someone tell me in easy steps how to script simple stuff like AP on, NAV button, altitude knob etc. for the Maddog?

For transparency: I'm a community mentor at the BATC discord. However, I do not get paid for it in any way.

  • Commercial Member

This is not really simple for the MD. They are using LVars, but those are not specific for the aircraft system. Their LVars are somewhat generic for each panel in the cockpit and what they do is determined by the value that is written to them. Only way to get the necessary data (that I can see) is looking directly into the model behavior config file and getting the variables there, plus the values that need to be assigned to them. 

Example: there is an item called "fgcp_autopilot_switch1"

Left mouse button code: "536870912 19 + (>L:fgcp_event, Number)"
Right mouse button code: "2147483648 19 + (>L:fgcp_event, Number)"

The code looks like is has been generated by a tool, this should do the same thing:

Left mouse button code: "536870931 (>L:fgcp_event, Number)"
Right mouse button code: "2147483667 (>L:fgcp_event, Number)"

So you would do "Scripting -> Read LVars from sim", then assign the (L:fgcp_event, Number) var directly to your button and put 536870931 into the little box to the right

But this is just a theory. At the moment I can't get MSFS to load the MD or the JF146. Once they decide to work for me, I will try to confirm my theory...

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

OK, confirmed, that is indeed how it works (for me)

Another example: Autothrottle, this time as scritps:

AT On:
(L:fgcp_autothrottle_switch1,·Bool)·!·if{·536870919·(>L:fgcp_event,·Number)·}

AT Off:
(L:fgcp_autothrottle_switch1,·Bool)·if{·536870919·(>L:fgcp_event,·Number)·}

AT Toggle
536870919·(>L:fgcp_event,·Number)


And the Autopilot switch as scripts:

AP On:
(L:fgcp_autopilot_switch1,·Bool)·!·if{·536870931·(>L:fgcp_event,·Number)·}

AP Off:
(L:fgcp_autopilot_switch1,·Bool)·if{·536870931·(>L:fgcp_event,·Number)·}

AP Toggle:
536870931·(>L:fgcp_event,·Number)

Edited by Lorby_SI

LORBY-SI

too bad to hear that you have such problems with the Maddog. Strange

 

Do you have, or any other AAO user an idea how the 3 way switches work?

 

direct code is (yaw dumper as example):

(M:Event) 'LeftSingle' scmi 0 == if{ 536870912 84 + (>L:overhead_event,number) }
(M:Event) 'RightSingle' scmi 0 == if{ 2147483648 84 + (>L:overhead_event,number) }
(M:Event) 'WheelDown' scmi 0 == if{ 536870912 84 + (>L:overhead_event,number) }
(M:Event) 'WheelUp' scmi 0 == if{ 2147483648 84 + (>L:overhead_event,number) }

 

So, this works and moves the switch inot the on position direction

536870912 84 + (>L:overhead_event,number)

 

But this 

2147483648 84 + (>L:overhead_event,number)

does not work and switches always the Starting pump switch 

 

 

Other switches (e.g. HYD) use 16384 + n for inc and 8192 + n for dec.

16384 does also work with the above switches, but 8192 not.

 

I have no idea how to toggle a 3 way switch back ...

 

thx

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Same problem for me Guenter, right click codes don't seem to work, only left ones do.

Cheers, Andy.

thx for reply.

But wheel up and down does work.

So I wonder why there code is not working. But maybe we have a bug here ...

I also wonder why with HYD switches they have a different code for right/left mouse and mousewheel inc/dec, but not for these switches

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Figured it out the 3 way switch I am working on.

<Code>(L:CM2_strobe_switch1, enum) 10 *</Code>
			</Parameter>
		</Animation>
		<MouseRect>
			<Cursor>Hand</Cursor>
			<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
			<CallbackCode>
                (M:Event) 'LeftSingle' scmi 0 == if{ 536870912 7 + (&gt;L:ext_lights_event,number) }
                (M:Event) 'RightSingle' scmi 0 == if{ 2147483648 7 + (&gt;L:ext_lights_event,number) }
                (M:Event) 'WheelDown' scmi 0 == if{ 536870912 7 + (&gt;L:ext_lights_event,number) }
                (M:Event) 'WheelUp' scmi 0 == if{ 2147483648 7 + (&gt;L:ext_lights_event,number) }
            </CallbackCode>

RightSingle you need to send  2147483648 -7, but its also sent as a negative number e.g. -2147483641

 

Edited by Andydigital

Cheers, Andy.

16 hours ago, Andydigital said:

but its also sent as a negative number e.g. -2147483641

 

Aaaah, great, that works!!!

many thanks!
Wonder how you have got that idea to try with negative numbers ...?)

 

Are you interested in sharing codes for the Maddog we both find ...?

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

  • Commercial Member
1 hour ago, guenseli said:

Wonder how you have got that idea to try with negative numbers ...?)

2,147,483,647 is the maximum positive value for a 32bit signed integer variable. If you go above that, that constitutes an overflow, which is interpreted as a negative number. It is just a matter of figuring out which one exactly, it might differ +/-1 depending on what algorithm you use to encode the negative number.

So it looks like the sim is calculating 32bit integers here - but AAO is a 64 bit app and it doesn't mind those value ranges at all - so if you use the above code it will write a positive value to the LVar instead of a negative one. You specifically have to tell AAO that it is supposed to be negative.

Edited by Lorby_SI

LORBY-SI

3 hours ago, guenseli said:

Wonder how you have got that idea to try with negative numbers ...?)

I was using Spads data monitor and I noticed the minus sign when looking at various things, then the light bulb came on above my head lol.

p.s. sent you a message too.

Edited by Andydigital

Cheers, Andy.

Can "old" ipc.control numbers transfered into sth useful with AAO?

e.g. ipc.control(69656, HDGvar)

 

thx

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

I’ve been tinkering with this as well. Has to be the most mental LVars I’ve come across yet! Why does it have to be so difficult and time consuming! The CRJ was probably the best in terms of layout and naming convention

🛫

2 hours ago, guenseli said:

Can "old" ipc.control numbers transfered into sth useful with AAO?

e.g. ipc.control(69656, HDGvar)

 

thx

Guidance IPC
ipc ap spd
ipc ap hdg
ipc ap alt
ipc ap vs
ipc ap spd (ias or mac as in guidance set)
ipc ap vs (ias or pitch as in guidance set)

The custom commands PDF you can get from the Maddog forum has the above referenced for the displays, not sure if that helps @guenseli

 

 

Cheers, Andy.

3 hours ago, Andydigital said:

The custom commands PDF

thx Andy,

do you have a link for me, please. Can't find it

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Archived

This topic is now archived and is closed to further replies.

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.