TheAviationFox Posted August 6 Report Posted August 6 Thanks for tidying my INI-file! And now we got to the even more interesting part: when I implemented the logging of the LVAR VC_POSITION_LIGHT_SW, the log came back with an error message, saying that this LVAR was unknown to it. Oh dear. I activated Developer mode again and checked the behaviour of the light switch and to my own surprise and shame I had provided you with an incomplete LVAR-name in my first post regarding this topic. It was late night and it slipped through me re-reading the post before submitting it. The correct LVAR is VC_POSITION_LIGHT_SW_VAL. I have now corrected the LVAR name in the INI-file and guess what: your preset code works exactly as advertised. Thank you so much and I apologize for wasting your time by providing an incomplete LVAR, I am embarrassed! Allow me to express my gratitude for your help and patience, top notch user support here!! Thanks John!
John Dowson Posted August 7 Report Posted August 7 Note that you can see available lvars by listing them (Add-ons=>WASM->List Lvars) - no need to use the MSFS behaviors dialog, except as a last resort (i.e. usually to discover b-vars or h-vars). No problem about the incorrect lvar name - these things happen...! Now you have the correct name, you should check if setting that directly works to control the switch. If so, the assignments can be simplified as you don't need the compound condition on the position of your switches, and you only need to send the one one command to change the lvar two positions instead of three (e.g. switch up, pause, switch up). Anyway, you should try and understand those assignments and try to assign yourself the next time you want to make a conditional assignment. I will help if you run into problems, but you should have enough info in this thread to make a start. Regards, John 1
TheAviationFox Posted August 7 Report Posted August 7 Yes, I have tested the correct LVAR VC_POSITION_LIGHT_SW_VAL in the WASM executor and in fact it only moved the switch, but did not change the lights status. I created that list of LVARs through the WASM-menu, but I personally find the Behaviour Tool better, because I can easier find the switch variables and actually test their functions/values. Obviously I am not proficient enough at actually connecting the dots of these variables, but eventually we will get there. I will keep the Preset that you have created for me, it does the job for me and I am happy!
John Dowson Posted August 7 Report Posted August 7 50 minutes ago, TheAviationFox said: Yes, I have tested the correct LVAR VC_POSITION_LIGHT_SW_VAL in the WASM executor and in fact it only moved the switch, but did not change the lights status. Ok, that can happen. 51 minutes ago, TheAviationFox said: I created that list of LVARs through the WASM-menu, but I personally find the Behaviour Tool better, because I can easier find the switch variables and actually test their functions/values. Obviously I am not proficient enough at actually connecting the dots of these variables, but eventually we will get there. Thats fine - whatever works for you. Just pointing out that for most things, the various FSUIPC logging facilities should be proficient enough, but you do have to 'connect the dots; as you say. 53 minutes ago, TheAviationFox said: I will keep the Preset that you have created for me, it does the job for me and I am happy! Yes - you need to do it this way anyway if the position lvar only changes the position but not the actual function/lights. 1
rickmatrix Posted Thursday at 04:39 AM Report Posted Thursday at 04:39 AM On 6/7/2025 at 6:57 AM, BAW242 said: Just a quick note to say thanks again John, I learned how to do the LUA scripts today and it works for the two runway turnoff lights on one button, I will now use for various other combos I want to do on the iFly!! For the benefit any newbies wanting to do iFly RWY TURNOFF on/off on one button, I am attaching the files, you just put them in the FSUIPC main install folder and instead of selecting Preset for the buttons, select "FS Control" and look for the commands "LuaIflyRFWYON or ...OFF., iFlyRwyOFF.lua 149 B · 7 downloads iFlyRwyON.lua 149 B · 6 downloads Hello, How can I select the FSUIPC -LUA MACRO option in Mobiflight and execute this code? What parameters do I set: 0, 1, 10? I have a B737 light panel made with Arduino. I purchased FSUIPC 7.5.4.
John Dowson Posted Thursday at 08:25 AM Report Posted Thursday at 08:25 AM 3 hours ago, rickmatrix said: How can I select the FSUIPC -LUA MACRO option in Mobiflight and execute this code? I don't know - that sounds like a question for MobiFlight. I do not support MobiFlight. And what 'code' are you referring to? Maybe you could explain what you are trying to do with FSUIPC? John
rickmatrix Posted yesterday at 01:43 AM Report Posted yesterday at 01:43 AM 17 hours ago, John Dowson said: I don't know - that sounds like a question for MobiFlight. I do not support MobiFlight. And what 'code' are you referring to? Maybe you could explain what you are trying to do with FSUIPC? John Yes, I would like to tell you that after a few hours reading the FSUIPC for advanced users and reading the entire thread here, and many tests with the mobiflight program, I managed to run the . lua that you helped our friend BAW242 make for the Ifly, since he had the same problem executing 2 commands with a single switch, I have built a rudimentary B737 MCP + Lights with Arduino, that is my reason for using mobiflight. In case anyone needs it, I'll explain the steps using FSUIPC7 registered for MSFS: 1. Place the file filename.lua in the root folder of FSUIPC. 2. Add the line in FSUIPC.ini [LuaFiles] 1=iFlyRwyOFF 2=iFlyRwyON (file names for example) 3. In the mobiflight program, select FSUIPC - Lua Macro 4. Enter the word Lua + filename, without the extension, as shown in the picture Then it would look like this: Lua iFlyRwyON and parameter 0 Done! ipc.execCalcCode("23 (>L:VC_Miscellaneous_trigger_VAL, number)") ipc.sleep(100) ipc.execCalcCode("25 (>L:VC_Miscellaneous_trigger_VAL, number)")
John Dowson Posted 19 hours ago Report Posted 19 hours ago 6 hours ago, rickmatrix said: 2. Add the line in FSUIPC.ini [LuaFiles] 1=iFlyRwyOFF 2=iFlyRwyON (file names for example) You should never modify the [LuaFiles] section manually - this is maintained by FSUIPC. It will add lua files to this section automatically, when found in the installation folder (or in LuaPath, if that is set).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now