Archived

This topic is now archived and is closed to further replies.

MELKOR

JS41 Cold and Dark LUA Script

Recommended Posts

Help AVSIM continue to serve you!
Please donate today!

Hi Bill,very, very good... much better than mineI'm glad that the amount of persons using LUA is growing... :( Thanks for the credits!!!With your permission I will replace my CD file in Pete Dowsnons FSUIPC forum ... all credits to you of courseIs this ok?Below is your file a little modified (NAV lights and seat and smoking signs etc added and a little "dialog")Maybe you like this....

---- FSUIPC4 Lua Script: PMDG JS4100 Cold and Dark------ AUTHOR--  William Ruppel--  wcruppel@rogers.com---- VERSION--   1.1---- 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--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)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set")ipc.sleep(200)-- RIGHT Engine OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n 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, 8042)	ipc.control(66587, 16)	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: set\n RIGHT engine OFF: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n 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, 8042)	ipc.control(66587, 15)	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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set")ipc.sleep(200)-- LEFT Generator Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches:")	LGen = ipc.readLvar("L:LeftGenSwitch")	if LGen == 2 then	   ipc.writeLvar("L:LeftGenSwitch", 1)	   ipc.control(66587, 8027)	endipc.sleep(200)-- RIGHT Generator Switch OFF	RGen = ipc.readLvar("L:RightGenSwitch")	if RGen == 2 then	   ipc.writeLvar("L:RightGenSwitch", 1)	   ipc.control(66587, 8027)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set")ipc.sleep(200)-- LEFT Battery Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches:")	LBat = ipc.readLvar("L:LeftBatSwitch")	if LBat == 1 then	   ipc.writeLvar("L:LeftBatSwitch", 0)	   ipc.control(66587, 8028)	endipc.sleep(200)-- Right Battery Switch OFF	RBat = ipc.readLvar("L:RightBatSwitch")	if RBat == 1 then	   ipc.writeLvar("L:RightBatSwitch", 0)	   ipc.control(66587, 8028)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set")ipc.sleep(200)-- Left Avionics Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n 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)	endipc.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)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set")ipc.sleep(200)-- LEFT Fuel Pump Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches:")	LFuel = ipc.readLvar("L:LeftStbyFuelPump")	if LFuel == 1 then	   ipc.writeLvar("L:LeftStbyFuelPump", 0)	   ipc.control(66587, 8027)	endipc.sleep(200)-- RIGHT Fuel Pump Switch OFF	RFuel = ipc.readLvar("L:RightStbyFuelPump")	if RFuel == 1 then	   ipc.writeLvar("L:RightStbyFuelPump", 0)	   ipc.control(66587, 8027)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set")ipc.sleep(200)-- DC Power Source Knob OFF	DCP = ipc.readLvar("L:DCPowerSourceKnob")	if DCP >= 1 then	   ipc.writeLvar("L:DCPowerSourceKnob", 0)	   ipc.control(66587, 8039)	endipc.sleep(200)-- Beacon OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs:")   BCN = logic.And(ipc.readUW(0x0D0C), 0x2)   if BCN ~= 0 then	  ipc.control(66239)	  ipc.control(66587,8027)   endipc.sleep(200)-- NAV Lights OFF		ipc.writeLvar("L:NavLightSwitch", 1)	ipc.control(66587, 8028)ipc.sleep(200)-- 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 offipc.writeLvar("L:FastenSeatbeltSigns", 0)		ipc.control(66587, 8028)	ipc.sleep(10)		ipc.control(66587, 74)ipc.sleep(200)-- no skmoking offipc.writeLvar("L:NoSmokingSigns", 0)		ipc.control(66587, 8028)	ipc.sleep(10)		ipc.control(66587, 74)ipc.sleep(200)-- 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)   endipc.sleep(200)-- Right Windshield Antiice OFF   RWS = ipc.readLvar("L:RightWSAntice")   if RWS == 1 then	  ipc.writeLvar("L:RightWSAntice",0)	  ipc.control(66587,8027)   endipc.sleep(200)-- Left Air Data OFF   LAD = ipc.readLvar("L:LeftAirData")   if LAD == 1 then	  ipc.writeLvar("L:LeftAirData",0)	  ipc.control(66587,8027)   endipc.sleep(200)-- Right Air Data OFF   RAD = ipc.readLvar("L:RightAirData")   if RAD == 1 then	  ipc.writeLvar("L:RightAirData",0)	  ipc.control(66587,8027)   endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set")ipc.sleep(200)-- Move Yokes to Lower Positionipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n 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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set")ipc.sleep(200)ipc.display("cold & dark READY!\n Thanks for your patience, Captain!")ipc.sleep(2500)ipc.display ("")

Share this post


Link to post
Share on other sites

Hi Guenter,

With your permission I will replace my CD file in Pete Dowsnons FSUIPC forum ... all credits to you of courseIs this ok?
Yes, for sure.
Below is your file a little modified (NAV lights and seat and smoking signs etc added and a little "dialog")Maybe you like this....
Very nice additions, I'll be sure to incorporate into version 1.2. Thanks!

Share this post


Link to post
Share on other sites

You guys are great, thanks so much fo all of the hard work you have done. I think it was Richard Cooke that also added the prop sync switch to a previous thread. I could never get that switch to work and yet the rest of the lua did, which was weird? Was wondering if you could add this into the file and possibly the anti-lock brake switch from the pedestal? I think with those I should just about be hands, or should I say mouse free in the virtual pit.Was also wondering if you guys know a way of assigning a lua script comand to an axis? For example.. For the flows I have a self made hardware panel that has a two knobs that control individual axis. What I would like to do is in FSUPIC is to twist the knob until it enters a specific value range of the axis and then activate the lua script. Exactly like you can do with a keypress or assigning a FS control.Thanks,Robert Thomason

Share this post


Link to post
Share on other sites
You guys are great, thanks so much fo all of the hard work you have done. I think it was Richard Cooke that also added the prop sync switch to a previous thread. I could never get that switch to work and yet the rest of the lua did, which was weird? Was wondering if you could add this into the file and possibly the anti-lock brake switch from the pedestal? I think with those I should just about be hands, or should I say mouse free in the virtual pit.
sorry that part I don't understand due to language restrictions :( Maybe you could formulate it in other words....
Was also wondering if you guys know a way of assigning a lua script comand to an axis? For example.. For the flows I have a self made hardware panel that has a two knobs that control individual axis. What I would like to do is in FSUPIC is to twist the knob until it enters a specific value range of the axis and then activate the lua script. Exactly like you can do with a keypress or assigning a FS control.
Thats easy as it is an standard FSUIPC feature, You can assign to an axis several ranges and assign to each range what you want.E.g. you have an axis and from 0 to 25% you assign gear up, from 26 to 50% you assign flaps up and from 51 to 75 percent you assign that weather condition is raining and thunderstorm. thats all possible with FSUIPC. Of course you can assign instead ot thunderstorms any LUA file you want :( Is this you wanted to do?

Share this post


Link to post
Share on other sites

Sorry, a bit wordy indeed...Part 1:Can you include a lua parameter to control the following controls...1. Prop Sync Switch on the overhead 2. The Anti-lock brake switch from the pedestal?Part 2:I know how to assign a control to a specific axis rage via FSUPIC but I have been unable to do it with a lua parameter assignment. I am wondering if it is possible and if anyone else has been able to do it?

Share this post


Link to post
Share on other sites
Part 2:I know how to assign a control to a specific axis rage via FSUPIC but I have been unable to do it with a lua parameter assignment. I am wondering if it is possible and if anyone else has been able to do it?
Nevermind on this, yes it can be done I just had a jittery axis that was causing the problem not the actual programing. Works just like assigning any other FS control to activate once the selected range has been entered (or exited)Thanks again,Robert Thomason

Share this post


Link to post
Share on other sites

I have updated "our" C&D LUA to version 1.1.1 :( changes (to the very first version in this thread - the Avsim file): - added a little dialog with Lua displays (just for fun) - added NAV light switch - added smoking and seat belt sign switch - added Prop sync switch - added gust locks - fixed (hopefully) an error (what I have had already in my first C&D version) that engines don't start at the first time after our C&D LUAsHope, you enjoy it....@Robertwhat do you mean with "anti-lock brake" switch the gust lock or antiskid?I was unfortunately not able to get the codes for the Antiskid... Also look at the J41 commands which are reworked:J41 key commands

---- FSUIPC4 Lua Script: PMDG JS4100 Cold and Dark------ AUTHOR--  William Ruppel--  wcruppel@rogers.com---- VERSION--   1.1.1---- 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 swicth, added gust lock, fixed engine-won't-start-at-first-time-erroripc.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)    endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set")ipc.sleep(200)-- RIGHT Engine OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n 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: set\n RIGHT engine OFF: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n 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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set")ipc.sleep(200)-- LEFT Generator Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches:")    LGen = ipc.readLvar("L:LeftGenSwitch")    if LGen == 2 then       ipc.writeLvar("L:LeftGenSwitch", 1)       ipc.control(66587, 8027)    endipc.sleep(200)-- RIGHT Generator Switch OFF    RGen = ipc.readLvar("L:RightGenSwitch")    if RGen == 2 then       ipc.writeLvar("L:RightGenSwitch", 1)       ipc.control(66587, 8027)    endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set")ipc.sleep(200)-- LEFT Battery Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches:")    LBat = ipc.readLvar("L:LeftBatSwitch")    if LBat == 1 then       ipc.writeLvar("L:LeftBatSwitch", 0)       ipc.control(66587, 8028)    endipc.sleep(200)-- Right Battery Switch OFF    RBat = ipc.readLvar("L:RightBatSwitch")    if RBat == 1 then       ipc.writeLvar("L:RightBatSwitch", 0)       ipc.control(66587, 8028)    endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set")ipc.sleep(200)-- Left Avionics Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n 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)    endipc.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)    endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set")ipc.sleep(100)-- LEFT Fuel Pump Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches:")    LFuel = ipc.readLvar("L:LeftStbyFuelPump")    if LFuel == 1 then       ipc.writeLvar("L:LeftStbyFuelPump", 0)       ipc.control(66587, 8027)    endipc.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)    endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set")ipc.sleep(200)-- DC Power Source Knob OFF    DCP = ipc.readLvar("L:DCPowerSourceKnob")    if DCP >= 1 then       ipc.writeLvar("L:DCPowerSourceKnob", 0)       ipc.control(66587, 8039)    endipc.sleep(200)-- Beacon OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs:")   BCN = logic.And(ipc.readUW(0x0D0C), 0x2)   if BCN ~= 0 then      ipc.control(66239)      ipc.control(66587,8027)   endipc.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 offipc.writeLvar("L:FastenSeatbeltSigns", 0)        ipc.control(66587, 8028)	ipc.sleep(10)        ipc.control(66587, 74)ipc.sleep(200)-- no skmoking offipc.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)   endipc.sleep(200)-- Right Windshield Antiice OFF   RWS = ipc.readLvar("L:RightWSAntice")   if RWS == 1 then      ipc.writeLvar("L:RightWSAntice",0)      ipc.control(66587,8027)   endipc.sleep(200)-- Left Air Data OFF   LAD = ipc.readLvar("L:LeftAirData")   if LAD == 1 then      ipc.writeLvar("L:LeftAirData",0)      ipc.control(66587,8027)   endipc.sleep(150)-- Right Air Data OFF   RAD = ipc.readLvar("L:RightAirData")   if RAD == 1 then      ipc.writeLvar("L:RightAirData",0)      ipc.control(66587,8027)   endipc.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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set")ipc.sleep(200)-- Move Yokes to Lower Positionipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n 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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks:")-- Gust Locksipc.writeLvar("L:GustLocks", 1)ipc.control(66587, 141)ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks: set")ipc.sleep(500)ipc.display("cold & dark READY!\n Thanks for your patience, Captain!")ipc.sleep(2500)ipc.display ("")

Share this post


Link to post
Share on other sites

Hi Guy's.I love the J41 - all bar the C&D thing. I'm not very good with making amendments to files. Can someone please provide a step by step guide to configuring FSUPIC and what to do with these LUA or ULA files, whatever they're called.Thanks a million.(that is, how can I make it C&D)

Share this post


Link to post
Share on other sites

Hello Very good :( but, sorry, I've a problem. I don't understand how assign this script to a keypress in FSUIPC. Anybody can explain this ? :( Thank you very much :( Luc

Share this post


Link to post
Share on other sites

Guenter, Sorry I used the wrong term it is the anti-skid switch I had hoped you could find but I can just click it, too easy.@Luc, I will be happy to walk you through assigning a lua paramater or in this case a the lua script for the C&D conditions to a button but, it would actually be easier if you just hit the search button inside this forum and search for Guenter's previous posts on the topic as he has coverd the "how to" portion of this in the past with nice colored screenshots and highlighted fields from within FSUPIC which should get you configured. Just use his user name in the search box and you'll see all of his previous posts which also include some great repaints!!!

Share this post


Link to post
Share on other sites
I have updated "our" C&D LUA to version 1.1.1 :( changes (to the very first version in this thread - the Avsim file):- added a little dialog with Lua displays (just for fun)- added NAV light switch- added smoking and seat belt sign switch- added Prop sync switch- added gust locks- fixed (hopefully) an error (what I have had already in my first C&D version) that engines don't start at the first time after our C&D LUAsGot it all working now. Have a nice C&D flight deck. Thanks.Another problem now:Once engines are started, torque will not advance past 25 ish %Start locks are removed and, as far i can tell, everything on the checklists have been done.Anyone have any idea what i've missed?Hope, you enjoy it....@Robertwhat do you mean with "anti-lock brake" switch the gust lock or antiskid?I was unfortunately not able to get the codes for the Antiskid... Also look at the J41 commands which are reworked:J41 key commands
---- FSUIPC4 Lua Script: PMDG JS4100 Cold and Dark------ AUTHOR-- William Ruppel-- wcruppel@rogers.com---- VERSION-- 1.1.1---- 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 swicth, added gust lock, fixed engine-won't-start-at-first-time-erroripc.display ("Please wait, going Cold and Dark!")ipc.sleep(1000)ipc.display ("Please wait, going Cold and Dark!\n Mute Button:")-- MUTE button ONif ipc.readLvar("L:CapMuted") == 0 thenipc.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)endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set")ipc.sleep(200)-- RIGHT Engine OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF:")-- Open the stop switch guardRSG = ipc.readLvar("L:RightEngStopSwitchGuard")if RSG == 0 thenipc.writeLvar("L:RightEngStopSwitchGuard", 1)ipc.control(66587, 8010)end-- Press the stop switchipc.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 guardipc.sleep(200)ipc.writeLvar ("L:RightEngStopSwitchGuard", 0)ipc.control (66587, 8010)-- Move the throttle to full reverse for start latchipc.control (65972)for i = 1, 50 doipc.control (65971)endipc.sleep(5000)ipc.control (65972)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF:")-- LEFT Engine OFF-- Open the stop switch guardLSG = ipc.readLvar("L:LeftEngStopSwitchGuard")if LSG == 0 thenipc.writeLvar("L:LeftEngStopSwitchGuard", 1)ipc.control(66587, 8010)end-- Press the stop switchipc.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 guardipc.sleep(200)ipc.writeLvar ("L:LeftEngStopSwitchGuard", 0)ipc.control (66587, 8010)-- Move the throttle to full reverse for start latchipc.control (65967)for i = 1, 50 doipc.control (65966)endipc.sleep(5000)ipc.control (65967)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set")ipc.sleep(200)-- LEFT Generator Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches:")LGen = ipc.readLvar("L:LeftGenSwitch")if LGen == 2 thenipc.writeLvar("L:LeftGenSwitch", 1)ipc.control(66587, 8027)endipc.sleep(200)-- RIGHT Generator Switch OFFRGen = ipc.readLvar("L:RightGenSwitch")if RGen == 2 thenipc.writeLvar("L:RightGenSwitch", 1)ipc.control(66587, 8027)endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set")ipc.sleep(200)-- LEFT Battery Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches:")LBat = ipc.readLvar("L:LeftBatSwitch")if LBat == 1 thenipc.writeLvar("L:LeftBatSwitch", 0)ipc.control(66587, 8028)endipc.sleep(200)-- Right Battery Switch OFFRBat = ipc.readLvar("L:RightBatSwitch")if RBat == 1 thenipc.writeLvar("L:RightBatSwitch", 0)ipc.control(66587, 8028)endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set")ipc.sleep(200)-- Left Avionics Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches:")LAvM = ipc.readLvar("L:LeftAvionicsMaster")if LAvM == 1 thenipc.writeLvar("L:LeftAvionicsMasterGuard", 0)ipc.control(66587, 8026)ipc.sleep(500)ipc.writeLvar("L:LeftAvionicsMaster", 0)ipc.control(66587, 8027)endipc.sleep(200)-- RIGHT Avionics Switch OFFRAvM = ipc.readLvar("L:RightAvionicsMaster")if RAvM == 1 thenipc.writeLvar("L:RightAvionicsMasterGuard", 0)ipc.control(66587, 8026)ipc.sleep(500)ipc.writeLvar("L:RightAvionicsMaster", 0)ipc.control(66587, 8027)endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set")ipc.sleep(100)-- LEFT Fuel Pump Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches:")LFuel = ipc.readLvar("L:LeftStbyFuelPump")if LFuel == 1 thenipc.writeLvar("L:LeftStbyFuelPump", 0)ipc.control(66587, 8027)endipc.sleep(250)-- RIGHT Fuel Pump Switch OFFRFuel = ipc.readLvar("L:RightStbyFuelPump")if RFuel == 1 thenipc.writeLvar("L:RightStbyFuelPump", 0)ipc.control(66587, 8027)endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set")ipc.sleep(200)-- DC Power Source Knob OFFDCP = ipc.readLvar("L:DCPowerSourceKnob")if DCP >= 1 thenipc.writeLvar("L:DCPowerSourceKnob", 0)ipc.control(66587, 8039)endipc.sleep(200)-- Beacon OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs:")BCN = logic.And(ipc.readUW(0x0D0C), 0x2)if BCN ~= 0 thenipc.control(66239)ipc.control(66587,8027)endipc.sleep(200)-- NAV Lights OFFipc.writeLvar("L:NavLightSwitch", 1)ipc.control(66587, 8028)ipc.sleep(300)-- Console lights OFFipc.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 offipc.writeLvar("L:FastenSeatbeltSigns", 0)ipc.control(66587, 8028)ipc.sleep(10)ipc.control(66587, 74)ipc.sleep(200)-- no skmoking offipc.writeLvar("L:NoSmokingSigns", 0)ipc.control(66587, 8028)ipc.sleep(10)ipc.control(66587, 74)ipc.sleep(250)-- Left Windshield Antiice OFFLWS = ipc.readLvar("L:LeftWSAntice")if (LWS == 2 or LWS == 0) thenipc.writeLvar("L:LeftWSAntice",1)ipc.control(66587,8027)endipc.sleep(200)-- Right Windshield Antiice OFFRWS = ipc.readLvar("L:RightWSAntice")if RWS == 1 thenipc.writeLvar("L:RightWSAntice",0)ipc.control(66587,8027)endipc.sleep(200)-- Left Air Data OFFLAD = ipc.readLvar("L:LeftAirData")if LAD == 1 thenipc.writeLvar("L:LeftAirData",0)ipc.control(66587,8027)endipc.sleep(150)-- Right Air Data OFFRAD = ipc.readLvar("L:RightAirData")if RAD == 1 thenipc.writeLvar("L:RightAirData",0)ipc.control(66587,8027)endipc.sleep(200)-- prop sync switch OFFipc.writeLvar("L:PropSync", 0)ipc.control(66587, 8027)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set")ipc.sleep(200)-- Move Yokes to Lower Positionipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n 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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks:")-- Gust Locksipc.writeLvar("L:GustLocks", 1)ipc.control(66587, 141)ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks: set")ipc.sleep(500)ipc.display("cold & dark READY!\n Thanks for your patience, Captain!")ipc.sleep(2500)ipc.display ("")

Share this post


Link to post
Share on other sites

I have updated our cold&dark LUA script to version 1.2I have added a LUA question dialog which is asking you when loading the aircraft, if you want to go cold and dark...

---- 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 dialogipc.sleep(100)ipc.display("Cold&Dark Sequence initiated...")ipc.sleep(3000)	questvar = ipc.ask("Captain, do you want to go cold&dark? (y / n)")	if questvar == "y" thenipc.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)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set")ipc.sleep(200)-- RIGHT Engine OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n 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: set\n RIGHT engine OFF: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n 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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set")ipc.sleep(200)-- LEFT Generator Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches:")	LGen = ipc.readLvar("L:LeftGenSwitch")	if LGen == 2 then	   ipc.writeLvar("L:LeftGenSwitch", 1)	   ipc.control(66587, 8027)	endipc.sleep(200)-- RIGHT Generator Switch OFF	RGen = ipc.readLvar("L:RightGenSwitch")	if RGen == 2 then	   ipc.writeLvar("L:RightGenSwitch", 1)	   ipc.control(66587, 8027)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set")ipc.sleep(200)-- LEFT Battery Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches:")	LBat = ipc.readLvar("L:LeftBatSwitch")	if LBat == 1 then	   ipc.writeLvar("L:LeftBatSwitch", 0)	   ipc.control(66587, 8028)	endipc.sleep(200)-- Right Battery Switch OFF	RBat = ipc.readLvar("L:RightBatSwitch")	if RBat == 1 then	   ipc.writeLvar("L:RightBatSwitch", 0)	   ipc.control(66587, 8028)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set")ipc.sleep(200)-- Left Avionics Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n 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)	endipc.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)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set")ipc.sleep(100)-- LEFT Fuel Pump Switch OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches:")	LFuel = ipc.readLvar("L:LeftStbyFuelPump")	if LFuel == 1 then	   ipc.writeLvar("L:LeftStbyFuelPump", 0)	   ipc.control(66587, 8027)	endipc.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)	endipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set")ipc.sleep(200)-- DC Power Source Knob OFF	DCP = ipc.readLvar("L:DCPowerSourceKnob")	if DCP >= 1 then	   ipc.writeLvar("L:DCPowerSourceKnob", 0)	   ipc.control(66587, 8039)	endipc.sleep(200)-- Beacon OFFipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs:")   BCN = logic.And(ipc.readUW(0x0D0C), 0x2)   if BCN ~= 0 then	  ipc.control(66239)	  ipc.control(66587,8027)   endipc.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 offipc.writeLvar("L:FastenSeatbeltSigns", 0)		ipc.control(66587, 8028)	ipc.sleep(10)		ipc.control(66587, 74)ipc.sleep(200)-- no skmoking offipc.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)   endipc.sleep(200)-- Right Windshield Antiice OFF   RWS = ipc.readLvar("L:RightWSAntice")   if RWS == 1 then	  ipc.writeLvar("L:RightWSAntice",0)	  ipc.control(66587,8027)   endipc.sleep(200)-- Left Air Data OFF   LAD = ipc.readLvar("L:LeftAirData")   if LAD == 1 then	  ipc.writeLvar("L:LeftAirData",0)	  ipc.control(66587,8027)   endipc.sleep(150)-- Right Air Data OFF   RAD = ipc.readLvar("L:RightAirData")   if RAD == 1 then	  ipc.writeLvar("L:RightAirData",0)	  ipc.control(66587,8027)   endipc.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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set")ipc.sleep(200)-- Move Yokes to Lower Positionipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n 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: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks:")-- Gust Locksipc.writeLvar("L:GustLocks", 1)ipc.control(66587, 141)ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks: set")ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks: set\n Condition levers:")-- Condition levers taxiipc.control(66291, -16384)ipc.sleep(200)ipc.display ("Please wait, going Cold and Dark!\n Mute Button: set\n RIGHT engine OFF: set\n LEFT Engine OFF: set\n Generator Switches: set\n Battery Switches: set\n Avionic Switches: set\n Fuel Pump Switches: set\n Lights and signs: set\n Move Yokes: set\n Gust Locks: set\n Condition levers: taxi")ipc.sleep(500)ipc.display("cold & 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)	endipc.display("")

Have fun!

Share this post


Link to post
Share on other sites

I have upgraded my computer to Windows 7 64 bit from Windows XP Pro. The Cold & Dark LUA script worked great before the upgrade. However, now after placing the script in the Modules folder and changing the FSUIPC.INI file it is not seen (or displayed) in the pull down menu of FSUIPC4. FSUIPC works fine with other aircraft when assigning keys. I have installed FSX on a separate hard drive (F:) and place the FSUIPC.INI file in: F:\FSX\modules. The macro key assignments that I have assigned other aircraft function and they are in the same file/folder. I have a registered version of FSUIPC. What am I missing?Thanks,Ron Musick

Share this post


Link to post
Share on other sites

I'm a bit late, but if you still haven't figured out the anti skid var it's "AntiSkid"ipc.writeLvar("AntiSkid", 0); -- offipc.writeLvar("AntiSkid", 1); --on

Share this post


Link to post
Share on other sites

I was using the older version of FSUIPC. Once I updated it your LUA worked great.Thanks.Ron Musick

Share this post


Link to post
Share on other sites

I just started to use your LUA script the other day as well. Thank you so much Guenter and the others. It works perfectly.

Share this post


Link to post
Share on other sites

Oh, wasn't here some time...many thanks all of you...for the AntiSkid, for the thanks!Will implement the AntiSkid ASAP!

Share this post


Link to post
Share on other sites

The engines won't start the first time... is that just my problem?Where to get version 1.2?

Share this post


Link to post
Share on other sites