Jump to content
Sign in to follow this  
clarklidbury

fsx prop axis script

Recommended Posts

Heya!

I would like to write a small script to use a button press to increment or decrement the prop axis by a certain amount (the default built in prop incr/decr are not the correct amount for the plane I am flying resulting in multiple presses needed to get the position I want).

So my questions are:

how do i "read" the current prop axis position in the sim and put it into a local variable.... if it was an LVAR i would write something like local prop_position = ipc.readLvar("L:insertLvarnamehere")

1. How do I do the same thing for the fsx value?

2. What is the range of values?

3. I know how to write it back to the sim - would use ipc.control(65767,prop_position+X) (where X is the amount I want to change the value by

 

Thanks in advance!!!

 

Clark

 

Share this post


Link to post
Share on other sites

so i found

prop 1 lever -------- 088E values range from -4096 to +16384

prop 2 lever -------- 0926 values range from -4096 to +16384

So I have this:

function Condition_Lever_2_INCR_TEST ()
    CL_2 = ipc.readUB(0926)
    if CL_2 < (16384) then
    ipc.control(65767,(CL_2+4096))
    else
    end
end

but its not really working... thoughts? Thanks!

Share this post


Link to post
Share on other sites

Update - solved. I just wrote a script that uses the built in prop_incr command and iterated it the correct number of times (which is 30) so my script looks like this:

function Condition_Lever_DECR ()
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
    ipc.control(65771)
end


is there any way to tidy this up? Can i tell Linda to execute a command 30 times somehow?

Clark

 

 

Share this post


Link to post
Share on other sites

Try

Function Condition_Lever_dec()

I = 0

while I < 30 do

ipc.control(65771)

I = I + 1

end

end

Edited by ScotFlieger

Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...