Jump to content
Sign in to follow this  
guenseli

Next Round of J41 Key Commands

Recommended Posts

Hello,with the help and patience of Pete Dowson I managed the next round of some helpful commands for the J41:It's different now to my last one, because the logic behind these buttons is an other.All you have to do is copiing the code below into an empty wordpad/editor file and name this J41.lua ... the name doesn't matter, jus the LUA is important.Of course you should remember your choosen name ;-)Save this file in your FS MODULES FolderNow got to the FSUIPC menu and look into the pull down menu for all the FSX commands.Here you find the entry Lua J41 and choose it. (the red field)There's a parameter field nearby (the green field)fr6tcbg5.jpgNow, the number for the parameter corresponds to a function in this list:1=Left battery switch toggle2=right battery switch toggle 3=left avionics switch toggle4=right avionics switch toggle5=left Generator switch toggle6=right Generator switch toggle7=left Bearing Circle knob minus8=right Bearing Circle knob plus9=left Bearing Diamond knob plus10=right Bearing Diamond knob minus11=CCT Auto Cycle SwitchSo, in the picture above you can see, that Button 4 is assigned to parameter 11 which means the CCT CycleThe Bearing Circle knob and the Bearing Diamond knob are the two knobs shown in this picture.7xpu7rgh.jpgAnd only for the (left) pilots seat...All switches and knobs have sounds of course and are fully animated if necessary (e.g. the Avionics Switch will first be unlocked, then pressed)The list is of course not complete.I will add some new commands if time and fun will allow it.I will update then the code below and all you have to do is copy the code into your J41.lua file and overwrite the old one.Your commands will not be changed or overwritten, I just add the new commands.Use the latest registered version of FSUIPC, no guarantees for older versions.And as always, do anything at your own risk, don't blame PMDG or me...Have fun!

-- LEFT Battery switch TOGGLEif ipcPARAM == 1 then   	lbat = ipc.readLvar("L:LeftBatSwitch")	if lbat == 1 then   	ipc.writeLvar("L:LeftBatSwitch", 0)	ipc.control(66587, 8028)	elseif lbat == 0 then   	ipc.writeLvar("L:LeftBatSwitch", 1)	end-- RIGHT Battery switch TOGGLEelseif ipcPARAM == 2 then	rbat = ipc.readLvar("L:RightBatSwitch")	if rbat == 1 then   	ipc.writeLvar("L:RightBatSwitch", 0)	ipc.control(66587, 8028)	elseif rbat == 0 then   	ipc.writeLvar("L:RightBatSwitch", 1)	end-- Left AVIONICS SWITCh TOGGLEelseif ipcPARAM == 3 then	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)	elseif LAvM == 0 then   	ipc.writeLvar("L:LeftAvionicsMaster", 1)	ipc.control(66587, 8027)	ipc.sleep(500)   	ipc.writeLvar("L:LeftAvionicsMasterGuard", 1)	ipc.control(66587, 8026)	end-- RIGHT AVIONICS SWITCh TOGGLEelseif ipcPARAM == 4 then	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)	elseif RAvM == 0 then   	ipc.writeLvar("L:RightAvionicsMaster", 1)	ipc.control(66587, 8027)	ipc.sleep(500)   	ipc.writeLvar("L:RightAvionicsMasterGuard", 1)	ipc.control(66587, 8026)	end-- LEFT Generator SWITCH TOGGLEelseif ipcPARAM == 5 then	LGen = ipc.readLvar("L:LeftGenSwitch")	if LGen == 1 then   	ipc.writeLvar("L:LeftGenSwitch", 2)	ipc.control(66587, 8027)	elseif LGen == 2 then   	ipc.writeLvar("L:LeftGenSwitch", 1)	ipc.control(66587, 8027)	end-- RIGHT Generator SWITCH TOGGLEelseif ipcPARAM == 6 then	RGen = ipc.readLvar("L:RightGenSwitch")	if RGen == 1 then   	ipc.writeLvar("L:RightGenSwitch", 2)	ipc.control(66587, 8027)	elseif RGen == 2 then   	ipc.writeLvar("L:RightGenSwitch", 1)	ipc.control(66587, 8027)	end-- LEFT Bearing CIRCLE Knob Minuselseif ipcPARAM == 7 then	i = ipc.readLvar("L:LeftBearingCircleKnob")		if i < 3 then	ipc.writeLvar("L:LeftBearingCircleKnob", i+1)	ipc.control(66587, 8031)	elseif i == 3 then	ipc.writeLvar("L:LeftBearingCircleKnob", 3)	end	-- LEFT Bearing CIRLCE Knob Pluselseif ipcPARAM == 8 then	i = ipc.readLvar("L:LeftBearingCircleKnob")		if i > 0 then	ipc.writeLvar("L:LeftBearingCircleKnob", i-1)	ipc.control(66587, 8031)	elseif i == 0 then	ipc.writeLvar("L:LeftBearingCircleKnob", 0)	end	-- LEFT Bearing DIAMOND Knob Pluselseif ipcPARAM == 9 then	i = ipc.readLvar("L:LeftBearingDiamondKnob")		if i < 3 then	ipc.writeLvar("L:LeftBearingDiamondKnob", i+1)	ipc.control(66587, 8031)	elseif i == 3 then	ipc.writeLvar("L:LeftBearingDiamondKnob", 3)	end	-- LEFT Bearing DIAMOND Knob Minuselseif ipcPARAM == 10 then	i = ipc.readLvar("L:LeftBearingDiamondKnob")		if i > 0 then	ipc.writeLvar("L:LeftBearingDiamondKnob", i-1)	ipc.control(66587, 8031)	elseif i == 0 then	ipc.writeLvar("L:LeftBearingDiamondKnob", 0)	end-- CCT Auto Cycle Switchelseif ipcPARAM == 11 then	ipc.writeLvar("L:AutoAnticeCycle", 2)	ipc.control(66587, 8028)	ipc.sleep(200)	ipc.writeLvar("L:AutoAnticeCycle", 1)	ipc.control(66587, 8027)end

oh, and here's my name, before this thread gots deleted :( guenter steiner


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post

Excellent work there, look forward to you adding more commands. Will hopefully be able to make use of it to output it to my hardware.Have you created anything similar to this for the 747 that maps to FSPUIC as offsets the same?RegardsJames

Share this post


Link to post
Have you created anything similar to this for the 747 that maps to FSPUIC as offsets the same?
Unfortunately not, but the original FSUIPC download provides a 747 Overheadpanel Macro.Maybe this helps a little...

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post

Guenter,Thanks so much for your work; unfortunatly I can't seem to get this set to work for me? I am able to pull down the LuaJ41 window from within FSUIPC and set the parameter field but nothing occurs when I re enter the sim and push the said button. I am wondering if maybe we have a different version of FSUIPC mine is version 4.50 dated Feb 2009 I thought this was the latest version? I say this because looking at your instructions You have a Profile Specific window whereas mine says Aircraft specific?It's either that or I am not coping your document verbatim? I can't seem to cut and paste your code straight into notepad (it runs out horizontal so the spacing is not correct) I have been pasting your work into wordpad first then back into notepad which gets the spacing much closer and and then manually adjust it to match your work.Thanks in Advance, I am checking this forum very often largely in part to the effort your making here for all of us. I hate it when I forum has a million "sticky topics" at the top of it but your work; especialy as it progresses should be considered for such...IMOThanks Again,Robert Thomason


RE Thomason Jr.

 

 

Share this post


Link to post

HiYou can get the latest version of FSUIPC (V4.544) by going to Pete Dowson

Share this post


Link to post

Many thanks, Jim!thanks for the explanation...indeed I forgot that the interim updates are necessary to get this run.I'm very sorry for this fault :( Robert, I hope you can get this to work now! Sorry!The next problem is, that I'm unable to edit my threads here...Now I have to post "new versions" of the commands here somewhere in the thread. Much more comfortable would be to edit in directly into the first thread... does anybody know how I can edit?guenter


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post

Guenther,thanks for providing us with these valuable macros. I can imagine the amount of work you put into this.Now it doubles the fun being able to fly this plane with my MCP-Combo instead of fiddle about with the mouse.Best regardsAndreas Thiele

Share this post


Link to post

Updated to V4.544 this morning but still can't seem to get this round of controls to work? Jim, I am assuming they are working for you using this version and if so I will go back and double check my copy and pasting and go through the steps once more. Not sure what I am doing wrong but I must be missing something along the way ;)Thanks,Robert


RE Thomason Jr.

 

 

Share this post


Link to post

Hi RobertThe commands were working, but unfortunately at present the J41 has a problem that I

Share this post


Link to post

Hi robert,as you have downloaded the newest version of FSUIPC:1) have you put the FSUIPC4.dll and let the old file overwrite? (in the modules folder)2) As FSX has started, has there been a question to trust and allow the FSUIPC4.dll?otherwise the new dll isn't activ...an other idea: do you press "confirm" at the keys page in FSUIPC?Otherwise the settings wouldn't be stored!


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post

OK, I got it now...It was a cut and paste error on my part (I didn't get the lines of code below the "CCT Auto Cycle Switch")I figured as much, but I am glad I got it sorted now not only so I can use the controls you have provided thus far but whatever your able to come up with next.Thank You Again for your efforts!Robert


RE Thomason Jr.

 

 

Share this post


Link to post

Just a new function...The analog VOR/ADF 1/2 switches work now.As always animated and with sound.As always just for the pilots side....Just copy the complete code into you existing J41.LUA and overwrite everything in there.I just want you to do this to be sure that you don't insert parts of the code at the false place.Your previous settings don't changeWhats new?Parameter 12: Toggle between ADF and VOR 1Parameter 13:Toggle between ADF and VOR 2Parameter 14:Switch to ADF 1Parameter 15:Switch to VOR1Parameter 16:Switch to ADF 2Parameter 17:Switch to VOR 2If you are an thoughtful reader you will have noticed that it makes sense, that you just use toggle OR switch...As I have four buttons for ADF/VOR I use the second method. The toggle is just a service for these, who just want to use two buttons for this function!have fun!

-- LEFT Battery switch TOGGLEif ipcPARAM == 1 then   	lbat = ipc.readLvar("L:LeftBatSwitch")	if lbat == 1 then   	ipc.writeLvar("L:LeftBatSwitch", 0)	ipc.control(66587, 8028)	elseif lbat == 0 then   	ipc.writeLvar("L:LeftBatSwitch", 1)	end-- RIGHT Battery switch TOGGLEelseif ipcPARAM == 2 then	rbat = ipc.readLvar("L:RightBatSwitch")	if rbat == 1 then   	ipc.writeLvar("L:RightBatSwitch", 0)	ipc.control(66587, 8028)	elseif rbat == 0 then   	ipc.writeLvar("L:RightBatSwitch", 1)	end-- Left AVIONICS SWITCh TOGGLEelseif ipcPARAM == 3 then	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)	elseif LAvM == 0 then   	ipc.writeLvar("L:LeftAvionicsMaster", 1)	ipc.control(66587, 8027)	ipc.sleep(500)   	ipc.writeLvar("L:LeftAvionicsMasterGuard", 1)	ipc.control(66587, 8026)	end-- RIGHT AVIONICS SWITCh TOGGLEelseif ipcPARAM == 4 then	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)	elseif RAvM == 0 then   	ipc.writeLvar("L:RightAvionicsMaster", 1)	ipc.control(66587, 8027)	ipc.sleep(500)   	ipc.writeLvar("L:RightAvionicsMasterGuard", 1)	ipc.control(66587, 8026)	end-- LEFT Generator SWITCH TOGGLEelseif ipcPARAM == 5 then	LGen = ipc.readLvar("L:LeftGenSwitch")	if LGen == 1 then   	ipc.writeLvar("L:LeftGenSwitch", 2)	ipc.control(66587, 8027)	elseif LGen == 2 then   	ipc.writeLvar("L:LeftGenSwitch", 1)	ipc.control(66587, 8027)	end-- RIGHT Generator SWITCH TOGGLEelseif ipcPARAM == 6 then	RGen = ipc.readLvar("L:RightGenSwitch")	if RGen == 1 then   	ipc.writeLvar("L:RightGenSwitch", 2)	ipc.control(66587, 8027)	elseif RGen == 2 then   	ipc.writeLvar("L:RightGenSwitch", 1)	ipc.control(66587, 8027)	end-- LEFT Bearing CIRCLE Knob Minuselseif ipcPARAM == 7 then	i = ipc.readLvar("L:LeftBearingCircleKnob")		if i < 3 then	ipc.writeLvar("L:LeftBearingCircleKnob", i+1)	ipc.control(66587, 8031)	elseif i == 3 then	ipc.writeLvar("L:LeftBearingCircleKnob", 3)	end	-- LEFT Bearing CIRLCE Knob Pluselseif ipcPARAM == 8 then	i = ipc.readLvar("L:LeftBearingCircleKnob")		if i > 0 then	ipc.writeLvar("L:LeftBearingCircleKnob", i-1)	ipc.control(66587, 8031)	elseif i == 0 then	ipc.writeLvar("L:LeftBearingCircleKnob", 0)	end	-- LEFT Bearing DIAMOND Knob Pluselseif ipcPARAM == 9 then	i = ipc.readLvar("L:LeftBearingDiamondKnob")		if i < 3 then	ipc.writeLvar("L:LeftBearingDiamondKnob", i+1)	ipc.control(66587, 8031)	elseif i == 3 then	ipc.writeLvar("L:LeftBearingDiamondKnob", 3)	end	-- LEFT Bearing DIAMOND Knob Minuselseif ipcPARAM == 10 then	i = ipc.readLvar("L:LeftBearingDiamondKnob")		if i > 0 then	ipc.writeLvar("L:LeftBearingDiamondKnob", i-1)	ipc.control(66587, 8031)	elseif i == 0 then	ipc.writeLvar("L:LeftBearingDiamondKnob", 0)	end-- CCT Auto Cycle Switchelseif ipcPARAM == 11 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 Toggleif ipcPARAM == 12 then   	ADFL = ipc.readLvar("L:LeftAdfVorSwitch")	if ADFL == 1 then   	ipc.writeLvar("L:LeftAdfVorSwitch", 0)	ipc.control(66587, 8024)	elseif ADFL == 0 then   	ipc.writeLvar("L:LeftAdfVorSwitch", 1)	ipc.control(66587, 8024)	end-- Pilot analog ADFVOR 2 Toggleelseif ipcPARAM == 13 then	ADF2 = ipc.readLvar("L:LeftVorAdfSwitch")	if ADF2 == 1 then   	ipc.writeLvar("L:LeftVorAdfSwitch", 0)	ipc.control(66587, 8024)	elseif ADF2 == 0 then   	ipc.writeLvar("L:LeftVorAdfSwitch", 1)	ipc.control(66587, 8024)	end	-- Pilot ADF1elseif ipcPARAM == 14 then	ADF2 = ipc.readLvar("L:LeftAdfVorSwitch")	if ADF2 == 1 then   	ipc.writeLvar("L:LeftAdfVorSwitch", 0)	ipc.control(66587, 8024)	elseif ADF2 == 0 then	end-- Pilot VOR1elseif ipcPARAM == 15 then	ADF2 = ipc.readLvar("L:LeftAdfVorSwitch")	if ADF2 == 0 then   	ipc.writeLvar("L:LeftAdfVorSwitch", 1)	ipc.control(66587, 8024)	elseif ADF2 == 1 then	end	-- Pilot ADF2elseif ipcPARAM == 16 then	ADF2 = ipc.readLvar("L:LeftVorAdfSwitch")	if ADF2 == 1 then   	ipc.writeLvar("L:LeftVorAdfSwitch", 0)	ipc.control(66587, 8024)	elseif ADF2 == 0 then	end-- Pilot VOR2elseif ipcPARAM == 17 then	ADF2 = ipc.readLvar("L:LeftVorAdfSwitch")	if ADF2 == 0 then   	ipc.writeLvar("L:LeftVorAdfSwitch", 1)	ipc.control(66587, 8024)	elseif ADF2 == 1 then	endend

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post

Thanks for the new commands!I really appreciate your work!Thanks Again,Robert


RE Thomason Jr.

 

 

Share this post


Link to post

I have reworked my J41 commands completely, tried(!) to make a smarter coding and added several switchesThat means, if you want to use this reworked script, that you have to reassign some parameters. Check them carefully!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")here is the list of commands-- 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 switchand here is the code:

-- 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 TOGGLEif 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 TOGGLEif 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 onif 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 offif 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 TOGGLEif 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 TOGGLEif 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 onif 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 offif 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 TOGGLEif 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 TOGGLEif 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 onif ipcPARAM == 11 then    ipc.writeLvar("L:LeftGenSwitch", 2)	ipc.control(66587, 8027)end-- left Generator SWITCH offif ipcPARAM == 12 then    ipc.writeLvar("L:LeftGenSwitch", 1)	ipc.control(66587, 8027)end-- right Generator SWITCH onif ipcPARAM == 13 then    ipc.writeLvar("L:RightGenSwitch", 2)	ipc.control(66587, 8027)end-- right Generator SWITCH offif ipcPARAM == 14 then    ipc.writeLvar("L:RightGenSwitch", 1)	ipc.control(66587, 8027)end-- LEFT Bearing CIRCLE Knob Minusif ipcPARAM == 15 then	i = ipc.readLvar("L:LeftBearingCircleKnob")		if i < 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)	endend	-- LEFT Bearing CIRLCE Knob Plusif ipcPARAM == 16 then	i = ipc.readLvar("L:LeftBearingCircleKnob")		if i > 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)	endend	-- LEFT Bearing DIAMOND Knob Plusif ipcPARAM == 17 then	i = ipc.readLvar("L:LeftBearingDiamondKnob")		if i < 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)	endend	-- LEFT Bearing DIAMOND Knob Minusif ipcPARAM == 18 then	i = ipc.readLvar("L:LeftBearingDiamondKnob")		if i > 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)	endend-- CCT Auto Cycle Switchif 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 Toggleif 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 Toggleif 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 VOR1if ipcPARAM == 23 then   	ipc.writeLvar("L:LeftAdfVorSwitch", 1)	ipc.control(66587, 8024)end	-- Pilot ADF2if ipcPARAM == 24 then   	ipc.writeLvar("L:LeftVorAdfSwitch", 0)	ipc.control(66587, 8024)end-- Pilot VOR2if ipcPARAM == 25 then   	ipc.writeLvar("L:LeftVorAdfSwitch", 1)	ipc.control(66587, 8024)end-- Left fuel Pump onif ipcPARAM == 26 then   	ipc.writeLvar("L:LeftStbyFuelPump", 1)	ipc.control(66587, 8028)end-- Left fuel Pump offif ipcPARAM == 27 then   	ipc.writeLvar("L:LeftStbyFuelPump", 0)	ipc.control(66587, 8027)end-- right fuel Pump onif ipcPARAM == 28 then   	ipc.writeLvar("L:RightStbyFuelPump", 1)	ipc.control(66587, 8028)end-- right fuel Pump offif 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 toggleif 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 ONif ipcPARAM == 32 then		ipc.writeLvar("L:NavLightSwitch", 2)	ipc.control(66587, 8028)end-- NAV Lights OFFif ipcPARAM == 33 then		ipc.writeLvar("L:NavLightSwitch", 1)	ipc.control(66587, 8028)end-- Console lights ONif 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 OFFif 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 ONif ipcPARAM == 36 then	ipc.control(66587, 8021)		ipc.writeLvar("L:TocwTestSwitch", 1)end-- TOCW Testswitch OFFif ipcPARAM == 37 then	ipc.control(66587, 8021)		ipc.writeLvar("L:TocwTestSwitch", 0)end-- Seatbelt onif ipcPARAM == 38 thenipc.writeLvar("L:FastenSeatbeltSigns", 1)        ipc.control(66587, 8028)	ipc.sleep(10)        ipc.control(66587, 74)end-- Seatbelt offif ipcPARAM == 39 thenipc.writeLvar("L:FastenSeatbeltSigns", 0)        ipc.control(66587, 8028)	ipc.sleep(10)        ipc.control(66587, 74)end-- no smoking onif ipcPARAM == 40 thenipc.writeLvar("L:NoSmokingSigns", 1)        ipc.control(66587, 8028)	ipc.sleep(10)        ipc.control(66587, 74)end-- no skmoking offif ipcPARAM == 41 thenipc.writeLvar("L:NoSmokingSigns", 0)        ipc.control(66587, 8028)	ipc.sleep(10)        ipc.control(66587, 74)end-- toggle flood lightif 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 enginesif 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 soundipc.display("feathering left engine...")	ipc.sleep(8000) -- waiting for featheringipc.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)	endipc.display("")-- Feathering and starting right engine     if ipc.readLvar("L:StartMasterKnob") == 2  then    ipc.control(66587, 1421)    ipc.control(66587, 8029) -- knob soundipc.display("feathering right engine...")	ipc.sleep(8000) -- waiting for featheringipc.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)	endipc.display("")end---------------------------------------------------------------- toggle gust locksif 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 switchif 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


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post

Guenter,Is there any way you can upload the script as a notpad or word document? or send it to me direct as an attachment in a private message?I have tried to copy and paste your code from this thread into notepad but the spacing gets thrown way off. I have tried to edit it by hand but it's hard because if it's off it wont work and I cant seem to find my mistake this round.Thanks,Robert


RE Thomason Jr.

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...