Hi , I'm using Leo Bodnar cards for my 737 overhead (testing using Zibo Mod) and scripting all of the switches, encoders etc. All seems to be going well with the exception of setting the 'Landing Altitude' (the 'Cabin Pressure' encoder above it works just fine using the same script - see below).
I've confirmed the correct button numbers using the FlyWithLua macro for checking joystick button numbers. The dataref I'm unsuccessfully trying to write to is "laminar/B738/pressurization/knobs/landing_alt" (I am able to update the dataref values using DataRefEditor though). The strange thing is that I cannot find this dataref in the Zibo's datarefs.txt or on the SimInnovations site (I know it shouldn't show on the latter).
This is the script I'm using (note: Cabin Pressure works, Landing Altitude does not):
dataref("m68_CabinPressure", "sim/cockpit/pressure/max_allowable_altitude", "writable")
dataref("m68_LandingAltitude", "laminar/B738/pressurization/knobs/landing_alt", "writable")
m68_CabinPressureUp = 645 -- Increase Cabin Pressure
m68_CabinPressureDn = 644 -- Decrease Cabin Pressure
m68_LandingAltitudeUp = 643 -- Increase Landing Altitude
m68_LandingAltitudeDn = 642 -- Decrease Landing Altitude
-- Set Cabin Pressure
if button(m68_CabinPressureUp) and last_button(m68_CabinPressureUp) then
m68_CabinPressure = m68_CabinPressure + 250
if button(m68_CabinPressureDn) and last_button(m68_CabinPressureDn) then
m68_CabinPressure = m68_CabinPressure - 250
-- Set Landing Altitude
if button(m68_LandingAltitudeUp) and last_button(m68_LandingAltitudeUp) then
m68_LandingAltitude = m68_LandingAltitude + 50
if button(m68_LandingAltitudeDn) and last_button(m68_LandingAltitudeDn) then
m68_LandingAltitude = m68_LandingAltitude - 50
Any help would really be appreciated.