February 10, 20206 yr 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!
February 10, 20206 yr 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
Archived
This topic is now archived and is closed to further replies.