Jump to content
The simFlight Network Forums

Lua file cowl flaps switches Duke B60 solved


Recommended Posts

Well I must admit that the lua files for the JS41 and the catalina is the next best thing that could have happened for me personally.

To be able to fly without the need to use the mouse is absolute awesome.

Now I have just a request. I am looking for a Lua file for the 2 cowlflap switches on the Realair DUKE B60. I have everything mapped to keys or buttons except the cowl flaps. I have emailed rob from Realair and he just told me the cowl flaps is not mapped to standard FSX cowlflaps and thus I cannot use the FSX commands. With the advent of the LUA files I am sure it there is a possibility to have it programmed.

Regards

JB

Link to comment
Share on other sites

Ok I have found the variables and added then to a Lua file and everything is working perfectly

I have created 1 lua file that I use for both left and right, Fully close, half open and full open.

-- param nr 
-- 1 = Cowl flap Close 
-- 2 = Cowl flap Half
-- 3 = Cowl flap Open  



-- Cowl flap_L_and_R Close 
if ipcPARAM == 1 then    

        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 0)
        ipc.sleep(500)
        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 0)


-- Cowl flap_L_and_R Half 
elseif ipcPARAM == 2 then    

        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 1) 
        ipc.sleep(500)
        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 1) 


-- Cowl flap_L_and_R Open
elseif ipcPARAM == 3 then    

        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 2)
        ipc.sleep(500)
        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 2)  



end

To set the cowl flaps individually split the file up and have only the one line for each engine per file.

Anyway for so long it does work with my set-up perfectly.

Regards

JB

Link to comment
Share on other sites

  • 7 months later...

I barely understand any of the programming potential of lua and fsuipc, but i have been able to set up some compound programs for radio and nav rotary encoders because i found a direct example. i would certainly like to figure out how to put your lua cowl flap file to use. i understand it goes into modules folder, but i am totally unclear about how to assign buttons or to name the file even. i love the realair duke but don't enjoy fighting the mouse to adjust the cowl flaps. any

help would be greatly appreciated.

eric

Link to comment
Share on other sites

  • 1 month later...

I barely understand any of the programming potential of lua and fsuipc, but i have been able to set up some compound programs for radio and nav rotary encoders because i found a direct example. i would certainly like to figure out how to put your lua cowl flap file to use. i understand it goes into modules folder, but i am totally unclear about how to assign buttons or to name the file even. i love the realair duke but don't enjoy fighting the mouse to adjust the cowl flaps. any

help would be greatly appreciated.

eric

You do know that you need a registered version of FSUIPC to make these files work

here you will find the guide

how to install lua files

If you still do not get it right, you can use the private message function and send me a PM with your email address and I will send you the files and the step by step guide to help you.

Link to comment
Share on other sites

  • 4 weeks later...

Ok I have found the variables and added then to a Lua file and everything is working perfectly

I have created 1 lua file that I use for both left and right, Fully close, half open and full open.

-- param nr 
-- 1 = Cowl flap Close 
-- 2 = Cowl flap Half
-- 3 = Cowl flap Open  



-- Cowl flap_L_and_R Close 
if ipcPARAM == 1 then    

        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 0)
        ipc.sleep(500)
        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 0)


-- Cowl flap_L_and_R Half 
elseif ipcPARAM == 2 then    

        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 1) 
        ipc.sleep(500)
        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 1) 


-- Cowl flap_L_and_R Open
elseif ipcPARAM == 3 then    

        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_1", 2)
        ipc.sleep(500)
        ipc.writeLvar("L:Duke_Cowl_Flaps_Switch_2", 2)  



end

To set the cowl flaps individually split the file up and have only the one line for each engine per file.

Anyway for so long it does work with my set-up perfectly.

Regards

JB

I have copied code as above and saved it as DukeCowlFlaps.lua.

I have placed the file in the Modules folder.

I have assigned "Lua DukeCowlFlaps" to a GoFlight GF-P8 button under FSUIPC (registered).

However, nothing happens when I press the respective button.

Any insight would be most appreciated!

Link to comment
Share on other sites

I have copied code as above and saved it as DukeCowlFlaps.lua.

I have placed the file in the Modules folder.

I have assigned "Lua DukeCowlFlaps" to a GoFlight GF-P8 button under FSUIPC (registered).

However, nothing happens when I press the respective button.

Looking at the Lua code it seems you must set the Parameter to 1, 2 or 3 to select the specific function you want it to perform. Did you do that? If you don't enterr the parameter value when assigning the button it will default to 0, and there is no action defined in the Lua program for 0.

Regards

Pete

Link to comment
Share on other sites

Looking at the Lua code it seems you must set the Parameter to 1, 2 or 3 to select the specific function you want it to perform. Did you do that? If you don't enterr the parameter value when assigning the button it will default to 0, and there is no action defined in the Lua program for 0.

Regards

Pete

I figured that out on my own before I got back to your response. However, I do appreciate your kind direction. I am still taking baby steps in learning Lua code, but I am learning a lot each step I take. Thank you so much for your help!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.