Jump to content
The simFlight Network Forums

guenseli

Moderators
  • Posts

    464
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by guenseli

  1. Hello, I have a thought if it is possible to assign a joystick button which changes the throttle to reverse? I know about all the reverse zones which could be programmed with FSUIPC, but its not real handy for me.... So I have thought the best way could be to change the whole throttle via a button to reverse. I have a Saitk X52 which is having a big button on the top of the throttle. Till now I land, throttle down (flare) and then press just the button which is assigned to F2 (fast decrease) But more handy would be if I could land, throtlle down and then, while I press the button, the engines go into reverse via the throttle and I can control them with the throttle. (button pressed: throttle up - reverse up, throttle down - reverse down; button unpressed: normal throttle) Hopefully you do understand what I mean, Pete? Do you think that makes sense or do you think this is possible to implement in a way? thank you very much!
  2. Hi, I don't understand your post, sorry... Does nothing work, no LUA, no Macro? then you have an other, essential problem, which I don't know. Just for the LUA you inserted above: in this line: if ipcPARAM == 19 then is maybe an error. I would change it to elseif ipcPARAM == 19 then I'm not sure if it helps, but try it.... If just one single point is wrong in the LUA file, then the whole script is not working!!!
  3. sorry, link updated here again, too: http://forums.simflight.com/viewtopic.php?f=54&t=78335
  4. @mt: These commands are not valid for the 747!!! They are valid for the MD11! ..just to make this clear. @curt: have you had a look into this tutorial: http://forums.simflight.com/viewtopic.php?f=54&t=78335 should answer your questions...
  5. You could leave your old file. no need to delete. Just insert the DLL and say "yes" to overwrite. btw: it is always a good hint to backup the FSUIPC.ini!!!!
  6. I have just the idea that you can code with LUA the "OBS fast" command and insert a little break after, so it would be get slower. And you make a second OBS fast with a n other pause (ipc.sleep(xxx)) with a different (higer) value that is faster then "OBS slow" Just an idea, don't know if its working, but thats the way I would try it. Maybe better programmers have better solutions here...
  7. I just give an answer because Pete isn't here, so it could be wrong... It depends on the addon, if marcos work or not. If you make a new macro you can test it with the TAB key before saving. If the TAB key isn't working you couldn't hope that the macro is working. In very seldom cases it works then, but that are big exceptions. Also it could be that with one addon different buttons don't work for macros. So one button could be assigned, the other not. It depends what developers have programmend behind each button, behind each panel... guenter
  8. damned I twisted the numbers....32 is right. but that doesn't make things better....
  9. No, I haven't. I'm 32 years old, I'm not able to learn anything new.... :lol:
  10. Could be. I haven't tried myself because if I assign that one also I run definitely out of buttons. But feel free to research further...
  11. you have two more options: 1) look through your LUAVars again and try out anything that smell a little bit after your wanted functions... even the unespected. The namings can be very .... crazy.... (but of course, like with the F1 Mustang, it could be that there no Variables could be found) 2) deal with CS and DA that they sponsor me a free version, then I will take a look into it :lol:
  12. Hi Muas, just to be clear: have you tried "Part 1: logging via logging window" also? it is often the case that the LuaVars which are given are just for remembering the switch position or whatever, like Pete descriebed it. In that cases there are often some controls assigned with different parameters.... And the overall simpliest way: have you tried mouse macros?
  13. For your first question: open editor or WordPad or anything else and insert this line into: ipc.keypressplus(18,1,4) -- ALT and focus to FS save this as ALTKey.LUA into your modules folder. Start FS and go into FSUIPC menu choose a button and choose from pull down "LUA ALTKey". Should work. note: I talk for FSX I don't know how that works with FS9, but I think it should (Pete?)
  14. no need to sorry about your english, mine isn't better :D Have you pressed "relaod buttons" or/and "reload keys" in FSUIPC menu after making and saving a LUA file into modules folder? Have you scrolled down to the section were the LUA files begin in FSUIPC key/button assigning pull down menu? A file called example.lua is find as "LUA Example" in FSUIPC pull down menu...
  15. 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...
  16. HI mt, just tried it out.. Do you try it in the 2D Panel? It is only working in the VC.... (can say for the MD11....haven't tried out other addons)
  17. 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) (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!
  18. I have made some little LUA and MACRO files for different aircrafts the last weeks and d'like to share them here. MACRO [MACROS] 1=L:LandingLightExtendSwitch=SET 2=L:LightRecogWhiteSwitch=SET 3=L:LightRecogRedSwitch=SET 4=L:LightRecogGreenSwitch=SET 5=L:LightRecogAmberSwitch=SET 6=L:StarterSwitch=SET 7=L:DefrosterSwitch=TOG 8=L:PrimerOn=TOGGLE 9=L:GunSightSwitchOn=SET 10=L:CabinVent=TOG code for the main fuel selector. You can select now the 4 stats OFF, AUX, MAIN, External Insert this into a LUA file -- All Fuel Selectors OFF if ipcPARAM == 1 then ipc.writeLvar("L:FuelSelKnob1State", 0) -- All Fuel Selectors AUX elseif ipcPARAM == 2 then ipc.writeLvar("L:FuelSelKnob1State", 1) -- All Fuel Selectors Main elseif ipcPARAM == 3 then ipc.writeLvar("L:FuelSelKnob1State", 2) -- All Fuel Selectors External elseif ipcPARAM == 4 then ipc.writeLvar("L:FuelSelKnob1State", 3) end 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... Feel free to use or add codes from/to here. 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! ---- updated 16th dezember 2009 LUA code for main fuel selector few macro entries added
  19. I have made some little LUA and MACRO files for different aircrafts the last weeks and d'like to share them here. MACRO Explanation: 1) number 1 = the AP turn handle reset. Insert in the paramter field the number "50" to set the Ap turn handle back to the middle 2) the carbheat switch or turbooverride switch commands can be used with combined key or button actions, Read FSUIPC manual how to edit the FSUIPC.ini for it So you can switch 4 carbheats with one button or key 3) IntercoolerFlap needs parameter 100 for increase and 1 for decrease. Same with Window defroster 4) TurboCalibration needs INC parameter 50 and DEC -50 5) map_zoom doesn't work very well; I'm too lazy to have a look into it ;-) [Macros] Module="window.dll" 1=L:APTurn=SET 2=L:IntercoolerFlap1=INC 3=L:IntercoolerFlap1=DEC 4=L:IntercoolerFlap2=INC 5=L:IntercoolerFlap2=DEC 6=L:IntercoolerFlap3=INC 7=L:IntercoolerFlap3=DEC 8=L:IntercoolerFlap4=INC 9=L:IntercoolerFlap4=DEC 10=L:CarbHeat1Switch=SET 11=L:CarbHeat2Switch=SET 12=L:CarbHeat3Switch=SET 13=L:CarbHeat4Switch=SET 14=L:map_ZoomFactor=INC 15=L:map_ZoomFactor=DEC 16=L:RMI1ini=TOG 17=L:RMI1=TOG 18=L:RMI2ini=TOG 19=L:RMI2=TOG 20=L:LayerTerrain=TOG 21=L:LayerRangeRings=CYC 22=L:RadioAltSwitchOn=TOG 23=L:RadioAlt2SwitchOn=TOG 24=L:RadioAltRange=TOG 25=L:RadioAlt2Range=TOG 26=L:AltLimit=INC 27=L:AltLimit=DEC 28=L:WindowDefrosterControlKnob=INC 29=L:WindowDefrosterControlKnob=DEC 31=L:Turbo1CalibrationKnob=INC 32=L:Turbo1CalibrationKnob=DEC 33=L:Turbo2CalibrationKnob=INC 34=L:Turbo2CalibrationKnob=DEC 35=L:Turbo3CalibrationKnob=INC 36=L:Turbo3CalibrationKnob=DEC 37=L:Turbo4CalibrationKnob=INC 38=L:Turbo4CalibrationKnob=DEC 39=L:TurboOverrideSwitch1=SET 40=L:TurboOverrideSwitch2=SET 41=L:TurboOverrideSwitch3=SET 42=L:TurboOverrideSwitch4=SET 43=L:APUStarterGenSwitch=cyc 44=L:IntercoolerFlap1Switch=SET 45=L:IntercoolerFlap2Switch=SET 46=L:IntercoolerFlap3Switch=SET 47=L:IntercoolerFlap4Switch=SET 48=L:CowlFlap1Switch=SET 49=L:CowlFlap2Switch=SET 50=L:CowlFlap3Switch=SET 51=L:CowlFlap4Switch=SET 52=L:CF1SMouse=SET 53=L:CF2SMouse=SET 54=L:CF3SMouse=SET 55=L:CF4SMouse=SET 60=L:StartersStart=SET 61=L:StartersBoost=SET 62=L:Primers=SET 63=L:LandingLightExtendSwitch=SET 64=L:StepsLightSwitch=SET 16th dezember: some new macro functions added: one important is the cowl flaps entry. You have to combine inside the FSUIPC.ini some functions to get the cowl flaps to work: example for button 4 of joystick F: 81=RF,4,CM8:48,2 82=RF,4,CM8:52,1 83=UF,4,CM8:48,1 line 81: L:CowlFlap1Switch=SET with parameter 2 and line 82: L:CF1SMouse=SET with parameter 1 must be used to get the cowl flaps work. line 83 is needed at the button release to switch the cowl flap switch back to neutral position. B377 fuel selector LUA code -- All Fuel Selectors OFF if ipcPARAM == 1 then ipc.writeLvar("L:FuelSelE1Knob", 0) ipc.writeLvar("L:FuelSelE2Knob", 0) ipc.writeLvar("L:FuelSelE3Knob", 0) ipc.writeLvar("L:FuelSelE4Knob", 0) -- All Fuel Selectors 25 elseif ipcPARAM == 2 then ipc.writeLvar("L:FuelSelE1Knob", 25) ipc.writeLvar("L:FuelSelE2Knob", 25) ipc.writeLvar("L:FuelSelE3Knob", 25) ipc.writeLvar("L:FuelSelE4Knob", 25) -- All Fuel Selectors 50 elseif ipcPARAM == 3 then ipc.writeLvar("L:FuelSelE1Knob", 50) ipc.writeLvar("L:FuelSelE2Knob", 50) ipc.writeLvar("L:FuelSelE3Knob", 50) ipc.writeLvar("L:FuelSelE4Knob", 50) -- All Fuel Selectors 75 elseif ipcPARAM == 4 then ipc.writeLvar("L:FuelSelE1Knob", 75) ipc.writeLvar("L:FuelSelE2Knob", 75) ipc.writeLvar("L:FuelSelE3Knob", 75) ipc.writeLvar("L:FuelSelE4Knob", 75) end 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! - updated 16th dezember 2009 macros added, lua code for fuel selector
  20. I have made some little LUA and MACRO files for different aircrafts the last weeks and d'like to share them here. LUA commands 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 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) parameter numbers for the CAT: -- 1 = floats down -- 2 = floats up -- 3 = Carb Heat L up -- 4 = Carb heat L neutral -- 5 = Carb Heat L down -- 6 = Carb Heat L up -- 7 = Carb heat L neutral -- 8 = Carb Heat L down -- 9 = Primer L toggle -- 10 = Primer R toggle -- 11 = Starter L toggle -- 12 = Starter R toggle -- 13 = Mixture Levers Full Rich -- 14 = Mixture Levers Auto Rich -- 15 = Mixture Levers Auto Lean -- 16 = Mixture Levers Cutoff -- 17 = Both Fuel selectors OFF -- 18 = Both Fuel selectors ON - Both -- 19 = Gyro Pilot (AP) toggle -- 20 = Gyro Pilot (AP) ON -- 21 = Gyro Pilot (AP) OFF -- 24 = Sperry Gain Elevator ON/OFF (value 3.5) -- 27 = Sperry Gain Aileron ON/OFF (value 3.5) -- 30 = Sperry Gain Rudder ON/OFF (value 3.5) -- 31 = Ignition ON and Magnetos both -- 32 = toggle master battery -- param nr -- 1 = floats down -- 2 = floats up -- 3 = Carb Heat L up -- 4 = Carb heat L neutral -- 5 = Carb Heat L down -- 6 = Carb Heat L up -- 7 = Carb heat L neutral -- 8 = Carb Heat L down -- 9 = Primer L toggle -- 10 = Primer R toggle -- 11 = Starter L toggle -- 12 = Starter R toggle -- 13 = Mixture Levers Full Rich -- 14 = Mixture Levers Auto Rich -- 15 = Mixture Levers Auto Lean -- 16 = Mixture Levers Cutoff -- 17 = Both Fuel selectors OFF -- 18 = Both Fuel selectors ON - Both -- 19 = Gyro Pilot (AP) toggle -- 20 = Gyro Pilot (AP) ON -- 21 = Gyro Pilot (AP) OFF -- 24 = Sperry Gain Elevator ON/OFF (value 3.5) -- 27 = Sperry Gain Aileron ON/OFF (value 3.5) -- 30 = Sperry Gain Rudder ON/OFF (value 3.5) -- 31 = Ignition ON and Magnetos both -- 32 = toggle master battery -- Floats down if ipcPARAM == 1 then ipc.writeLvar("L:Cat_float", 2) ipc.sleep(3000) ipc.writeLvar("L:Cat_float", 0) -- Floats up elseif ipcPARAM == 2 then ipc.writeLvar("L:Cat_float", 1) ipc.sleep(3000) ipc.writeLvar("L:Cat_float", 0) -- Carb heat L up elseif ipcPARAM == 3 then ipc.writeLvar("Carbheat_pos_L", 1) -- Carb heat L neutral elseif ipcPARAM == 4 then ipc.writeLvar("Carbheat_pos_L", 0) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) -- Carb heat L down elseif ipcPARAM == 5 then ipc.writeLvar("Carbheat_pos_L", 2) -- Carb heat R up elseif ipcPARAM == 6 then ipc.writeLvar("Carbheat_pos_R", 1) -- Carb heat R neutral elseif ipcPARAM == 7 then ipc.writeLvar("Carbheat_pos_R", 0) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) -- Carb heat R down elseif ipcPARAM == 8 then ipc.writeLvar("Carbheat_pos_R", 2) -- Primer L Toggle elseif ipcPARAM == 9 then Cat_prime = "L:Cat_prime" val = 0 if ipc.readLvar(Cat_prime) == 0 then val = 2 end ipc.writeLvar(Cat_prime, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Primer R Toggle elseif ipcPARAM == 10 then Cat_prime = "L:Cat_prime" val = 0 if ipc.readLvar(Cat_prime) == 0 then val = 1 end ipc.writeLvar(Cat_prime, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Starter L Toggle elseif ipcPARAM == 11 then Cat_starter = "L:Cat_starter" val = 0 if ipc.readLvar(Cat_starter) == 0 then val = 2 end ipc.writeLvar(Cat_starter, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Starter R Toggle elseif ipcPARAM == 12 then Cat_starter = "L:Cat_starter" val = 0 if ipc.readLvar(Cat_starter) == 0 then val = 1 end ipc.writeLvar(Cat_starter, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Both Mixture Lever Full Rich elseif ipcPARAM == 13 then ipc.writeLvar("L:Cat_mixture_L_pos", 0) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 0) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 0) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 0) -- Both Mixture Lever Auto Rich elseif ipcPARAM == 14 then ipc.writeLvar("L:Cat_mixture_L_pos", 25) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 25) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 1) -- Both Mixture Lever Auto Lean elseif ipcPARAM == 15 then ipc.writeLvar("L:Cat_mixture_L_pos", 50) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 50) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 2) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 2) -- Both Mixture Lever Cutoff elseif ipcPARAM == 16 then ipc.writeLvar("L:Cat_mixture_L_pos", 75) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 75) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 3) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 3) -- Both Fuel selectors OFF elseif ipcPARAM == 17 then ipc.control(66516) ipc.sleep(100) ipc.control(65955) -- Both Fuel selectors ON - Both elseif ipcPARAM == 18 then ipc.control(66517) ipc.sleep(100) ipc.control(65956) -- Gyro Pilot (AP) toggle elseif ipcPARAM == 19 then AP_Lever = "L:Cat_AP_Lever" val = 0 if ipc.readLvar(AP_Lever) == 0 then val = 1 end ipc.writeLvar(AP_Lever, val) ipc.writeLvar("L:CAT_LEVER", 1) -- Gyro Pilot (AP) ON elseif ipcPARAM == 20 then ipc.writeLvar("L:Cat_AP_Lever", 1) ipc.writeLvar("L:CAT_LEVER", 1) -- Gyro Pilot (AP) OFF elseif ipcPARAM == 21 then ipc.writeLvar("L:Cat_AP_Lever", 0) ipc.writeLvar("L:CAT_LEVER", 1) -- Sperry Gain Elevator ON/OFF (value 3.5) elseif ipcPARAM == 24 then gain_elev = "L:Sperry_gain_elevator" val = 0 if ipc.readLvar(gain_elev) val = 44 end ipc.writeLvar(gain_elev, val) -- Sperry Gain Aileron ON/OFF (value 3.5) elseif ipcPARAM == 27 then gain_aileron = "L:Sperry_gain_aileron" val = 0 if ipc.readLvar(gain_aileron) val = 44 end ipc.writeLvar(gain_aileron, val) -- Sperry Gain Rudder ON/OFF (value 3.5) elseif ipcPARAM == 30 then gain_rudder = "L:Sperry_gain_rudder" val = 0 if ipc.readLvar(gain_rudder) val = 44 end ipc.writeLvar(gain_rudder, val) -- Ignition ON and Magnetos both elseif ipcPARAM == 31 then ipc.control(66026) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) ipc.sleep(300) ipc.control(66535) ipc.writeLvar("L:CAT_SWITCH_ON", 1) elseif ipcPARAM == 32 then Cat_master = "L:Cat_master_batt_OFF" val = 0 if ipc.readLvar(Cat_master) == 0 then val = 1 end ipc.writeLvar(Cat_master, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) end upd 19th Dez 09 I have made a second file of commands, because I have made a new hardware switch panel and needed some new commands (e.g. On/Off instead of toggle) also there are some new functions: APU and APU Generator toggle Because the parameter numbers have changed I insert here a second code. If you want these new codes you have to copy them out or copy the hole file and change parameters -- 1 = floats down -- 2 = floats up -- 3 = Carb Heat L up -- 4 = Carb heat L neutral -- 5 = Carb Heat L down -- 6 = Carb Heat R up -- 7 = Carb heat R neutral -- 8 = Carb Heat R down -- 9 = Primer L ON -- 10 = Primer OFF -- 11 = Primer R ON -- 12 = Primer L Toggle -- 13 = Primer R Toggle -- 14 = Starter L ON -- 15 = Starter OFF -- 16 = Starter R ON -- 17 = Mixture Levers Full Rich -- 18 = Mixture Levers Auto Rich -- 19 = Mixture Levers Auto Lean -- 20 = Mixture Levers Cutoff -- 21 = Both Fuel selectors OFF -- 22 = Both Fuel selectors ON - Both -- 23 = Left Fuel selectors OFF -- 24 = Right Fuel selectors OFF -- 25 = Left Fuel selector ON -- 26 = Right Fuel selector ON -- 27 = Gyro Pilot (AP) toggle -- 28 = Gyro Pilot (AP) ON -- 29 = Gyro Pilot (AP) OFF -- 30 = Sperry Gain Elevator ON/OFF (value 3.5) -- 31 = Sperry Gain Aileron ON/OFF (value 3.5) -- 32 = Sperry Gain Rudder ON/OFF (value 3.5) -- 33 = Ignition ON and Magnetos both -- 34 = toggle master battery -- 35 = Master Battery OFF -- 36 = Master Battery ON -- 37 = APU toggle -- 38 = APU Gen toggle -- param nr -- 1 = floats down -- 2 = floats up -- 3 = Carb Heat L up -- 4 = Carb heat L neutral -- 5 = Carb Heat L down -- 6 = Carb Heat R up -- 7 = Carb heat R neutral -- 8 = Carb Heat R down -- 9 = Primer L ON -- 10 = Primer OFF -- 11 = Primer R ON -- 12 = Primer L Toggle -- 13 = Primer R Toggle -- 14 = Starter L ON -- 15 = Starter OFF -- 16 = Starter R ON -- 17 = Mixture Levers Full Rich -- 18 = Mixture Levers Auto Rich -- 19 = Mixture Levers Auto Lean -- 20 = Mixture Levers Cutoff -- 21 = Both Fuel selectors OFF -- 22 = Both Fuel selectors ON - Both -- 23 = Left Fuel selectors OFF -- 24 = Right Fuel selectors OFF -- 25 = Left Fuel selector ON -- 26 = Right Fuel selector ON -- 27 = Gyro Pilot (AP) toggle -- 28 = Gyro Pilot (AP) ON -- 29 = Gyro Pilot (AP) OFF -- 30 = Sperry Gain Elevator ON/OFF (value 3.5) -- 31 = Sperry Gain Aileron ON/OFF (value 3.5) -- 32 = Sperry Gain Rudder ON/OFF (value 3.5) -- 33 = Ignition ON and Magnetos both -- 34 = toggle master battery -- 35 = Master Battery OFF -- 36 = Master Battery ON -- 37 = APU toggle -- 38 = APU Gen toggle -- Floats down if ipcPARAM == 1 then ipc.writeLvar("L:Cat_float", 2) ipc.sleep(3000) ipc.writeLvar("L:Cat_float", 0) -- Floats up elseif ipcPARAM == 2 then ipc.writeLvar("L:Cat_float", 1) ipc.sleep(3000) ipc.writeLvar("L:Cat_float", 0) -- Carb heat L up elseif ipcPARAM == 3 then ipc.sleep(2) ipc.writeLvar("Carbheat_pos_L", 1) -- Carb heat L neutral elseif ipcPARAM == 4 then ipc.writeLvar("Carbheat_pos_L", 0) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) -- Carb heat L down elseif ipcPARAM == 5 then ipc.sleep(2) ipc.writeLvar("Carbheat_pos_L", 2) -- Carb heat R up elseif ipcPARAM == 6 then ipc.sleep(2) ipc.writeLvar("Carbheat_pos_R", 1) -- Carb heat R neutral elseif ipcPARAM == 7 then ipc.writeLvar("Carbheat_pos_R", 0) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) -- Carb heat R down elseif ipcPARAM == 8 then ipc.sleep(2) ipc.writeLvar("Carbheat_pos_R", 2) -- Primer L ON elseif ipcPARAM == 9 then ipc.writeLvar("L:Cat_prime", 2) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Primer OFF elseif ipcPARAM == 10 then ipc.writeLvar("L:Cat_prime", 0) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Primer R ON elseif ipcPARAM == 11 then ipc.writeLvar("L:Cat_prime", 1) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Primer L Toggle elseif ipcPARAM == 12 then Cat_prime = "L:Cat_prime" val = 0 if ipc.readLvar(Cat_prime) == 0 then val = 2 end ipc.writeLvar(Cat_prime, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Primer R Toggle elseif ipcPARAM == 13 then Cat_prime = "L:Cat_prime" val = 0 if ipc.readLvar(Cat_prime) == 0 then val = 1 end ipc.writeLvar(Cat_prime, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Starter L ON elseif ipcPARAM == 14 then ipc.writeLvar("L:Cat_starter", 2) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Starter OFF elseif ipcPARAM == 15 then ipc.writeLvar("L:Cat_starter", 0) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Starter OFF elseif ipcPARAM == 16 then ipc.writeLvar("L:Cat_starter", 1) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Both Mixture Lever Full Rich elseif ipcPARAM == 17 then ipc.writeLvar("L:Cat_mixture_L_pos", 0) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 0) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 0) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 0) -- Both Mixture Lever Auto Rich elseif ipcPARAM == 18 then ipc.writeLvar("L:Cat_mixture_L_pos", 25) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 25) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 1) -- Both Mixture Lever Auto Lean elseif ipcPARAM == 19 then ipc.writeLvar("L:Cat_mixture_L_pos", 50) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 50) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 2) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 2) -- Both Mixture Lever Cutoff elseif ipcPARAM == 20 then ipc.writeLvar("L:Cat_mixture_L_pos", 75) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:Cat_mixture_R_pos", 75) ipc.writeLvar("L:CAT_LEVER", 1) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_L", 3) ipc.sleep(50) ipc.writeLvar("L:A_MIX_MODE_R", 3) -- Both Fuel selectors OFF elseif ipcPARAM == 21 then ipc.control(66516) ipc.sleep(100) ipc.control(65955) -- Both Fuel selectors ON - Both elseif ipcPARAM == 22 then ipc.control(66517) ipc.sleep(100) ipc.control(65956) -- Left Fuel selector OFF elseif ipcPARAM == 23 then ipc.control(65955) -- Right Fuel selector OFF elseif ipcPARAM == 24 then ipc.control(66516) -- Left Fuel selector ON elseif ipcPARAM == 25 then ipc.control(65956) -- Right Fuel selector ON elseif ipcPARAM == 26 then ipc.control(66517) -- Gyro Pilot (AP) toggle elseif ipcPARAM == 27 then AP_Lever = "L:Cat_AP_Lever" val = 0 if ipc.readLvar(AP_Lever) == 0 then val = 1 end ipc.writeLvar(AP_Lever, val) ipc.writeLvar("L:CAT_LEVER", 1) -- Gyro Pilot (AP) ON elseif ipcPARAM == 28 then ipc.writeLvar("L:Cat_AP_Lever", 1) ipc.writeLvar("L:CAT_LEVER", 1) -- Gyro Pilot (AP) OFF elseif ipcPARAM == 29 then ipc.writeLvar("L:Cat_AP_Lever", 0) ipc.writeLvar("L:CAT_LEVER", 1) -- Sperry Gain Elevator ON/OFF (value 3.5) elseif ipcPARAM == 30 then gain_elev = "L:Sperry_gain_elevator" val = 0 if ipc.readLvar(gain_elev) val = 44 end ipc.writeLvar(gain_elev, val) -- Sperry Gain Aileron ON/OFF (value 3.5) elseif ipcPARAM == 31 then gain_aileron = "L:Sperry_gain_aileron" val = 0 if ipc.readLvar(gain_aileron) val = 44 end ipc.writeLvar(gain_aileron, val) -- Sperry Gain Rudder ON/OFF (value 3.5) elseif ipcPARAM == 32 then gain_rudder = "L:Sperry_gain_rudder" val = 0 if ipc.readLvar(gain_rudder) val = 44 end ipc.writeLvar(gain_rudder, val) -- Ignition ON and Magnetos both elseif ipcPARAM == 33 then ipc.control(66026) ipc.writeLvar("L:CAT_SWITCH_OFF", 1) ipc.sleep(300) ipc.control(66535) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Master Battery elseif ipcPARAM == 34 then Cat_master = "L:Cat_master_batt_OFF" val = 0 if ipc.readLvar(Cat_master) == 0 then val = 1 end ipc.writeLvar(Cat_master, val) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Master Battery OFF elseif ipcPARAM == 35 then ipc.writeLvar("L:Cat_master_batt_OFF", 0) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- Master Battery ON elseif ipcPARAM == 36 then ipc.writeLvar("L:Cat_master_batt_OFF", 1) ipc.writeLvar("L:CAT_SWITCH_ON", 1) -- APU toggle elseif ipcPARAM == 37 then Cat_APU_run = "L:Cat_APU_run" val = 0 if ipc.readLvar(Cat_APU_run) == 0 then val = 2 elseif ipc.readLvar(Cat_APU_run) == 1 then val = 0 end ipc.writeLvar("L:CAT_SWITCH_ON", 1) ipc.writeLvar("L:Cat_apu_control", val) -- APU Gen toggle elseif ipcPARAM == 38 then Cat_APU_gen = "L:Cat_APU_gen" val = 0 if ipc.readLvar(Cat_APU_gen) == 0 then val = 1 end ipc.writeLvar("L:CAT_SWITCH_ON", 1) ipc.writeLvar("L:Cat_APU_Gen", val) end 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!
  21. I have made some little LUA and MACRO files for different aircrafts the last weeks and d'like to share them here. MACRO [Macros] Module="PMDG_MD11.DLL" 1=EFIS TRFC=RX5860*X8b00 2=EFIS DATA=RX5870*X8b00 3=EFIS WPT=RX5880*X8b00 4=EFIS VOR NDB=RX5890*X8b00 5=EFIS ARPT=RX58a0*X8b00 6=EFIS MAP=RX5820*X8b00 7=EFIS PLAN=RX5830*X8b00 8=EFIS VOR=RX5840*X8b00 9=EFIS APPR=RX5850*X8b00 10=EFIS TCAS=RX58b0*X8b00 11=EFIS Range INCR=RX5900*X8b00 12=EFIS Range DECR=RX5910*X8b00 13=EFIS VOR1=RX58c0*X8b00 14=EFIS VOR2=RX58e0*X8b00 15=EFIS ADF1=RX58d0*X8b00 16=EFIS ADF2=RX58f0*X8b00 17=EFIS IN HP=RX5740*X8bcc 18=EFIS BARO DECR=RX57a0*X8bcc,13 19=EFIS BARO INCR=RX57a0*X8bcc,14 20=EFIS MIN incr=RX57f0*X8b00,14 21=EFIS MIN dec=RX57f0*X8b00,13 22=EFIS BARO pull=RX5760*Xf7cc,31 23=PED AutoBrake de=RXf8d0*X8b00 24=PED AutoBrake in=RXf8d0*X8b00,31 25=PED Retr Spoiler=RXd990*X8bcc 26=PED 1/3 Spoiler=RXd9b0*X8bcc 27=PED 2/3 Spoiler=RXd9d0*X8bcc 28=PED Full Spoiler=RXd9f0*X8bcc 29=PED DialAFlap in=RXd560*X8bcc 30=PED DialAFlap de=RXd560*X8bcc,31 31=PED Flap up=RXd480*X8bcc 32=PED Flaps Stats=RXd4a0*X8bcc 33=PED Flaps Dial=RXd4c0*Xa1cc 34=PED Flaps 28=RXd500*X8bcc 35=PED Flaps 35=RXd520*X8bcc 36=PED Flaps 50=RXd540*X8bcc 37=MCP Autoflight=RX63b0*X8b00 38=MCP Appr=RX6440*X8b00 39=MCP NAV=RX6430*X8bcc 40=MCP PROF=RX6400*X8bcc 41=MCP ALT Push=RX6490*X8bcc 42=MCP Alt Pull=RX6490*X8bcc,31 43=MCP HDG Push=RX6410*X8b00 44=MCP HDG Pull=RX6410*X8b00,31 45=MCP SPD Push=RX6450*X8b00 46=MCP SPD Pull=RX6450*X8b00,31 47=MCP IAS MACH=RX6380*X8b00 48=MCP HDG Track=RX6370*X8bcc 49=MCP VS decr=RX6330*X8bcc 50=MCP VS incr=RX6330*X8bcc,14 51=MCP FT MTR=RX6390*X8b00 52=MCP VS FPA=RX63a0*X8b00 53=MCP SPD incr=RX6470*X8bcc,14 54=MCP SPD decr=RX6470*X8bcc,13 55=MCP HDG incr=RX6310*X8b00,14 56=MCP HDG decr=RX6310*X8b00,13 57=MCP ALT incr=RX64b0*X8bcc,14 58=MCP ALT decr=RX64b0*X8bcc,13 59=Lights LDG_ON Le 59.1=RX3270*X8bcc 59.2=RX3270*X8bcc 60=Lights LDG_OFF L 60.1=RX3270*X8bcc,31 60.2=RX3270*X8bcc,31 61=LightsTaxi_ON 61.1=RX32b0*X8bcc 61.2=RX32b0*X8bcc 62=Lights Taxi_OFF 62.1=RX32b0*X8bcc,31 62.2=RX32b0*X8bcc,31 63=Lights Nav+ 63.1=RX33b0*X8bcc 63.2=RX3390*X8bcc 64=Lights STROBE=RX33f0*X8bcc 65=Lights BCNt=RX33d0*X8bcc 66=Lights Panel=RX3450*X8bcc 67=Traffic inc=RX7220*X8b00,31 68=Traffic dec=RX7220*X8b00 69=OHD: Batt on 69.1=RX9300*X8bcc 69.2=RX9300*X8bcc 70=Master Warn Ligh=RX4ee0*X8b78 71=Wiper inc 71.1=RX3550*X8bcc,31 71.2=RX3530*X8bcc,31 72=L:pmdg_hide_yoke=tog 73=Wiper dec 73.1=RX3530*X8bcc 73.2=RX3550*X8bcc 74=MCP FMS SPD=C66587, 71015 75=PED AT Disc=C66587, 73152 76=OHD: APU=RXdf20*X8bcc 77=Lights LDG_ON ri 77.1=RX3290*X8bcc 77.2=RX3290*X8bcc 78=Lights LDG_OFFri 78.1=RX3290*X8bcc,31 78.2=RX3290*X8bcc,31 79=Fuel2 ON=RXd060*X8bcc 80=Lights Emer arm=RX32f0*X8bcc 81=Eng3 start=RXd020*X8bcc,31 82=Eng 2 Start=RXd000*X8bcc,31 83=Eng1 start=RXcfe0*X8bcc,31 84=Fuel3 OFF=RXd080*X8bcc,31 85=Fuel3 ON=RXd080*X8bcc 86=Fuel2 OFF=RXd060*X8bcc,31 87=Fuel1 ON=RXd040*X8bcc 88=Fuel1 OFF=RXd040*X8bcc,31 89=IGNITION A=RXcbf0*X8bcc 90=Lights Panl inc 90.1=RX4f30*X8bcc,14 90.2=RX4f10*X8b00,14 90.3=RX34f0*X8bcc,14 90.4=RX34d0*X8bcc,14 90.5=RX3490*X8bcc,14 90.6=RX34b0*X8bcc,14 91=Lights panl dec 91.1=RX4f30*X8bcc,13 91.2=RX4f10*X8b00,13 91.3=RX34f0*X8bcc,13 91.4=RX34d0*X8bcc,13 91.5=RX34b0*X8bcc,13 91.6=RX3490*X8bcc,13 93=Lights Thunder=RX3470*X8bcc 94=LightWing+Runw 94.1=RX3350*X8bcc 94.2=RX3370*X8bcc LUA MD11 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 yokes, switched off the lights and switched on the framerate-saving overhead switch (PMDG MD-11 introduction.pdf page 54 [chapter 0.00.54]) with one click. cool, or? ipc.sleep(2000) ipc.writeLvar("L:pmdg_hide_yoke", 0) ipc.writeLvar("L:pmdg_hide_yoke", 1) ipc.writeLvar("L:HIDE_OVERHEAD_SWITCHES_var", 1) ipc.control(65574) -- all lights on ipc.control(65574) -- all lights off LUA for panelstate As the MD11 has unfortunately no possiblity to load a defined panelstate, this LUA will help a little. It uses the method that you can generate keystrokes with LUA. This LUA does nothing else than you will do if you load a panelstate via the FS and PMDG menu. But it does it much more faster and with just one click. Look into te LUA file to change the loading of different panelstates. Note: as the LUA always counts down through the panelstates which are in the PMDG menu you should rename the PMDG panelstates from e.g. "PMDG MD-11 After Engine Start.sav" to "00_PMDG MD-11 After Engine Start.sav" so they are always at top of the list. The panelstates are found in the folder: X:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\PMDG\MD11\panelstate -- MD-11 panel status automatic -- ipc.keypressplus(18,1,4) -- ALT and focus to FS ipc.keypressplus(65) -- A for Addons ipc.sleep(50) ipc.keypressplus(80) -- P for PMDG ipc.sleep(50) ipc.keypressplus(40) -- Cursor right for PMDG Menue ipc.keypressplus(40) -- Csr Down 7 times to get to panel state ipc.keypressplus(40) ipc.keypressplus(40) ipc.keypressplus(40) ipc.keypressplus(40) ipc.keypressplus(40) ipc.keypressplus(13) -- Enter -- below are the Panel States -- be sure to have the same order in your PMDG/MD11/panelstate folder -- be sure not to have any previously saved panelstates before this -- for PAX and Freighter Version maybe you have to create two different files -- Delete the entries below your prefered panelstate (now its before engine start) ipc.keypressplus(40) -- After Engine Start ipc.keypressplus(40) -- Before Engine Start --ipc.keypressplus(40) -- Cold and Dark --ipc.keypressplus(40) -- Long Ground Turn --ipc.keypressplus(40) -- Short Ground Turn --ipc.keypressplus(40) -- Tutorial --ipc.keypressplus(40) -- Freighter C&D --ipc.keypressplus(40) -- Freighter Long Ground --ipc.keypressplus(40) -- Freighter Short Ground ipc.sleep(1000) -- little pause of 1s ipc.keypressplus(13) -- ENTER to press OK button ipc.sleep(100) ipc.control(65574) -- all lights on ipc.sleep(100) ipc.control(65574) -- all lights off FSUIPC4.ini codes for ND Mode change: insert this line into the keys (or button) section into your FSUIPC4.ini: 110=117,26,x510066C0,x00040001 ;ND Mode inc start 111=B66C0=0 117,26,66587,71132 112=B66C0=1 117,26,66587,71133 113=B66C0=2 117,26,66587,71134 114=B66C0=3 117,26,66587,71135 115=B66C0=4 117,26,66587,71136 116=115,26,x610066C0,x00040001 ;ND Mode dec start 117=B66C0=0 115,26,66587,71132 118=B66C0=1 115,26,66587,71133 119=B66C0=2 115,26,66587,71134 120=B66C0=3 115,26,66587,71135 121=B66C0=4 115,26,66587,71136 ;ND Mode end don't forget to change your personal keyassignment numbers (red). If you want them assigned to to joystickbuttons, then change also the green lines and add an "C": 116=PB,1,Cx610066C0,x00040001 [EDITED by Pete: the C has to come before the "x", as the latter is just a number prefix denoting "hexadecimal" instead of "decimal"] [edited by guenseli: thanks Pete!] (in this example it is assigned to Joystick B, Button 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! --- update 16th dezember 2009: few new macro commands and changes added
  22. I have made some little LUA and MACRO files for different aircrafts the last weeks and d'like to share them here. -- update 05th Aug 2010 reworked cold&dark LUA code so that you get a question at the beginning if you want to go cold and dark -- update 19th Feb 2010: Key commands: One new item is the possibility to start the engines now via a button. A feature is, that the feathering of the selected engine is included! Of course you have to select an engine before to let them start (via my LUA or by "hand") added gust locks, prop sync switch cold and dark file: completely reworked! -- update 15th Feb 2010: AS I have learned a little about LUA the last months, I have reworked my original LUA code and have it simplified a lot. Also I added some commands, too (see parameter list). So, everybody who is interested in this new code have to reassign his parameternumbers! The Macro and the LUA from Richard Cooke below is unchanged! -- LUA commands 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 Notepad file and save it as e.g. J41.LUA 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) parameter numbers for the J41: -- 1 Left Battery toggle -- 2 Right Battery toggle -- 3 both batteries on -- 4 both batteries Off -- 5 left avionics toggle -- 6 right avionics toggle -- 7 both avionics on -- 8 both avionics off -- 9 left generator toggle -- 10 right generator toggle -- 11 left gen on -- 12 left gen off -- 13 right gen on -- 14 right gen off -- 15 LEFT Bearing CIRCLE Knob Minus -- 16 LEFT Bearing CIRLCE Knob Plus -- 17 LEFT Bearing DIAMOND Knob Plus -- 18 LEFT Bearing DIAMOND Knob Minus -- 19 CCT Auto Cycle Switch -- 20 Pilot analog ADFVOR 1 Toggle -- 21 Pilot analog ADFVOR 2 Toggle -- 22 Pilot ADF1 -- 23 Pilot VOR1 -- 24 Pilot VOR2 -- 25 Pilot ADF2 -- 26 Left fuel Pump on -- 27 Left fuel Pump off -- 28 right fuel Pump on -- 29 right fuel Pump off -- 30 ground power switch toggle -- 31 warning mute switch toggle -- 32 NAV Lights ON -- 33 NAV Lights OFF -- 34 Console lights ON -- 35 Console lights OFF -- 36 TOCW Testswitch ON -- 37 TOCW Testswitch OFF -- 38 seat belt ON -- 39 seat belt off -- 40 no smoking on -- 41 no smoking off -- 42 toggle flood light -- 43 select engine 1 (LEFT) -- 44 select engine 2 (RIGHT) -- 45 unselect engines -- 46 Feathering and starting selected engine -- 47 toggle gust locks -- 48 toggle prop sync switch -- 1 Left Battery toggle -- 2 Right Battery toggle -- 3 both batteries on -- 4 both batteries Off -- 5 left avionics toggle -- 6 right avionics toggle -- 7 both avionics on -- 8 both avionics off -- 9 left generator toggle -- 10 right generator toggle -- 11 left gen on -- 12 left gen off -- 13 right gen on -- 14 right gen off -- 15 LEFT Bearing CIRCLE Knob Minus -- 16 LEFT Bearing CIRLCE Knob Plus -- 17 LEFT Bearing DIAMOND Knob Plus -- 18 LEFT Bearing DIAMOND Knob Minus -- 19 CCT Auto Cycle Switch -- 20 Pilot analog ADFVOR 1 Toggle -- 21 Pilot analog ADFVOR 2 Toggle -- 22 Pilot ADF1 -- 23 Pilot VOR1 -- 24 Pilot VOR2 -- 25 Pilot ADF2 -- 26 Left fuel Pump on -- 27 Left fuel Pump off -- 28 right fuel Pump on -- 29 right fuel Pump off -- 30 ground power switch toggle -- 31 warning mute switch toggle -- 32 NAV Lights ON -- 33 NAV Lights OFF -- 34 Console lights ON -- 35 Console lights OFF -- 36 TOCW Testswitch ON -- 37 TOCW Testswitch OFF -- 38 seat belt ON -- 39 seat belt off -- 40 no smoking on -- 41 no smoking off -- 42 toggle flood light -- 43 select engine 1 (LEFT) -- 44 select engine 2 (RIGHT) -- 45 unselect engines -- 46 Feathering and starting selected engine -- 47 toggle gust locks -- 48 toggle prop sync switch -- LEFT Battery switch TOGGLE if ipcPARAM == 1 then LVarSet = "L:LeftBatSwitch" val = 0 if ipc.readLvar(LVarSet) == 0 then val = 1 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8028) end -- RIGHT Battery switch TOGGLE if ipcPARAM == 2 then LVarSet = "L:RightBatSwitch" val = 0 if ipc.readLvar(LVarSet) == 0 then val = 1 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8028) end -- BOTH Battery switch on if ipcPARAM == 3 then ipc.writeLvar("L:RightBatSwitch", 1) ipc.control(66587, 8028) ipc.sleep(250) ipc.writeLvar("L:LeftBatSwitch", 1) ipc.control(66587, 8028) end -- BOTH Battery switch off if ipcPARAM == 4 then ipc.writeLvar("L:RightBatSwitch", 0) ipc.control(66587, 8028) ipc.sleep(250) ipc.writeLvar("L:LeftBatSwitch", 0) ipc.control(66587, 8028) end -- Left AVIONICS SWITCh TOGGLE if ipcPARAM == 5 then LVarSet = "L:LeftAvionicsMaster" val = 0 if ipc.readLvar(LVarSet) == 0 then val = 1 end ipc.writeLvar("L:LeftAvionicsMasterGuard", val) ipc.control(66587, 8026) ipc.sleep(500) ipc.writeLvar(LVarSet, val) ipc.control(66587, 8027) end -- RIGHT AVIONICS SWITCh TOGGLE if ipcPARAM == 6 then LVarSet = "L:RightAvionicsMaster" val = 0 if ipc.readLvar(LVarSet) == 0 then val = 1 end ipc.writeLvar("L:RightAvionicsMasterGuard", val) ipc.control(66587, 8026) ipc.sleep(500) ipc.writeLvar(LVarSet, val) ipc.control(66587, 8027) end -- both AVIONICS SWITCh on if ipcPARAM == 7 then ipc.writeLvar("L:RightAvionicsMasterGuard", 1) ipc.control(66587, 8026) ipc.sleep(400) ipc.writeLvar("L:RightAvionicsMaster", 1) ipc.control(66587, 8027) ipc.sleep(100) ipc.writeLvar("L:LeftAvionicsMasterGuard", 1) ipc.control(66587, 8026) ipc.sleep(400) ipc.writeLvar("L:LeftAvionicsMaster", 1) ipc.control(66587, 8027) end -- both AVIONICS SWITCh off if ipcPARAM == 8 then ipc.writeLvar("L:RightAvionicsMasterGuard", 0) ipc.control(66587, 8026) ipc.sleep(400) ipc.writeLvar("L:RightAvionicsMaster", 0) ipc.control(66587, 8027) ipc.sleep(100) ipc.writeLvar("L:LeftAvionicsMasterGuard", 0) ipc.control(66587, 8026) ipc.sleep(400) ipc.writeLvar("L:LeftAvionicsMaster", 0) ipc.control(66587, 8027) end -- LEFT Generator SWITCH TOGGLE if ipcPARAM == 9 then LVarSet = "L:LeftGenSwitch" val = 1 if ipc.readLvar(LVarSet) == 1 then val = 2 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8027) end -- right Generator SWITCH TOGGLE if ipcPARAM == 10 then LVarSet = "L:RightGenSwitch" val = 1 if ipc.readLvar(LVarSet) == 1 then val = 2 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8027) end -- left Generator SWITCH on if ipcPARAM == 11 then ipc.writeLvar("L:LeftGenSwitch", 2) ipc.control(66587, 8027) end -- left Generator SWITCH off if ipcPARAM == 12 then ipc.writeLvar("L:LeftGenSwitch", 1) ipc.control(66587, 8027) end -- right Generator SWITCH on if ipcPARAM == 13 then ipc.writeLvar("L:RightGenSwitch", 2) ipc.control(66587, 8027) end -- right Generator SWITCH off if ipcPARAM == 14 then ipc.writeLvar("L:RightGenSwitch", 1) ipc.control(66587, 8027) end -- LEFT Bearing CIRCLE Knob Minus if ipcPARAM == 15 then i = ipc.readLvar("L:LeftBearingCircleKnob") if i &lt; 3 then ipc.writeLvar("L:LeftBearingCircleKnob", i+1) ipc.sleep(10) ipc.control(66587, 8031) end if i == 3 then ipc.writeLvar("L:LeftBearingCircleKnob", 3) end end -- LEFT Bearing CIRLCE Knob Plus if ipcPARAM == 16 then i = ipc.readLvar("L:LeftBearingCircleKnob") if i &gt; 0 then ipc.writeLvar("L:LeftBearingCircleKnob", i-1) ipc.sleep(10) ipc.control(66587, 8031) end if i == 0 then ipc.writeLvar("L:LeftBearingCircleKnob", 0) end end -- LEFT Bearing DIAMOND Knob Plus if ipcPARAM == 17 then i = ipc.readLvar("L:LeftBearingDiamondKnob") if i &lt; 3 then ipc.writeLvar("L:LeftBearingDiamondKnob", i+1) ipc.sleep(10) ipc.control(66587, 8031) end if i == 3 then ipc.writeLvar("L:LeftBearingDiamondKnob", 3) end end -- LEFT Bearing DIAMOND Knob Minus if ipcPARAM == 18 then i = ipc.readLvar("L:LeftBearingDiamondKnob") if i &gt; 0 then ipc.writeLvar("L:LeftBearingDiamondKnob", i-1) ipc.sleep(10) ipc.control(66587, 8031) end if i == 0 then ipc.writeLvar("L:LeftBearingDiamondKnob", 0) end end -- CCT Auto Cycle Switch if ipcPARAM == 19 then ipc.writeLvar("L:AutoAnticeCycle", 2) ipc.control(66587, 8028) ipc.sleep(200) ipc.writeLvar("L:AutoAnticeCycle", 1) ipc.control(66587, 8027) end -- Pilot analog ADFVOR 1 Toggle if ipcPARAM == 20 then LVarSet = "L:LeftAdfVorSwitch" val = 1 if ipc.readLvar(LVarSet) == 1 then val = 2 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8024) end -- Pilot analog ADFVOR 2 Toggle if ipcPARAM == 21 then LVarSet = "L:LeftVorAdfSwitch" val = 1 if ipc.readLvar(LVarSet) == 1 then val = 2 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8024) end -- Pilot ADF1 if ipcPARAM == 22 then ipc.writeLvar("L:LeftAdfVorSwitch", 0) ipc.control(66587, 8024) end -- Pilot VOR1 if ipcPARAM == 23 then ipc.writeLvar("L:LeftAdfVorSwitch", 1) ipc.control(66587, 8024) end -- Pilot ADF2 if ipcPARAM == 24 then ipc.writeLvar("L:LeftVorAdfSwitch", 0) ipc.control(66587, 8024) end -- Pilot VOR2 if ipcPARAM == 25 then ipc.writeLvar("L:LeftVorAdfSwitch", 1) ipc.control(66587, 8024) end -- Left fuel Pump on if ipcPARAM == 26 then ipc.writeLvar("L:LeftStbyFuelPump", 1) ipc.control(66587, 8028) end -- Left fuel Pump off if ipcPARAM == 27 then ipc.writeLvar("L:LeftStbyFuelPump", 0) ipc.control(66587, 8027) end -- right fuel Pump on if ipcPARAM == 28 then ipc.writeLvar("L:RightStbyFuelPump", 1) ipc.control(66587, 8028) end -- right fuel Pump off if ipcPARAM == 29 then ipc.writeLvar("L:RightStbyFuelPump", 0) ipc.control(66587, 8027) end --Ground power switch toggle if ipcPARAM == 30 then LVarSet = "L:GndPowerSwitch" val = 0 if ipc.readLvar(LVarSet) == 0 then val = 1 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8027) end --warning mute switch toggle if ipcPARAM == 31 then LVarSet = "L:CapMuted" val = 0 if ipc.readLvar(LVarSet) == 0 then val = 1 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 8031) ipc.sleep(100) ipc.writeLvar("L:CapMuteSwitch", val) ipc.control(66587, 8031) end -- NAV Lights ON if ipcPARAM == 32 then ipc.writeLvar("L:NavLightSwitch", 2) ipc.control(66587, 8028) end -- NAV Lights OFF if ipcPARAM == 33 then ipc.writeLvar("L:NavLightSwitch", 1) ipc.control(66587, 8028) end -- Console lights ON if ipcPARAM == 34 then ipc.control(66056) ipc.writeLvar("L:InstrConsolesLightSwitch", 1) ipc.writeLvar("L:InstrRoofLightSwitch", 1) ipc.writeLvar("L:InstrGlareshieldLightSwitch", 1) ipc.control(66587, 8031) end -- Console lights OFF if ipcPARAM == 35 then ipc.control(66057) ipc.writeLvar("L:InstrConsolesLightSwitch", 0) ipc.writeLvar("L:InstrRoofLightSwitch", 0) ipc.writeLvar("L:InstrGlareshieldLightSwitch", 0) ipc.control(66587, 8031) end -- TOCW Testswitch ON if ipcPARAM == 36 then ipc.control(66587, 8021) ipc.writeLvar("L:TocwTestSwitch", 1) end -- TOCW Testswitch OFF if ipcPARAM == 37 then ipc.control(66587, 8021) ipc.writeLvar("L:TocwTestSwitch", 0) end -- Seatbelt on if ipcPARAM == 38 then ipc.writeLvar("L:FastenSeatbeltSigns", 1) ipc.control(66587, 8028) ipc.sleep(10) ipc.control(66587, 74) end -- Seatbelt off if ipcPARAM == 39 then ipc.writeLvar("L:FastenSeatbeltSigns", 0) ipc.control(66587, 8028) ipc.sleep(10) ipc.control(66587, 74) end -- no smoking on if ipcPARAM == 40 then ipc.writeLvar("L:NoSmokingSigns", 1) ipc.control(66587, 8028) ipc.sleep(10) ipc.control(66587, 74) end -- no skmoking off if ipcPARAM == 41 then ipc.writeLvar("L:NoSmokingSigns", 0) ipc.control(66587, 8028) ipc.sleep(10) ipc.control(66587, 74) end -- toggle flood light if ipcPARAM == 42 then ipc.control(66587, 8028) ipc.sleep(10) ipc.control(66376) end -- select engine 1 (LEFT) if ipcPARAM == 43 then ipc.sleep(10) ipc.writeLvar("L:StartMasterKnob", 0) end -- select engine 2 (RIGHT) if ipcPARAM == 44 then ipc.sleep(10) ipc.writeLvar("L:StartMasterKnob", 2) end -- unselect engines if ipcPARAM == 45 then ipc.sleep(10) ipc.writeLvar("L:StartMasterKnob", 1) end -- Feathering and starting selected engine ----------------- if ipcPARAM == 46 then -- Feathering and starting left engine if ipc.readLvar("L:StartMasterKnob") == 0 then ipc.control(66587, 1420) ipc.control(66587, 8029) -- knob sound ipc.display("feathering left engine...") ipc.sleep(8000) -- waiting for feathering ipc.display("feathering left engine...n Starting left engine") ipc.writeLvar("L:LeftStart", 1) ipc.writeLvar("L:StartOneToggle", 1) ipc.writeLvar("L:LeftStartCheck", 1) ipc.writeLvar("L:LeftStartTimer", 1) end ipc.display("") -- Feathering and starting right engine if ipc.readLvar("L:StartMasterKnob") == 2 then ipc.control(66587, 1421) ipc.control(66587, 8029) -- knob sound ipc.display("feathering right engine...") ipc.sleep(8000) -- waiting for feathering ipc.display("feathering right engine...n Starting right engine") ipc.writeLvar("L:RightStart", 1) ipc.writeLvar("L:StartTwoToggle", 1) ipc.writeLvar("L:RightStartCheck", 1) ipc.writeLvar("L:RightStartTimer", 1) end ipc.display("") end -------------------------------------------------------------- -- toggle gust locks if ipcPARAM == 47 then LVarSet = "L:GustLocks" val = 0 if ipc.readLvar(LVarSet) == 0 then val = 1 end ipc.writeLvar(LVarSet, val) ipc.control(66587, 141) end -- toggle prop sync switch if ipcPARAM == 48 then LVarSet = "L:PropSync" val = 0 sval = 8027 if ipc.readLvar(LVarSet) == 0 then val = 1 sval = 8028 end ipc.writeLvar(LVarSet, val) ipc.control(66587, sval) end MACRO [Macros] 1=L:GrndSpoilersSwitch=TOG 2=Left feather 2.1=C66587, 1420 2.2=C66587, 8029 3=right feather 3.1=C66587, 1421 3.2=C66587, 8029 4=LNAV Zoom + 4.1=C66587, 4940 4.2=C66587, 8031 5=LNAV Zoom - 5.1=C66587, 4930 5.2=C66587, 8031 6=AP_HDG plus 6.1=C66587, 26902 6.2=C66587, 8031 7=AP_HDG minus 7.1=C66587, 26901 7.2=C66587, 8031 8=AP_HDG press 8.1=C66587, 2691 8.2=C66587, 8031 9=AP_Alt plus 9.1=C66587, 3921 9.2=C66587, 8031 10=AP_Alt minus 10.1=C66587, 3920 10.2=C66587, 8031 11=AP_CRS plus 11.1=C66587, 26702 11.2=C66587, 8031 12=AP_CRS minus 12.1=C66587, 26701 12.2=C66587, 8031 13=AP_CRS press 13.1=C66587, 2672 13.2=C66587, 8031 14=AP_IAS plus 14.1=C66587, 26802 14.2=C66587, 8031 15=AP_IAS minus 15.1=C66587, 26801 15.2=C66587, 8031 16=AP_IAS press 16.1=C66587, 2681 16.2=C66587, 8031 17=AP_ALT 17.1=C66587, 281 17.2=C66587, 8031 18=AP_ALTarm 18.1=C66587, 282 18.2=C66587, 8031 19=AP_VS 19.1=C66587, 283 19.2=C66587, 8031 20=AP_IAS 20.1=C66587, 284 20.2=C66587, 8031 21=AP_HDG 21.1=C66587, 277 21.2=C66587, 8031 22=AP_NAV 22.1=C66587, 278 22.2=C66587, 8031 23=AP_APPR 23.1=C66587, 279 23.2=C66587, 8031 24=AP_BC 24.1=C66587, 280 24.2=C66587, 8031 25=EFIS1_Full/Map 25.1=C66587, 214 25.2=C66587, 8038 26=EFIS1_TCAS 26.1=C66587, 215 26.2=C66587, 8038 27=EFIS1_GSPD/TTG 27.1=C66587, 217 27.2=C66587, 8038 28=EFIS1_ET 28.1=C66587, 218 28.2=C66587, 8038 29=EFIS1_V/L 29.1=C66587, 21901 29.2=C66587, 8038 30=EFIS1_LNAV 30.1=C66587, 21910 30.2=C66587, 8038 31=FMS_Enter 31.1=C66587, 3610 31.2=C66587, 8030 32=FMS_DirectTo 32.1=C66587, 3220 32.2=C66587, 8030 33=FMS_Prev 33.1=C66587, 3200 33.2=C66587, 8030 34=FMS_Next 34.1=C66587, 3210 34.2=C66587, 8030 35=FMS_NAV 35.1=C66587, 3470 35.2=C66587, 8030 36=FMS_VNAV 36.1=C66587, 3480 36.2=C66587, 8030 37=FMS_FPL 37.1=C66587, 3500 37.2=C66587, 8030 38=FMS_Plan 38.1=C66587, 3540 38.2=C66587, 8030 39=FMS_HDG 39.1=C66587, 3550 39.2=C66587, 8030 40=FMS_Tune 40.1=C66587, 3560 40.2=C66587, 8030 41=FMS_Back 41.1=C66587, 3460 41.2=C66587, 8030 J41 cold and dark LUA Assign this LUA to a key or button. Pressing this button will set the J41 to cold and dark (don't use it during flight :lol: ) This cold and dark file was initially from William Ruppel, reworked by me and also with codes from Tom Risager, and Richard Cooke (A worldwide project - far better then airbus isn't it :D ) -- -- FSUIPC4 Lua Script: PMDG JS4100 Cold and Dark -- -- -- AUTHOR -- William Ruppel, Guenter Steiner -- wcruppel@rogers.com -- -- VERSION -- 1.2 -- -- INSTALLATION INSTRUCTIONS -- 1) Must have a resistered copy of FSUIPC4 -- 2) Copy this file to the FSX Modules directory -- 3) Open FSUIPC4.INI -- 4) Add a line to the [LuaFiles] section. Example: -- [LuaFiles] -- 1=PMDG_JS41_CD -- 5) Start FSX, go to FSUIPC, and assign the script to a keypress or mouse button -- -- CHANGE HISTORY -- -- Name Date What -- ---- ----------- ---- -- William Ruppel 10-Dec-2009 Collected scripts by Guenter Steiner, Tom Risager, and Richard Cooke. Thanks boys! -- William Ruppel 14-Feb-2010 Add mute button and start latches on engine shutdown -- -- Guenter Steiner 18-Feb-2010 Added Dialog window, added prop sync switch, added gust lock, fixed engine-won't-start-at-first-time-error -- Guenter Steiner 05-Aug-2010 Added LUA question dialog ipc.sleep(100) ipc.display("Cold&amp;Dark Sequence initiated...") ipc.sleep(3000) questvar = ipc.ask("Captain, do you want to go cold&amp;dark? (y / n)") if questvar == "y" then ipc.display ("Please wait, going Cold and Dark!") ipc.sleep(1000) ipc.display ("Please wait, going Cold and Dark!n Mute Button:") -- MUTE button ON if ipc.readLvar("L:CapMuted") == 0 then ipc.writeLvar("L:CapMuteSwitch", 1) ipc.control(66587,8031) ipc.writeLvar("L:CapMuted", 1) ipc.sleep(200) ipc.writeLvar("L:CapMuteSwitch", 0) ipc.control(66587,8031) end ipc.display ("Please wait, going Cold and Dark!n Mute Button: set") ipc.sleep(200) -- RIGHT Engine OFF ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF:") -- Open the stop switch guard RSG = ipc.readLvar("L:RightEngStopSwitchGuard") if RSG == 0 then ipc.writeLvar("L:RightEngStopSwitchGuard", 1) ipc.control(66587, 8010) end -- Press the stop switch ipc.sleep(700) ipc.writeLvar("L:StopTwoToggle", 1) ipc.control(66587, 100001) ipc.control(66587, 8042) ipc.control(66587, 16) ipc.control(66301) ipc.control(66587, 100002) ipc.sleep(200) ipc.writeLvar("L:StopTwoToggle", 0) ipc.control(66587, 8042) -- Close the stop switch guard ipc.sleep(200) ipc.writeLvar ("L:RightEngStopSwitchGuard", 0) ipc.control (66587, 8010) -- Move the throttle to full reverse for start latch ipc.control (65972) for i = 1, 50 do ipc.control (65971) end ipc.sleep(5000) ipc.control (65972) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: set") ipc.sleep(200) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF:") -- LEFT Engine OFF -- Open the stop switch guard LSG = ipc.readLvar("L:LeftEngStopSwitchGuard") if LSG == 0 then ipc.writeLvar("L:LeftEngStopSwitchGuard", 1) ipc.control(66587, 8010) end -- Press the stop switch ipc.sleep(700) ipc.writeLvar("L:StopOneToggle", 1) ipc.control(66587, 100001) ipc.control(66587, 8042) ipc.control(66587, 15) ipc.control(66300) ipc.control(66587, 100002) ipc.sleep(200) ipc.writeLvar("L:StopOneToggle", 0) ipc.control(66587, 8042) -- Close the stop switch guard ipc.sleep(200) ipc.writeLvar ("L:LeftEngStopSwitchGuard", 0) ipc.control (66587, 8010) -- Move the throttle to full reverse for start latch ipc.control (65967) for i = 1, 50 do ipc.control (65966) end ipc.sleep(5000) ipc.control (65967) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: set") ipc.sleep(200) -- LEFT Generator Switch OFF ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches:") LGen = ipc.readLvar("L:LeftGenSwitch") if LGen == 2 then ipc.writeLvar("L:LeftGenSwitch", 1) ipc.control(66587, 8027) end ipc.sleep(200) -- RIGHT Generator Switch OFF RGen = ipc.readLvar("L:RightGenSwitch") if RGen == 2 then ipc.writeLvar("L:RightGenSwitch", 1) ipc.control(66587, 8027) end ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: set") ipc.sleep(200) -- LEFT Battery Switch OFF ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches:") LBat = ipc.readLvar("L:LeftBatSwitch") if LBat == 1 then ipc.writeLvar("L:LeftBatSwitch", 0) ipc.control(66587, 8028) end ipc.sleep(200) -- Right Battery Switch OFF RBat = ipc.readLvar("L:RightBatSwitch") if RBat == 1 then ipc.writeLvar("L:RightBatSwitch", 0) ipc.control(66587, 8028) end ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: set") ipc.sleep(200) -- Left Avionics Switch OFF ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches:") LAvM = ipc.readLvar("L:LeftAvionicsMaster") if LAvM == 1 then ipc.writeLvar("L:LeftAvionicsMasterGuard", 0) ipc.control(66587, 8026) ipc.sleep(500) ipc.writeLvar("L:LeftAvionicsMaster", 0) ipc.control(66587, 8027) end ipc.sleep(200) -- RIGHT Avionics Switch OFF RAvM = ipc.readLvar("L:RightAvionicsMaster") if RAvM == 1 then ipc.writeLvar("L:RightAvionicsMasterGuard", 0) ipc.control(66587, 8026) ipc.sleep(500) ipc.writeLvar("L:RightAvionicsMaster", 0) ipc.control(66587, 8027) end ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: set") ipc.sleep(100) -- LEFT Fuel Pump Switch OFF ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches:") LFuel = ipc.readLvar("L:LeftStbyFuelPump") if LFuel == 1 then ipc.writeLvar("L:LeftStbyFuelPump", 0) ipc.control(66587, 8027) end ipc.sleep(250) -- RIGHT Fuel Pump Switch OFF RFuel = ipc.readLvar("L:RightStbyFuelPump") if RFuel == 1 then ipc.writeLvar("L:RightStbyFuelPump", 0) ipc.control(66587, 8027) end ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: set") ipc.sleep(200) -- DC Power Source Knob OFF DCP = ipc.readLvar("L:DCPowerSourceKnob") if DCP &gt;= 1 then ipc.writeLvar("L:DCPowerSourceKnob", 0) ipc.control(66587, 8039) end ipc.sleep(200) -- Beacon OFF ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs:") BCN = logic.And(ipc.readUW(0x0D0C), 0x2) if BCN ~= 0 then ipc.control(66239) ipc.control(66587,8027) end ipc.sleep(200) -- NAV Lights OFF ipc.writeLvar("L:NavLightSwitch", 1) ipc.control(66587, 8028) ipc.sleep(300) -- Console lights OFF ipc.control(66057) ipc.writeLvar("L:InstrConsolesLightSwitch", 0) ipc.writeLvar("L:InstrRoofLightSwitch", 0) ipc.writeLvar("L:InstrGlareshieldLightSwitch", 0) ipc.control(66587, 8031) ipc.sleep(200) -- Seatbelt off ipc.writeLvar("L:FastenSeatbeltSigns", 0) ipc.control(66587, 8028) ipc.sleep(10) ipc.control(66587, 74) ipc.sleep(200) -- no skmoking off ipc.writeLvar("L:NoSmokingSigns", 0) ipc.control(66587, 8028) ipc.sleep(10) ipc.control(66587, 74) ipc.sleep(250) -- Left Windshield Antiice OFF LWS = ipc.readLvar("L:LeftWSAntice") if (LWS == 2 or LWS == 0) then ipc.writeLvar("L:LeftWSAntice",1) ipc.control(66587,8027) end ipc.sleep(200) -- Right Windshield Antiice OFF RWS = ipc.readLvar("L:RightWSAntice") if RWS == 1 then ipc.writeLvar("L:RightWSAntice",0) ipc.control(66587,8027) end ipc.sleep(200) -- Left Air Data OFF LAD = ipc.readLvar("L:LeftAirData") if LAD == 1 then ipc.writeLvar("L:LeftAirData",0) ipc.control(66587,8027) end ipc.sleep(150) -- Right Air Data OFF RAD = ipc.readLvar("L:RightAirData") if RAD == 1 then ipc.writeLvar("L:RightAirData",0) ipc.control(66587,8027) end ipc.sleep(200) -- prop sync switch OFF ipc.writeLvar("L:PropSync", 0) ipc.control(66587, 8027) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs: set") ipc.sleep(200) -- Move Yokes to Lower Position ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs: setn Move Yokes:") ipc.writeLvar("L:CPYokeUpDown", 1) ipc.writeLvar("L:PICYokeUpDown", 1) ipc.sleep(200) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs: setn Move Yokes: set") ipc.sleep(200) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs: setn Move Yokes: setn Gust Locks:") -- Gust Locks ipc.writeLvar("L:GustLocks", 1) ipc.control(66587, 141) ipc.sleep(200) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs: setn Move Yokes: setn Gust Locks: set") ipc.sleep(200) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs: setn Move Yokes: setn Gust Locks: setn Condition levers:") -- Condition levers taxi ipc.control(66291, -16384) ipc.sleep(200) ipc.display ("Please wait, going Cold and Dark!n Mute Button: setn RIGHT engine OFF: setn LEFT Engine OFF: setn Generator Switches: setn Battery Switches: setn Avionic Switches: setn Fuel Pump Switches: setn Lights and signs: setn Move Yokes: setn Gust Locks: setn Condition levers: taxi") ipc.sleep(500) ipc.display("cold &amp; dark READY!n Thanks for your patience, Captain!") ipc.sleep(2500) ipc.display ("") elseif questvar ~= "y" then ipc.display("Ok, was just a question, Sir!nHave a nice day...") ipc.sleep(3000) end ipc.display("") The following is from Richard Cooke: (many thanks for this) -------------- I first posted this on the PMDG/Turboprops forum. Guenter suggested I post it here as well - so here goes. Inspired by the excellent work of Guenter Steiner I have written another Lua file for the PMDG J41. See Guenter's post here for instructions on how to use this. (Of course it only works with a registered copy of FSUIPC) <!-- l --><a class="postlink-local" href="http://forums.simflight.com/viewtopic.php?f=54&t=78339">viewtopic.php?f=54&t=78339</a><!-- l --> You need to call this something different to Guenter's file. I called mine J41_Add.lua. It should give you the following commands: 1 Left Fuel Pump 2 Right Fuel Pump 3 Ground Power 4 Warning Panel mute 5 Left Air Cabin Flow* 6 Right Air Cabin Flow* 7 Start Master Knob Left 8 Start Master Knob Right 9 Nav Lights 10 Nav/Tail Flood lights 11Seat Belt Signs 12 No Smoking Signs 13 Left Windshield Anti Ice 14 Right Windshield Anti Ice 15 Left Air Data Anti Ice 16 Right Air Data Anti Ice 17 DC Power Knob up 18 DC Power knob down 19 Prop Synchro Knob 20 CCT Auto Cycle Switch *I programmed the cabin air switches so they only work if they are set to 5 or off so they toggle between these two values. Here is the lua file -- LEFT Fuel Pump SWITCH TOGGLE if ipcPARAM == 1 then LFuel = ipc.readLvar("L:LeftStbyFuelPump") if LFuel == 1 then ipc.writeLvar("L:LeftStbyFuelPump", 0) ipc.control(66587, 8027) elseif LFuel == 0 then ipc.writeLvar("L:LeftStbyFuelPump", 1) ipc.control(66587, 8028) end -- RIGHT Fuel Pump SWITCH TOGGLE elseif ipcPARAM == 2 then RFuel = ipc.readLvar("L:RightStbyFuelPump") if RFuel == 1 then ipc.writeLvar("L:RightStbyFuelPump",0) ipc.control(66587, 8027) elseif RFuel == 0 then ipc.writeLvar("L:RightStbyFuelPump", 1) ipc.control(66587, 8028) end -- GROUND POWER SWITCH TOGGLE elseif ipcPARAM == 3 then GPwr = ipc.readLvar("L:GndPowerSwitch") if GPwr == 1 then ipc.writeLvar("L:GndPowerSwitch", 0) ipc.control(66587, 8028) elseif GPwr == 0 then ipc.writeLvar("L:GndPowerSwitch", 1) ipc.control(66587, 8027) end -- Warning Panel Mute SWITCH TOGGLE elseif ipcPARAM == 4 then WarnMute = ipc.readLvar("L:CapMuted") if WarnMute == 1 then ipc.writeLvar("L:CapMuted", 0) ipc.control(66587, 8027) ipc.writeLvar("L:CapMuteSwitch", 0) ipc.control(66587, 8027) elseif WarnMute == 0 then ipc.writeLvar("L:CapMuted", 1) ipc.writeLvar("L:CapMuteSwitch", 1) ipc.control(66587, 8027) end -- LEFT CABIN FLOW SWITCH TOGGLE elseif ipcPARAM == 5 then LCabFlw = ipc.readLvar("L:CabinFlowControl") if LCabFlw== 6 then ipc.writeLvar("L:CabinFlowControl", 0) ipc.control(66587, 8027) elseif LCabFlw == 0 then ipc.writeLvar("L:CabinFlowControl", 6) ipc.control(66587, 8027) end -- RIGHT CABIN FLOW SWITCH TOGGLE elseif ipcPARAM == 6 then RCabFlw = ipc.readLvar("L:FDeckFlowControl") if RCabFlw== 6 then ipc.writeLvar("L:FDeckFlowControl", 0) ipc.control(66587, 8027) elseif RCabFlw == 0 then ipc.writeLvar("L:FDeckFlowControl", 6) ipc.control(66587, 8027) end -- START MASTER KNOB LEFT GROUND elseif ipcPARAM == 7 then LStart = ipc.readLvar("L:StartMasterKnob") if LStart &gt; 0 then ipc.writeLvar("L:StartMasterKnob",0) ipc.control(66587, 8028) elseif LStart == 0 then end -- START MASTER KNOB RIGHT GROUND elseif ipcPARAM == 8 then LStart = ipc.readLvar("L:StartMasterKnob") if LStart &lt; 2 then ipc.writeLvar("L:StartMasterKnob",2) ipc.control(66587, 8028) elseif LStart == 2 then end -- NAV LIGHTS TOGGLE elseif ipcPARAM == 9 then NavLt = ipc.readLvar("L:NavLightSwitch") if NavLt &lt; 2 then ipc.writeLvar("L:NavLightSwitch", 2) ipc.control(66587, 8027) elseif NavLt == 2 then ipc.writeLvar("L:NavLightSwitch", 1) ipc.control(66587, 8028) end -- NAV LIGHTS/TAIL FLOODS TOGGLE elseif ipcPARAM == 10 then NavLt = ipc.readLvar("L:NavLightSwitch") if NavLt &gt; 0 then ipc.writeLvar("L:NavLightSwitch", 0) ipc.control(66587, 8027) elseif NavLt == 0 then ipc.writeLvar("L:NavLightSwitch", 1) ipc.control(66587, 8028) end -- SEAT BELT switch TOGGLE elseif ipcPARAM == 11 then sblt = ipc.readLvar("L:FastenSeatbeltSigns") if sblt == 1 then ipc.writeLvar("L:FastenSeatbeltSigns", 0) ipc.control(66587, 8028) ipc.control(66587, 74) elseif sblt == 0 then ipc.writeLvar("L:FastenSeatbeltSigns", 1) ipc.control(66587, 8027) ipc.control(66587, 74) end -- NO SMOKING SWITCH TOGGLE elseif ipcPARAM == 12 then nsmk = ipc.readLvar("L:NoSmokingSigns") if nsmk == 1 then ipc.writeLvar("L:NoSmokingSigns", 0) ipc.control(66587, 8028) ipc.control(66587, 74) elseif nsmk == 0 then ipc.writeLvar("L:NoSmokingSigns", 1) ipc.control(66587, 8027) ipc.control(66587, 74) end -- Left Windshield Antiice off elseif ipcPARAM == 13 then LWS = ipc.readLvar("L:LeftWSAntice") if LWS == 2 then ipc.writeLvar("L:LeftWSAntice",1) ipc.control(66587,8027) elseif LWS == 1 then ipc.writeLvar("L:LeftWSAntice", 2) ipc.control(66587,8028) end -- Right Windshield Antiice off elseif ipcPARAM == 14 then RWS = ipc.readLvar("L:RightWSAntice") if RWS == 1 then ipc.writeLvar("L:RightWSAntice",0) ipc.control(66587,8027) elseif RWS == 0 then ipc.writeLvar("L:RightWSAntice", 1) ipc.control(66587,8028) end -- Left Air Data off elseif ipcPARAM == 15 then LAD = ipc.readLvar("L:LeftAirData") if LAD == 1 then ipc.writeLvar("L:LeftAirData",0) ipc.control(66587,8027) elseif LAD == 0 then ipc.writeLvar("L:LeftAirData", 1) ipc.control(66587,8028) end -- Right Air Data off elseif ipcPARAM == 16 then RAD = ipc.readLvar("L:RightAirData") if RAD == 1 then ipc.writeLvar("L:RightAirData",0) ipc.control(66587,8027) elseif RAD == 0 then ipc.writeLvar("L:RightAirData", 1) ipc.control(66587,8028) end -- DC PowersourceKnob UP elseif ipcPARAM == 17 then DCP = ipc.readLvar("L:DCPowerSourceKnob") if DCP &lt; 3 then ipc.writeLvar("L:DCPowerSourceKnob", DCP+1) ipc.control(66587, 8039) elseif DCP == 3 then end -- DC PowersourceKnob DOWN elseif ipcPARAM == 18 then DCP = ipc.readLvar("L:DCPowerSourceKnob") if DCP &gt; 0 then ipc.writeLvar("L:DCPowerSourceKnob", DCP-1) ipc.control(66587, 8039) elseif DCP ==0 then end -- PROP SYNC SWITCH TOGGLE if ipcPARAM == 19 then PSync = ipc.readLvar("L:PropSync") if PSync == 1 then ipc.writeLvar("L:PropSync", 0) ipc.control(66587, 8027) elseif PSync== 0 then ipc.writeLvar("L:PropSync", 1) ipc.control(66587, 8028) end -- CCT Auto Cycle Switch elseif ipcPARAM == 20 then ipc.writeLvar("L:AutoAnticeCycle", 2) ipc.control(66587, 8028) ipc.sleep(200) ipc.writeLvar("L:AutoAnticeCycle", 1) ipc.control(66587, 8027) end I hope this helps you to get more "hardware" control of the brilliant J41. Richard Cooke ------------------------------- 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!
  23. Because of several questions I have decided to write a little tutorial for this people which want to assign their custom key commands via FSUIPC using LVARs or just the logging. In the example screenshots you see the logging and assigning of the PMDG MD11X. Of course the principle for other addons is the same. The hole work is just try and error! What you need: 1) patience 2) registered version of FSUIPC and the latest update 3) Lua Plug-In documents and examples 2 and 3 is available here at Pete's site: look at Updates and other goodies unpack the "Lua Plug-In documents and examples" into your X:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules Folder. Important is the file "log lvars.lua" Start FS, start a flight and load your addon you'd like to dissect Part 1: logging via logging window Open FSUIPC menu and check "Button and Key operations" and "Events". Also check "Send to console window". There will immediately open up a new window. If you close FSUIPC menue now you will see (if you have two monitors :wink: ) in the logging window that several lines appear - depends on the aircraft addon; it could be that many lines appear very fast, but doesn't matter. Now make any action you want . You will have a response in the logging window. In the example above I have pressed the waypoints knob in the MD11. The reaction in the logging window was the event line which I have green highlighted. You can read now the controls number (66587 - you will finde these numbers in the PDF "List of FSX controls"), maybe a parameter number (71128) and the expression for the controls number: ROTOR_BRAKE If there will appear many logging lines very fast you can pause logging by entering FSUIPC menu. You can scroll the logging window to find your command. Now you know the command and maybe a paramter and you can use and assign it via FSUIPC menu: Select the ROTOR_BRAKE and enter the paramter 71128 :!: Note: there don't have to be parameter numbers, this could also be zero. It depends on the developer. With PMDG as example, they control the most functions via ROTOR_BRAKE, simply changing the paramters. As you can see in the picture, I can now press the waypoint button in the PMDG MD11 with my joystick E button 32. But what, if nothing happens in the logging window after you have pressed something? Part 2: Logging via LUA Vars First, assign two keys: Assign one key (or button if you want) to "Lua Log Lvars" (e.g. F5) (Thats the way you call a LUA file) Assign an other key to "Luakillall" to stop the LUA programm. Now go back to FS and press F5: a window opens in FS and like with the logging window there will show up several lines. (don't forget to check "LUA program logging" in FSUIPC menu) The difference is, that you will see now LUA Variables. Now, same way, press some knob or switch in the addon and see what happens. But it will be hard to read that out of the small window, so end the LUA (press the assigned F6). Go to your modules folder and look for this file log lavars.log open it with editor or wordpad and you will see endless lines of codes: the LUA Variables! Now, the search begins... But luckily the developers choose ligical names for the variables. e.g. L:pmdg_hide_yoke=1 means what? yes, rising and lowering the yoke You can't use this LUA variables in the same way like the above controls. One way is simply enter this Vars in a Macro: 1=L:pmdg_hide_yoke=tog Or you make a LUA file wich means you enter this line into an empty wordpad document: ipc.writeLvar("L:pmdg_hide_yoke", 1) name this file "hide yoke.LUA" You can now assign a button or key to it by choosing it from FSUIPC menu under "Lua hide yoke" Note: this only let the yoke move down (1). :!: This should be just a simple example how you can use LUA. For effective working with it you have to read something about LUA programming, starting with it in Pete's FSUIPC forum and the several PDFs provided there. It depends on the developers if and how many LUA they use or what you can find in the logging window (part 1). It could also be that both is used, so for example in the PMDG J41 some knobs are controlled via LUA variables and the sounds for this knobs are made with ROTOR_BRAKE parameters. As I stated above: you need patience and a lot of trial and error :!: Try FSUIPC genious mouse macros before (explained in the manual) The method with logging and LUA is just for the case you can't get any commands out of a addon in other ways. And: do everything at your own risk! :wink: Have fun and may the force (of FSUIPC) with you!! Guenter -------------------- Hi Pete, feel free to correct and complete this little tut...
  24. Thanks for the fast reply!! And its working! Here's the final coding for the MD11X ND Mode cycle 110=117,26,x510066C0,x00040001 ;ND Mode increase start 111=B66C0=0 117,26,66587,71132 112=B66C0=1 117,26,66587,71133 113=B66C0=2 117,26,66587,71134 114=B66C0=3 117,26,66587,71135 115=B66C0=4 117,26,66587,71136 ;ND Mode increase end 116=115,26,x610066C0,x00040001 ;ND Mode decrease start 117=B66C0=0 115,26,66587,71132 118=B66C0=1 115,26,66587,71133 119=B66C0=2 115,26,66587,71134 120=B66C0=3 115,26,66587,71135 121=B66C0=4 115,26,66587,71136 ;ND Mode decrease end Yes, you're right. I also use the MCP Combo and as stated in the other threads here it is just able to send keystrokes via a keymanager. Joybuttons would be much better but what should we do... The Combo is a very good hardware if you consider the price and what you get. Of course GoFlight and all the high priced modules are better and far more realistic in design, but the MCP Combo works very well if you know how to tweak with FSUIPC ;-) Thank you very much Pete and thank you for your outstanding fast service again!!! p.s. I haven't forgot the "database", if you remember. In the next weeks I consider how to make it in the best way: maybe I will write PDFs for each aircraft where the codes and some explanings will be written down. Or I will make ZIPs with the MACRO and LUA Files... I will think about it But anyway it would be important to collect the hole codings together that not any user must start from beginning...
×
×
  • 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.