Jump to content
The simFlight Network Forums

Duke Turbine Scripts


Recommended Posts

Hello all-

Here I have uploaded (attached) a zip file with two scripts in it. The scripts are my attempt at making all the "broken" knobs and switches in the Duke Turbine. assignable to hotkeys and buttons through FSUIPC.

Please understand I had never seen lua until two nights ago when I came across another post in this forum dealing with the oil doors... or was it the ignition switches. I would really appreciate it if someone who actually knows lua could take a look at them and give me some feedback or point out mistakes. So far they work fine on my system and anyone who wants them is welcome to download them and use them... improve them... etc. I am in no way claiming any kind of copyright protection or anything. I was just frustrated that I has to use a mouse to fly the plane.



UPDATE I have added version 1.1 to the downloads to address some bugs that I found in a few of the "cycle" routines. I left the 1.0 versions of the files in case I accidentally messed up something else while I was editing. Incidentally Some of you may have noticed an incorrect parameter in the first release as well feel free to take a look, and as always... feel free to make changes, redistribute, etc. just please add your name to any changes you make so we can keep track of "who knows how to do what".



Edited by BaobobMiller
Link to comment
Share on other sites

I would really appreciate it if someone who actually knows lua could take a look at them and give me some feedback or point out mistakes.

They look pretty good. Thanks for the contribution.

Since you asked, the only thing i would consider doing, just to make them a little more efficient, would be to use "elseif" for each alternative test on ipcPARAM after the first, so the value doesn't have to be uselessly compared with every possibility. In other words, instead of

if ipcPARAM == ... then

if ipcPARAM  == ...

etc, you do

if ipcPARAM == ... then

elseif ipcPARAM == ...


with one 'end' after the last alternative.



Link to comment
Share on other sites

Thanks so much for these. I was trying to kludge the oil doors (cowl flaps on the piston) and found your scripts. I have yet to test anything other than the oil doors / cowl flaps, but I have one small fix. When the cowl flaps were in the fully open position, calling the increment position functions (parameters 49 or 59 for left and right respectively) was cycling them back to closed. Not sure why. The fix was simply to test for them being set to 2 and then if they are already set to 2 set val=2 again so the writeLvar doesn't set them back to 0.

Like this:

if ipc.readLvar(LVarSet) == 2 then

val = 2


Thanks again, I'll test some more functions soon.


Link to comment
Share on other sites

An updated version of the two scripts has been added (right next to the first one in the first post for this thread. just a few bug fixes. but they are important fixes depending on how you are using the scripts there have been no changes in functionality so just replacing the files in you modules folder will do the trick. (No need to reconfigure your hot keys and switches in other words.)


Link to comment
Share on other sites

  • 1 month later...

Thanks for these scripts, very very useful!

Has anyone worked out how to get the Autopilot VS buttons working (VS, Up and Down)? I've be messing around with lua today but can't get them to work. About all I've managed to do is get the VS button animation to play, but the actual vertical speed is not displayed.



Link to comment
Share on other sites

  • 2 months later...
  • 7 months later...

Great stuff. I have modified the code and added few functions...all works!

I have a question:

I would like to have a LED ON (GoFlight module) when, for example, the ignition switch is AUTO.

I have the instruction gfd.SetLights(GFT8, 0, 7) but I'm not sure how to read that specific value (Ignition switch status).

Thanks for the help.

Link to comment
Share on other sites

  • 4 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.