ark1320 Posted January 13, 2023 Report Share Posted January 13, 2023 In case it helps anyone, here's what I came up with for the HJet throttles. I currently just use one axis lever to control both engines , but the below can easily be expanded to use two axis levers for those so motivated (each script below gets divided up into two scripts, one for each engine/throttle lever, and two offsets are used, 0xA000 and 0xA002). This single lever solution makes use of three tiny Lua scripts. With the main script the Saitek controller throttle axis value is stored in offset 0xA000. If the value changes by at least a magnitude of 128 the function HJet_Throttle() is called to convert the raw axis value to a number between 0 and 1, and this number is written to the two HJet Lvars that control the two HJet throttles. This script is loaded automatically when FSUIPC starts through the FSUIPC7.ini Profile Specific file entry that looks like this: [Auto.HJet] 1=Lua HJet_Throttle Here is the main script that gets loaded automatically: -- HJet_Throttle.lua function HJet_throttle() throttle = (ipc.axis("T","X") + 16384)/32587 -- need throttle range of 0 to 1 for TQ throttle axis range of -16384 to +16203 ipc.writeLvar("L:THROTTLE1_SET", throttle) ipc.writeLvar("L:THROTTLE2_SET", throttle) end --******************************************** --********* Main Program ******************** --******************************************** ipc.writeLvar("L:THROTTLE1_SET", 0) -- initialize throttles to idle position. ipc.writeLvar("L:THROTTLE2_SET", 0) ipc.writeLvar("L:HA420_ThrottlePos_R", 50) ipc.writeLvar("L:HA420_ThrottlePos_L", 50) event.offsetmask(0xA000, 0xFF80, "SW", "HJet_throttle") -- mask requires a change of at least 128 to trigger the function call. -- Under FSUJIPC7 Axis Assignments, the HJet throttle axis vale has been -- assigned to Offset 0xA000 as Offset Word Set Main script axis assignment. The two tiny scripts below move the HJet throttles between cutoff and idle. There is switch at the bottom of my Saitek throttle axis. When the switch is closed by moving the lever down into the switch, HjetThrotCuttoff.lua is called, and when the lever is moved up out of the switch position HjetThrotIdle.lua is called. --HjetThrotCuttoff.lua ipc.writeLvar("L:THROTTLE1_SET", -1) ipc.writeLvar("L:THROTTLE2_SET", -1) ipc.writeLvar("L:HA420_ThrottlePos_R", 0) ipc.writeLvar("L:HA420_ThrottlePos_L", 0) --HjetThrotIdle.lua ipc.writeLvar("L:THROTTLE1_SET", 0) ipc.writeLvar("L:THROTTLE2_SET", 0) ipc.writeLvar("L:HA420_ThrottlePos_R", 50) ipc.writeLvar("L:HA420_ThrottlePos_L", 50) Setup of the cutoff - idle switch. Frankly, whether or not all the above is a "good" solution for the HJet throttles I don't know. But I have been using this for a while now and it seems to work fine. And of course, this solution is set up to be HJet Profile Specific. Al HJetThrotCutoff.lua 187 B · 1 download HJet_Throttle.lua 985 B · 1 download HjetThrotIdle.lua 184 B · 1 download 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now