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.

LUA help needed please- my head is exploding!

Featured Replies

Hi all,

 

Can a LUA expert have a look at this for me please to see what I am doing wrong...

 

The aircraft I am working with is the Carenado Phenom 300.

 

This is what I see in the LINDA tracer when right click the ALT SEL knob in the aircraft VC to switch between altitude increments of 100 or 1000.

 

 

Watching new LVar: H850XPAltWheelPUSHTOGGLE = 0

[L] LVar: H850XPAltWheelPUSHTOGGLE = 1

[L] LVar: H850XPAltWheelPUSHTOGGLE = 0

[L] LVar: H850XPAltWheelPUSHTOGGLE = 1

 

This is the LUA function I wrote .....

 

function alt_incr_toggle_100 ()

     ipc.writeLvar("HP850XPAltwheelPUSHTOGGLE", 1)

end

function alt_incr_toggle_1000 ()

     ipc.writeLvar("HP850XPAltwheelPUSHTOGGLE", 0)

end

 

I then assigned this onto a button in LINDA using the fields ON PRESS and ON RELEASE.

 

However when I watch the same Lvar in the tracer while pushing and releasing the assigned button the tracer shows no change? LINDA sees the button as working (i.e when I push the button LINDA moves to assign button position 30)

 

This is similar code that I have written for other switch functions and they work ok.

 

Any ideas?

 

 

Regards

Stinger

Lower case 'w' needs to be uppercase?

Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i9 64GB RAM, GTX-5090

=@

LOL!

Cheers, Ed

Cheers, Ed

MSFS2020 Steam  // Rig: Corsair Graphite 760T Full Tower - ASUS MBoard Maximus XII Hero Z490 - CPU Intel i9-10900K - 64GB RAM - MSI RTX2080 Super 8GB - [1xNVMe M.2 1TB + 1xNVMe M.2 2TB (Samsung)] + [1xSSD 1TB + 1xSSD 2TB (Crucial)] + [1xSSD 1TB (Samsung)] + 1 HDD Seagate 2TB + 1 HDD Seagate External 4TB - Monitor LG 29UC97C UWHD Curved - PSU Corsair RM1000x // Thrustmaster FCS & MS XBOX Controllers

Lower case 'w' needs to be uppercase?

When programming in LUA it is very important to remember that this language is case-sensitive. All function names and variables must be checked for the correct upper and lower case usage. It is a lesson I keep having to relearn.

Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

 

 


When programming in LUA it is very important to remember that this language is case-sensitive. All function names and variables must be checked for the correct upper and lower case usage. It is a lesson I keep having to relearn.

 

Yeah, been burned by that more than a few times.

Gregg Seipp

"A good landing is when you can walk away from the airplane.  A great landing is when you can reuse it."
i9 64GB RAM, GTX-5090

  • Author

Thanks guys, got this one sorted now.

 

cheers Stinger

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.