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.

What's wrong with this function?

Featured Replies

Hi all,

Me again... Would anyone be so kind as to tell me why this doesn't work?

I have taken the joystick and button number straight from the 'buttons + switches ' tab in FSUIPC. The code is straight out of the Lua Library doc. The sound file is in FSX/sound. The code is in the aircraft user file.

function LibUserTimer1Hz()

function set8000 ()
x = ipc.testbutton(0, 11)
if x == TRUE
then
sound.play("MRSDAHL")
else
end

event.timer(1000, "set8000")
end
end

What dum mistake have I made this time?

Thanks in advance!

There are a few basic programming errors. The LibUserTimer1Hz() is called by the core LINDA LUA code. Inside this you have defined another function set8000() which calls itself with the event.timer() function. This will cause a never-ending loop if were not for the fact it is never called.

Delete the function set8000() and end lines and the event.timer line. It might then work. If you set VERBOSE logging and add a _loggg("calling sound") line, you can see whether it is called on the Console.

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

  • Author

Okay, I see what you mean. Thank you, I'll try all of that!

Cheers

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.