0% found this document useful (0 votes)
95 views8 pages

IXEG Lua

The document defines variables and assigns buttons to control various systems in the aircraft simulation such as the autopilot, fuel system, and EFIS map settings. Buttons are assigned to change the map range and mode, autopilot altitude, heading and speed, and toggle switches for the fuel system. It also contains code to read indicator lights and write their states to an external file.

Uploaded by

tomrach
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views8 pages

IXEG Lua

The document defines variables and assigns buttons to control various systems in the aircraft simulation such as the autopilot, fuel system, and EFIS map settings. Buttons are assigned to change the map range and mode, autopilot altitude, heading and speed, and toggle switches for the fuel system. It also contains code to read indicator lights and write their states to an external file.

Uploaded by

tomrach
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

local numer = 0

local PrzyciskBlokAlarm = 0
local PrzyciskBlokAdfMorse= 0
local CzyHDG = 0
local CzyADF1Morse = 0
local CzyMic1 = 0
local CztTransStBy = 0
local CzyTrans = 1
local CzyADF1 = 0
local CzyADF1Kropka = 0
local CzyCOM1 = 0
local CzyNAV1 = 0
local PrzyciskBlok2 = 0
local CzyCOM1Kropka = 0
local CzyNAV1Kropka = 0
local StaryTrimPozycjaOsi = 0
local StaryTouchDownAny = 0
local CzyOblodzenie = 0
local ApSwitch = 0
local PrzyciskBlok = 0
local PrzyciskBlok1 = 0
local LNAVSwitch = 0
local VNAVSwitch = 0
local VSSwitch = 0
local HDGSwitch = 0
local VORSwitch = 0
local APPSwitch = 0
local ALTSwitch = 0
local N1Switch = 0
local SpeedSwitch = 0
local LVLSwitch = 0
local APAlarmSwitch = 0
local ATAlarmSwitch = 0
local FMCAlarmSwitch = 0
local APU2OffSwitch = 0
local APU2OnSwitch = 0
local APU1OffSwitch = 0
local APU1OnSwitch = 0
local GEN1OnSwitch = 0
local GEN1OffSwitch = 0
local GEN2OnSwitch = 0
local GEN2OffSwitch = 0
local TerrSwitch = 0
local PosSwitch = 0
local DataSwitch = 0
local ArptSwitch = 0
local WptSwitch = 0
local StaSwitch = 0
local WxrSwitch = 0
local FlapsTransit = 0
local FlapExit = 0
local Transponder1 = 0
local Transponder2 = 0
local Transponder3 = 0
local Transponder4 = 0
---EFIS MAP RANGE--------------------------------------

dataref("IXMapScale", "ixeg/733/ehsi/ehsi_range_pt_act", "writable")


create_command("FlyWithLua/IXMapScale10",
"",
"",
"IXMapScale = 0",
"")
set_button_assignment( 483, "FlyWithLua/IXMapScale10" )

create_command("FlyWithLua/IXMapScale20",
"",
"",
"IXMapScale = 1",
"")
set_button_assignment( 482, "FlyWithLua/IXMapScale20" )

create_command("FlyWithLua/IXMapScale40",
"",
"",
"IXMapScale = 2",
"")
set_button_assignment( 485, "FlyWithLua/IXMapScale40" )

create_command("FlyWithLua/IXMapScale80",
"",
"",
"IXMapScale = 3",
"")
set_button_assignment( 487, "FlyWithLua/IXMapScale80" )

create_command("FlyWithLua/IXMapScale160",
"",
"",
"IXMapScale = 4",
"")
set_button_assignment( 481, "FlyWithLua/IXMapScale160" )

create_command("FlyWithLua/IXMapScale320",
"",
"",
"IXMapScale = 5",
"")
set_button_assignment( 484, "FlyWithLua/IXMapScale320" )

--- EFIS MAP MODE


dataref("IXMapMode", "ixeg/733/ehsi/ehsi_mode_pt_act", "writable")
create_command("FlyWithLua/IXMapMode4",
"IXEfisMapMode4",
"",
"IXMapMode = 4",
"")

dataref("IXMapMode", "ixeg/733/ehsi/ehsi_mode_pt_act", "writable")


create_command("FlyWithLua/IXMapMode3",
"IXEfisMapMode3",
"",
"IXMapMode = 3",
"")

dataref("IXMapMode", "ixeg/733/ehsi/ehsi_mode_pt_act", "writable")


create_command("FlyWithLua/IXMapMode2",
"IXEfisMapMode2",
"",
"IXMapMode = 2",
"")

dataref("IXMapMode", "ixeg/733/ehsi/ehsi_mode_pt_act", "writable")


create_command("FlyWithLua/IXMapMode1",
"IXEfisMapMode1",
"",
"IXMapMode = 1",
"")

dataref("IXMapMode", "ixeg/733/ehsi/ehsi_mode_pt_act", "writable")


create_command("FlyWithLua/IXMapMode0",
"IXEfisMapMode0",
"",
"IXMapMode = 0",
"")

--- Autopilot altitude


dataref("IXAltitude", "ixeg/733/MCP/mcp_alt_target_act", "writable")

create_command("FlyWithLua/IXAltitudeDown1",
"",
"IXAltitude = IXAltitude - 1",
"",
"")
set_button_assignment( 577, "FlyWithLua/IXAltitudeDown1" )

create_command("FlyWithLua/IXAltitudeDown10",
"",
"IXAltitude = IXAltitude - 20",
"",
"")
set_button_assignment( 585, "FlyWithLua/IXAltitudeDown10" )

create_command("FlyWithLua/IXAltitudeUP1",
"",
"IXAltitude = IXAltitude + 1",
"",
"")
set_button_assignment( 576, "FlyWithLua/IXAltitudeUP1" )

create_command("FlyWithLua/IXAltitudeUP10",
"",
"IXAltitude = IXAltitude + 20",
"",
"")
set_button_assignment( 584, "FlyWithLua/IXAltitudeUP10" )

--------------AUTOPILOT HEADING

dataref("IXHDG", "ixeg/733/MCP/mcp_heading_bug_act", "writable")


create_command("FlyWithLua/IXHDGUP10",
"",
"IXHDG = IXHDG + 10",
"",
"")
set_button_assignment( 587, "FlyWithLua/IXHDGUP10" )

create_command("FlyWithLua/IXHDGDown10",
"",
"IXHDG = IXHDG - 10",
"",
"")
set_button_assignment( 586, "FlyWithLua/IXHDGDown10" )

--------------AUTOPILOT SPEED

dataref("IXSpeed", "ixeg/733/MCP/mcp_ias_mach_act", "writable")


create_command("FlyWithLua/IXSpeedUP10",
"",
"IXSpeed = IXSpeed + 10",
"",
"")
set_button_assignment( 590, "FlyWithLua/IXSpeedUP10" )

create_command("FlyWithLua/IXSpeedDown10",
"",
"IXSpeed = IXSpeed - 10",
"",
"")
set_button_assignment( 591, "FlyWithLua/IXSpeedDown10" )

-------------------------Przycisk F/D
dataref("IXEG_FD","ixeg/733/MCP/mcp_plt_fd_act","writable")
create_command("FlyWithLua/IXEG_FD",
"IXEG_FD",
"",
"IXEG_FD = 0",
"IXEG_FD = 1")
set_button_assignment( 528, "FlyWithLua/IXEG_FD" )

-------------------------Przycisk Fuel
dataref("IXEG_Fuel1","ixeg/733/fuel/fuel_1_aft_act","writable")
create_command("FlyWithLua/IXEG_Fuel1",
"IXEG_Fuel1",
"",
"IXEG_Fuel1 = 1",
"IXEG_Fuel1 = 0")
set_button_assignment( 535, "FlyWithLua/IXEG_Fuel1" )

dataref("IXEG_Fuel2","ixeg/733/fuel/fuel_1_fwd_act","writable")
create_command("FlyWithLua/IXEG_Fuel2",
"IXEG_Fuel2",
"",
"IXEG_Fuel2 = 1",
"IXEG_Fuel2 = 0")
set_button_assignment( 527, "FlyWithLua/IXEG_Fuel2" )
dataref("IXEG_Fuel3","ixeg/733/fuel/fuel_2_fwd_act","writable")
create_command("FlyWithLua/IXEG_Fuel3",
"IXEG_Fuel3",
"",
"IXEG_Fuel3 = 1",
"IXEG_Fuel3 = 0")
set_button_assignment( 512, "FlyWithLua/IXEG_Fuel3" )

dataref("IXEG_Fuel4","ixeg/733/fuel/fuel_2_aft_act","writable")
create_command("FlyWithLua/IXEG_Fuel4",
"IXEG_Fuel4",
"",
"IXEG_Fuel4 = 1",
"IXEG_Fuel4 = 0")
set_button_assignment( 526, "FlyWithLua/IXEG_Fuel4" )

----- ODCzyt DIODY

dataref("D_Fuel1","ixeg/733/fuel/fuel_1_aft_lowp_ann")
dataref("D_Fuel2","ixeg/733/fuel/fuel_1_fwd_lowp_ann")

function PetlA()
if D_Fuel1 > 0 then
D_Fuel1 = 1
end

if D_Fuel2 > 0 then


D_Fuel2 = 1
end

print(D_Fuel2)

file = io.open("DaneDoFsTrim.lua", "w")


file:write(D_Fuel1, "\n")
file:write(D_Fuel2, "\n")
--file:write(D_Fuel3, "\n")
--file:write(D_Fuel4, "\n")
--file:write(D_Fuel5, "\n")
--file:write(D_Fuel6, "\n")
--file:write(D_Bypass1, "\n")
--file:write(D_Bypass2, "\n")
--file:write(D_Valve_Open, "\n")
--file:write(D_FLT_ALT, "\n")
--file:write(D_FLT_LAND, "\n")
--file:write(D_DuctL, "\n")
--file:write(D_DuctR, "\n")
--file:write(D_Yaw, "\n")
--file:write(D_LValve, "\n")
--file:write(D_RValve, "\n")
--file:wite(D_CowlL1, "\n")
--file:write(D_CowlR1, "\n")
--file:write(D_CowlL, "\n")
--file:write(D_CowlR, "\n")
--file:write(D_EngLowL, "\n")
--file:write(D_EngLowR, "\n")
--file:write(D_EleLowL, "\n")
--file:write(D_EleLowR, "\n")
--file:write(D_EmerExit, "\n")
--file:write(D_Pitot1, "\n")
--file:write(D_Pitot2, "\n")
--file:write(D_FWDEntry, "\n")
--file:write(D_FWDSerwice, "\n")
--file:write(D_LeftFWD, "\n")
--file:write(D_rightFWD, "\n")
--file:write(D_FWDCargo, "\n")
--file:write(D_Equip, "\n")
--file:write(D_LeftAFT, "\n")
--file:write(D_RightAFT, "\n")
--file:write(D_AFTCagro, "\n")
--file:write(D_AFTEntry, "\n")
--file:write(D_AFTSerwice, "\n")
--file:write(D_OverHeatL, "\n")
--file:write(D_OverHeatR, "\n")
--file:write(D_FlapY, "\n")
--file:write(D_EGT, "\n")
--file:write(D_EGTFault, "\n")
--file:write(D_EGTLow, "\n")
--file:write(D_Gen1Trans, "\n")
--file:write(D_Gen2Trans, "\n")
--file:write(D_AirOFFSched, "\n")
--file:write(D_AirManual, "\n")
--file:write(D_Gen1Source, "\n")
--file:write(D_Gen2Source, "\n")
--file:write(D_Gen1Bus, "\n")
--file:write(D_Gen2Bus, "\n")
--file:write(D_ApuGen, "\n")
--file:write(D_GRDPower, "\n")
--file:write(D_BleedL, "\n")
--file:write(D_BleedR, "\n")
--file:write(D_GodzZulu, "\n")
--file:write(D_MInZulu, "\n")
--file:write(D_SekZulu, "\n")
--file:write(D_Com1Stby, "\n")
--file:write(D_Com1, "\n")
--file:write(D_Nav1STBY, "\n")
--file:write(D_Nav1, "\n")
--file:write(D_Nav2STBY, "\n")
--file:write(D_Nav2, "\n")
--file:write(D_Course, "\n")
--file:write(D_HDG, "\n")
--file:write(D_IAS, "\n")
--file:write(D_ALT, "\n")
--file:write(D_VS, "\n")
--file:write(D_Bank, "\n")
--file:write(D_Fuel, "\n")
--file:write(D_N1_1, "\n")
--file:write(D_N1_2, "\n")
--file:write(D_APMaster, "\n")
--file:write(D_VnaV, "\n")
--file:write(D_LnaV, "\n")
--file:write(D_VSDioda, "\n")
--file:write(D_AltDioda, "\n")
--file:write(D_APPDioda, "\n")
--file:write(D_VORDioda, "\n")
--file:write(D_HDGDioda, "\n")
--file:write(D_N1Dioda, "\n")
--file:write(D_SpeedDioda, "\n")
--file:write(D_LVLDioda, "\n")
--file:write(D_APAlarmDioda, "\n")
--file:write(D_ATAlarmDioda, "\n")
--file:write(D_FMCalrmDioda, "\n")
--file:write(D_ARMDioda, "\n")
--file:write(D_KolaDioda, "\n")
--file:write(D_NAV1Dioda, "\n")
--file:write(D_NAV2Dioda, "\n")
--file:write(D_SpeedBreakDioda, "\n")
--file:write(D_SpeedBreakNotArmedDioda, "\n")
--file:write(D_AutoBrakeDisarm, "\n")
--file:write(D_CabDIFF, "\n")
--file:write(D_CabinClimb, "\n")
--file:write(EleTrimPos, "\n")
--file:write(FlapsTransit, "\n")
--file:write(FlapExit, "\n")
--file:write(AirAlt, "\n")
--file:write(AirAutoFail, "\n")
--file:write(Transponder, "\n")
--file:write(CzyOblodzenie, "\n")
--file:write(CswAPozycja, "\n")
--file:write(Com1Stb833, "\n")
--file:write(Com1833, "\n")
--file:write(Nav1HZ, "\n")
--file:write(Nav1HZStBy, "\n")
--file:write(CzyCOM1, "\n")
--file:write(CzyNAV1, "\n")
--file:write(Com2Stb833, "\n")
--file:write(Com2833, "\n")
--file:write(Nav2HZ, "\n")
--file:write(Nav2HZStBy, "\n")
--file:write(Adf1HZ, "\n")
--file:write(Adf1HZStBy, "\n")
--file:write(Adf2HZ, "\n")
--file:write(Adf2HZStBy, "\n")
--file:write(CzyADF1, "\n")
--file:write(CzyMic1, "\n")
--file:write(D_AudioCom1, "\n")
--file:write(D_AudioCom2, "\n")
--file:write(CzyADF1Morse, "\n")
--file:write(N21, "\n")
--file:write(N22, "\n")
--file:write(CzyHDG, "\n")
--file:write(DigitA, "\n")
--file:write(DigitB, "\n")
--file:write(ShowIAS, "\n")
--file:write(ShowVS,"\n")
--file:write(MasterC,"\n")
--file:write(TestLight,"\n")
--file:write(D_PackL,"\n")
--file:write(D_PackR,"\n")
--file:write(D_WingBodyL,"\n")
--file:write(D_WingBodyR,"\n")
--file:write(D_AirStair,"\n")
--file:write(D_Equip,"\n")
--file:write(MasterCaution,"\n")
--file:write(FireWarn,"\n")
--file:write(AlarmFltCont,"\n")
--file:write(AlarmELE,"\n")
--file:write(AlarmIRS,"\n")
--file:write(AlarmAPU,"\n")
--file:write(AlarmFUEL,"\n")
--file:write(AlarmOVER,"\n")
--file:write(TempTAT,"\n")

--file:write(FMC00L,"\n")
--file:write(FMC00S,"\n")
--file:write(FMC01L,"\n")
--file:write(FMC01M,"\n")
--file:write(FMC01X,"\n")
--file:write(FMC01S,"\n")

--file:write(Callsing, "\n")
--file:write(XsqTXT, "\n")

file:close()

end

do_every_frame("PetlA()")

You might also like