Export Jeehell Autopilot Offsets to a Custom FSUIPC Offset [LUA Script]

Ask here for software oriented support
Post Reply
User avatar
Soarbywire
Posts: 33
Joined: Fri Nov 04, 2022 12:23 am
Location: Sydney, Australia
Contact:

Export Jeehell Autopilot Offsets to a Custom FSUIPC Offset [LUA Script]

Post by Soarbywire »

The following is a script to export the Jeehell default FSUIPC Autopilot outputs (LEDs) to a custom FSUIPC offset. Either AP1, AP2, or both can be enabled and it will trigger the custom offset (0x5300) in this case.

Practical uses - AP solenoid gate, or in my case using the BFF control loading software to recognise AP has been enable on the aircraft.

Place the script in your /documents/Prepar3dv5Add-ons/Fsuipc6 folder and add the line '1=Lua Jeehell_AP' in the [AUTO] section of fsuipc.ini

Jeehell_AP.lua

-- Log Jeehell FMGS AP1 & AP2 LED outputs to offset 0x5300

function autopilot(offset, value)
-- ipc.log("**** autopilot lua: value received = " .. value)
if value == 0 then -- both AP's are off
ipc.writeUB(0x5300,0)

else -- at least one AP is on
ipc.writeUB(0x5300,2)
end
end

event.offsetmask(0x7390, 3, "UB", "autopilot")

ipc.log("Jeehell FMGS AP1 & AP2 LED outputs lua started")
Post Reply