May 5, 20215 yr 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
May 5, 20215 yr Author 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!
May 5, 20215 yr Author 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
May 9, 20215 yr Try Function Condition_Lever_dec() I = 0 while I < 30 do ipc.control(65771) I = I + 1 end end Edited May 9, 20215 yr 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
Archived
This topic is now archived and is closed to further replies.