Jump to content
The simFlight Network Forums

Flight1 Mustang commands (upd. 15th Mar 2010)


guenseli

Recommended Posts

I have made some little LUA and MACRO files for different aircrafts the last weeks and d'like to share them here.

-- upd 15 Mar: supports now Mustang version 1.03

added Master Caution with help of AndyDigital...thanks!

LUA commands

Here's a very short tutorial how to "install" LUA files

To get acces to the single commands you have to do the following:

1) copy the code below

2) insert it into an empty editor or wordpad file and save it as e.g. J41.LUA into the FSX - Modules Folder

3) open FSUIPC menu and choose LUA J41 from the drop down

4) insert different parameter numbers depending on the action you want (green field)

fr6tcbg5.jpg

(this example picture is for the J41. For the F1 Mustang you have to name the file of course F1_Mustang.LUA or whatever. Them the name in the dropdown (red field) will be Lua F1_Mustang)

-- 1 = BATT toggle
-- 2 = both Generators toggle
-- 3 = Avionics etc...
-- 4 = Taxi Lights ON
-- 5 = Landing Lights ON
-- 6 = Taxi and Landing lights OFF
-- 7= Panel light toggle
-- 8 = toggle starter 1
-- 9 = toggle starter 2
-- 10 = Master Warn
-- 11 = Master Caution

-- BATT toggle
if ipcPARAM == 1 then  


    LVarSet = "L:Masterbatt"
    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)

    ipc.control(66241)
    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound
end

-- both generators toggle
if ipcPARAM == 2 then  


    LVarSet = "L:LEFTGEN"
    LVar2Set = "L:RIGHTGEN"

    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)
    ipc.writeLvar(LVar2Set, val)

    ipc.control(66364)
    ipc.sleep(50)
    ipc.control(65823, 1) -- knob sound

    ipc.control(66363)
    ipc.sleep(50)
    ipc.control(65823, 1) -- knob sound
end

-- Avionics, STb Instruments and Anti Skid toggle
if ipcPARAM == 3 then  


    ipc.control(66293)
    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound


    LVarSet = "L:ANTISKID"
    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
        ipc.control(65823, 329)
    end

    ipc.writeLvar(LVarSet, val)

    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound


    LVarSet = "L:STBYAVIONICS"
    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)

    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound
end

-- Taxi Lights ON
if ipcPARAM == 4 then 

    ipc.writeLvar("L:LANDRECTAXI", 1)
    ipc.control(65823, 1) -- knob sound

end

-- Landing Lights ON
if ipcPARAM == 5 then 

    ipc.writeLvar("L:LANDRECTAXI", 2)
    ipc.control(66059, 1)
    ipc.control(65823, 1) -- knob sound
end

-- Taxi and Landing Lights OFF
if ipcPARAM == 6 then 

    ipc.writeLvar("L:LANDRECTAXI", 0)
    ipc.control(66060, 1)

    ipc.control(65823, 1) -- knob sound
end



-- Panel light toggle
if ipcPARAM == 7 then  


    LVarSet = "L:panel_lights"
    LVar1Set = "L:InstLt"
    LVar2Set = "L:MustangInstrLt"

    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)
    ipc.writeLvar(LVar1Set, val)
    ipc.writeLvar(LVar2Set, val)


    ipc.sleep(50)
    ipc.control(65823, 3) -- knob sound
end


-- Starter 1 ON
if ipcPARAM == 8 then 

    ipc.control(66300)
    ipc.writeLvar("L:MustangLeftStarter", 1)
    ipc.writeLvar("L:LEStartTimer", 63401433820.394)

    ipc.sleep(50)
    ipc.control(65823, 4) -- knob sound
end

-- Starter 2 ON
if ipcPARAM == 9 then 

    ipc.control(66301)
    ipc.writeLvar("L:MustangRightStarter", 1)
    ipc.writeLvar("L:REStartTimer", 63401433820.394)

    ipc.sleep(50)
    ipc.control(65823, 4) -- knob sound
end

-- Master Warn
if ipcPARAM == 10 then 

     ipc.control(65823, 32)
end

 -- Master Caution
    if ipcPARAM == 11 then

         ipc.control(65823, 33)
       ipc.sleep(50)
         ipc.control(65823, 4) -- knob sound
    end

MACROS

Note: unfortunately the Mustang developer is the only developer who I know which is changing his gauges numbers with every update.

So this macros just work for the current version 1.03(!)

This Macro is now shorter as thet from Version 1.02b because many commands are now possible with LUA and now independet from changed gauge numbers.

[Macros]
Module="Flight1_GarminG1000_510.GAU"
1=L:G1000DimBright=INC
2=L:G1000DimBright=DEC
3=APPR=RX926f0*X5590
4=NAV=RX92830*X5590
5=ALT press=RX92b50*X5590
6=VS press=RX92c40*X5590
7=FLC=RX92d30*X5590
8=ALT plus=RX93e70*X5590
9=ALT minus=RX93db0*X5590
10=SPD=RX933a0*X5590
11=HDG Knob Press=RX93930*X5590
12=CRS Knob Press=RX93b70*X5590

LUA Mustang Initialisation code

With this codelines assigned to a key or button ar in use with FSUIPC [AUTO] function (read FSUIPC manual for it) you have lowered the yokeswith one click.

ipc.writeLvar("L:Yoke_Pilot", 1)
ipc.writeLvar("L:Yoke_CoPilot", 1)

All files work at my system with latest FSUIPC version.

no guarantee that they will work for you (but they should, I'm sure - tested only at FSX Acceleration)

Do any codings at your own risk and just do things if you know what you do...

Be patient that I could not support any question. Please inform yourself how to handle MACROS and LUA files and the power of FSUIPC.

Have fun!

Link to comment
Share on other sites

Why does the developer change numbers with each update? Is this deliberate to make it difficult for you to control the gauges?

don't know, but don't think thats deliberate...

I have asked him many times but he said he couldn't do it in an other way...

We have to live with...

Link to comment
Share on other sites

  • 3 months later...
is there a reason why you made the "master warn" L:var but not the "master caution" one as well?

yes, I have with my countless hardwareswitches just one left and this I use normally for the master warn :lol:

All my LuaVars are just for my personal needs and my personal hardware.

I know that there several functions left... but as I don't need them for my hardware I don't have too much motivation to gather them :oops:

Link to comment
Share on other sites

OK fair enough, I just thought it was odd that you made one and not the other and thought there was a technical reason for not doing it, especially when the caution one is the one that is used most often. Can you remind me how you go about finding these L:Var parameters as I'm not having any luck so far, its not something I have had to do yet myself as everything I have ever wanted to use has worked fine with macros. I plan to use the two TOGA buttons on the MCP Combi with these master buttons as they are in approximately the same position as on the real Mustang panel :D .

Thanks in advance.

Link to comment
Share on other sites

Can you remind me how you go about finding these L:Var parameters as I'm not having any luck so far

There are two ways. The most useful is to use the Log Lvars lua plug-in, which will give you a real-time display on screen as they change, like those we used to test VRInsight switches. The other is simply to assign a keypress or button the the List local panel variables control in FSUIPC's assignments -- then you have to refer to the list produced in the FSUIPC Log.

Pete

Link to comment
Share on other sites

I figured it out with a bit of dumb hamfistedness, simply changing the parameter from 32 to 33;

-- Master Warn
    if ipcPARAM == 10 then

         ipc.control(65823, 32)
		 ipc.sleep(50)
         ipc.control(65823, 4) -- knob sound
    end

to

-- Master Warn
    if ipcPARAM == 10 then

         ipc.control(65823, 33)
		 ipc.sleep(50)
         ipc.control(65823, 4) -- knob sound
    end

That did the trick so anyone else who wants to add the Master Caution button please just add the below to the end of your mustang lua script file.


  -- Master Caution
    if ipcPARAM == 11 then

         ipc.control(65823, 33)
		 ipc.sleep(50)
         ipc.control(65823, 4) -- knob sound
    end

Link to comment
Share on other sites

  • 9 months later...

I have made some little LUA and MACRO files for different aircrafts the last weeks and d'like to share them here.

-- upd 15 Mar: supports now Mustang version 1.03

added Master Caution with help of AndyDigital...thanks!

LUA commands

Here's a very short tutorial how to "install" LUA files

To get acces to the single commands you have to do the following:

1) copy the code below

2) insert it into an empty editor or wordpad file and save it as e.g. J41.LUA into the FSX - Modules Folder

3) open FSUIPC menu and choose LUA J41 from the drop down

4) insert different parameter numbers depending on the action you want (green field)

fr6tcbg5.jpg

(this example picture is for the J41. For the F1 Mustang you have to name the file of course F1_Mustang.LUA or whatever. Them the name in the dropdown (red field) will be Lua F1_Mustang)

-- 1 = BATT toggle
-- 2 = both Generators toggle
-- 3 = Avionics etc...
-- 4 = Taxi Lights ON
-- 5 = Landing Lights ON
-- 6 = Taxi and Landing lights OFF
-- 7= Panel light toggle
-- 8 = toggle starter 1
-- 9 = toggle starter 2
-- 10 = Master Warn
-- 11 = Master Caution

-- BATT toggle
if ipcPARAM == 1 then  


    LVarSet = "L:Masterbatt"
    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)

    ipc.control(66241)
    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound
end

-- both generators toggle
if ipcPARAM == 2 then  


    LVarSet = "L:LEFTGEN"
    LVar2Set = "L:RIGHTGEN"

    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)
    ipc.writeLvar(LVar2Set, val)

    ipc.control(66364)
    ipc.sleep(50)
    ipc.control(65823, 1) -- knob sound

    ipc.control(66363)
    ipc.sleep(50)
    ipc.control(65823, 1) -- knob sound
end

-- Avionics, STb Instruments and Anti Skid toggle
if ipcPARAM == 3 then  


    ipc.control(66293)
    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound


    LVarSet = "L:ANTISKID"
    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
        ipc.control(65823, 329)
    end

    ipc.writeLvar(LVarSet, val)

    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound


    LVarSet = "L:STBYAVIONICS"
    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)

    ipc.sleep(50)
    ipc.control(65823, 2) -- knob sound
end

-- Taxi Lights ON
if ipcPARAM == 4 then 

    ipc.writeLvar("L:LANDRECTAXI", 1)
    ipc.control(65823, 1) -- knob sound

end

-- Landing Lights ON
if ipcPARAM == 5 then 

    ipc.writeLvar("L:LANDRECTAXI", 2)
    ipc.control(66059, 1)
    ipc.control(65823, 1) -- knob sound
end

-- Taxi and Landing Lights OFF
if ipcPARAM == 6 then 

    ipc.writeLvar("L:LANDRECTAXI", 0)
    ipc.control(66060, 1)

    ipc.control(65823, 1) -- knob sound
end



-- Panel light toggle
if ipcPARAM == 7 then  


    LVarSet = "L:panel_lights"
    LVar1Set = "L:InstLt"
    LVar2Set = "L:MustangInstrLt"

    val = 0

    if ipc.readLvar(LVarSet) == 0  then
    val = 1
    end

    ipc.writeLvar(LVarSet, val)
    ipc.writeLvar(LVar1Set, val)
    ipc.writeLvar(LVar2Set, val)


    ipc.sleep(50)
    ipc.control(65823, 3) -- knob sound
end


-- Starter 1 ON
if ipcPARAM == 8 then 

    ipc.control(66300)
    ipc.writeLvar("L:MustangLeftStarter", 1)
    ipc.writeLvar("L:LEStartTimer", 63401433820.394)

    ipc.sleep(50)
    ipc.control(65823, 4) -- knob sound
end

-- Starter 2 ON
if ipcPARAM == 9 then 

    ipc.control(66301)
    ipc.writeLvar("L:MustangRightStarter", 1)
    ipc.writeLvar("L:REStartTimer", 63401433820.394)

    ipc.sleep(50)
    ipc.control(65823, 4) -- knob sound
end

-- Master Warn
if ipcPARAM == 10 then 

     ipc.control(65823, 32)
end

-- Master Caution
    if ipcPARAM == 11 then

         ipc.control(65823, 33)
       ipc.sleep(50)
         ipc.control(65823, 4) -- knob sound
    end

MACROS

Note: unfortunately the Mustang developer is the only developer who I know which is changing his gauges numbers with every update.

So this macros just work for the current version 1.03(!)

This Macro is now shorter as thet from Version 1.02b because many commands are now possible with LUA and now independet from changed gauge numbers.

[Macros]
Module="Flight1_GarminG1000_510.GAU"
1=L:G1000DimBright=INC
2=L:G1000DimBright=DEC
3=APPR=RX926f0*X5590
4=NAV=RX92830*X5590
5=ALT press=RX92b50*X5590
6=VS press=RX92c40*X5590
7=FLC=RX92d30*X5590
8=ALT plus=RX93e70*X5590
9=ALT minus=RX93db0*X5590
10=SPD=RX933a0*X5590
11=HDG Knob Press=RX93930*X5590
12=CRS Knob Press=RX93b70*X5590

LUA Mustang Initialisation code

With this codelines assigned to a key or button ar in use with FSUIPC [AUTO] function (read FSUIPC manual for it) you have lowered the yokeswith one click.

ipc.writeLvar("L:Yoke_Pilot", 1)
ipc.writeLvar("L:Yoke_CoPilot", 1)

All files work at my system with latest FSUIPC version.

no guarantee that they will work for you (but they should, I'm sure - tested only at FSX Acceleration)

Do any codings at your own risk and just do things if you know what you do...

Be patient that I could not support any question. Please inform yourself how to handle MACROS and LUA files and the power of FSUIPC.

Have fun!

Hi, I've done step 1 and 2 but when I start fsx and I go into fsuipc but there is nothing in the drop down menu. Do I have to do anything eelse?

Thank you

Link to comment
Share on other sites

Hi, I've done step 1 and 2 but when I start fsx and I go into fsuipc but there is nothing in the drop down menu. Do I have to do anything eelse?

I don't know what "steps 1 and 2" are, but if there are ANY files at all with filetype Lua stored in your FS Modules folder, then any recent version of FSUIPC will most certainly be listing them in all the possible assignment dropdowns there are!

In fact it will list them with a Lua prefix, a LuaKill prefix, a LuaSet prefix, a LuaClear prefix a LuaToggle prefix and a LuaDebug prefix!

So, for every Lua file you will have 6 extra entries in the drop-downs! The entries are sorted alphabetically, and once the drop-down has dropped you can get to the #lua entries quickly by typing LU quickly enough.

Regards

Pete

Link to comment
Share on other sites

I don't know what "steps 1 and 2" are, but if there are ANY files at all with filetype Lua stored in your FS Modules folder, then any recent version of FSUIPC will most certainly be listing them in all the possible assignment dropdowns there are!

In fact it will list them with a Lua prefix, a LuaKill prefix, a LuaSet prefix, a LuaClear prefix a LuaToggle prefix and a LuaDebug prefix!

So, for every Lua file you will have 6 extra entries in the drop-downs! The entries are sorted alphabetically, and once the drop-down has dropped you can get to the #lua entries quickly by typing LU quickly enough.

Regards

Pete

Steps 1 and 2 are at the begin of this page, you just need to scroll up the page and you'll see them. On the drop down I've got only Luakill all prefix and that's it.

Link to comment
Share on other sites

In Windows Explorer look for "folder options" (you can also type "folder options" in the Windows 7/Vista Start button search box) and scroll down the list of available options, look for an option called "hide extensions of known file types" or some similar name and make sure that there is no tick mark next to it. Next go back to the FSX/modules folder and make sure that the LUA file you created as instructed is actually called "example.LUA" and not something like "example.LUA.txt" instead, I think this may be why you aren't seeing anything in the drop down list in FSUIPC.

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.