Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Help with incomplete script

Featured Replies

Gday everyone.... Am very new to Sims and scripts as stated in previous messages....

I am using Xplane 12 with Air Manager, Flywithlau and Arduino Uno Cards along with a couple of LB Cards

The Sim I am building is a Generic GA/C172SP simpit

I have managed to work out some simple scripts for all the switches etc with flywithlau thanks to the help from here.

however I cant get my head around a fuel issue script

I found the below on the net which is exaclty what I am after to show the Low Fuel LED tank1 and Low Fuel LED Tank2 on the cessna. but I know the script is incomplete..

Am also after "Vacuum L and R" as well

I have installed and tried datareftool which I am workign out.. and is great to find Datarefs but it doesnt help with coding

can someone please fill in the blanks... with that it would give me a template to work off for other scripts

sim/flightmodel/weight/m_fuel 1 0 20
sim/flightmodel/weight/m_fuel 2 0 20

 

Thanks in Advance

kevin

 

 

  • Author

sorry. maybe I should have been a bit clearer.   i am trying to get the fuel warning LEDS to work on my sim. the datarefs i have is just for low fuel.  i am trying to work out "LOW FUEL Left tank" and "LOW FUEL Right tank" LEDS. 

I was informed that, to get the LED Announciators to work on individual LEDS I would need to use the weight datarefs as shown in my previous message. each line referring to each LED. 

I hope that helps

Kevin

On 1/23/2023 at 5:45 PM, Dartzman said:

Gday everyone.... Am very new to Sims and scripts as stated in previous messages....

I am using Xplane 12 with Air Manager, Flywithlau and Arduino Uno Cards along with a couple of LB Cards

The Sim I am building is a Generic GA/C172SP simpit

I have managed to work out some simple scripts for all the switches etc with flywithlau thanks to the help from here.

however I cant get my head around a fuel issue script

I found the below on the net which is exaclty what I am after to show the Low Fuel LED tank1 and Low Fuel LED Tank2 on the cessna. but I know the script is incomplete..

Am also after "Vacuum L and R" as well

I have installed and tried datareftool which I am workign out.. and is great to find Datarefs but it doesnt help with coding

can someone please fill in the blanks... with that it would give me a template to work off for other scripts

sim/flightmodel/weight/m_fuel 1 0 20
sim/flightmodel/weight/m_fuel 2 0 20

 

Thanks in Advance

kevin

 

 

Hi,

Can't you grab that data from X-Planes default 172 aircraft script? 

Former Beta Tester - (for a few companies) - As well as provide Regional Voice Set Recordings

                Two: AMD-9950X | One: AMD-7950X3D | Three: Asus TUF 4090s | Three: 64GB DDR5 RAM 6000mhz | Three: Cosair 1300 P/S | Three: 990Pro 2TB NVME                    One: Eugenius ECS2512 - 2.5 GHz Switch | Three: Ice Giant Elite CPU Coolers | Three: 75" 4K UHDTVs | One: Boeing 737NG Flight Deck

Are you looking for code? I think something like this is what you mean:

    function lowfuel()
        if get("sim/flightmodel/weight/m_fuel1")<=9.9 then -- Use your numbers, 9.9 is about 15% fuel for C172 (I think)
        -- turn on Tank1 LED
        else
        -- turn off Tank1 LED
        end
        if get("sim/flightmodel/weight/m_fuel2")<=9.9 then
        -- turn on Tank2 LED
        else
        -- turn off Tank2 LED
        end
    end
    do_often("lowfuel()")


I don't know how Arduino turns on the LEDs, sorry. Can you work it out from your working switch scripts?

Oh, and these DRs are from XP12. Not sure where those numbers "1 0 20" in your original post came from.

EDIT: The C172 fuel numbers are 0 to 79 so 15% would be 11.8.

Edited by dolph98

3 hours ago, Dartzman said:

sorry. maybe I should have been a bit clearer.   i am trying to get the fuel warning LEDS to work on my sim. the datarefs i have is just for low fuel.  i am trying to work out "LOW FUEL Left tank" and "LOW FUEL Right tank" LEDS. 

I was informed that, to get the LED Announciators to work on individual LEDS I would need to use the weight datarefs as shown in my previous message. each line referring to each LED. 

I hope that helps

THAT you want the LEDs to work off the datarefs is the part I managed to catch. The crucial missing part is WHEN those LEDs are supposed to be on.

7950X3D + 7900 XT + 64 GB + Linux | 4800H + RTX2060 + 32 GB + Linux
My add-ons from my FS9/FSX days

  • Author

Thanks for the replies everyone.. Bjoern, The LEDS are to come on when the fuel is low, reaches a certain level

2 hours ago, Bjoern said:

The crucial missing part is WHEN those LEDs are supposed to be on.

I get you. Right. I noted 15% is 5 ga. on the gauge but is that where they are supposed to turn on? Is 10 ga. enough to get to a safe landing? 15% is a guess and seems reasonable. YMMV (literally)

 

On 1/25/2023 at 11:44 PM, dolph98 said:

I get you. Right. I noted 15% is 5 ga. on the gauge but is that where they are supposed to turn on? Is 10 ga. enough to get to a safe landing? 15% is a guess and seems reasonable. YMMV (literally)

Well, Dartzman won't tell us what constitutes a "certain level", so it remains an utter unsolved mystery.

Your script is fine, by the way. I'd do it the same way.

7950X3D + 7900 XT + 64 GB + Linux | 4800H + RTX2060 + 32 GB + Linux
My add-ons from my FS9/FSX days

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.