Airbuspilot
-
Posts
128 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by Airbuspilot
-
-
Hello,
in my Script, i need to detect the Press of specific Keys and do some Action, if the Key is pressed.
I tried with this one: if ipc.keypressplus(104,8) == 0 then ..........
If detected, that NumPad 8 is pressed and released the Script will send some Instructions to the Plane.
But unfortunately that does'nt work.
Could you please offer a Solution for it? Thanks in Advance, Joachim -
1 hour ago, John Dowson said:
If your condition is filled, you can just call ipc.runlua("Window2.lua"), no?
I have to apologize that i didn't remember the runlua Function. It is indeed so easy.
Sorry, that i made unnecessary Work on your Side. -
19 minutes ago, John Dowson said:
Generally not, only for virtual buttons - see the ipc.btnPress, ipc.btnRelease and ipc.btnToggle lua functions.
But why do you want to do this? Can you not just simulate the action that the button press performs when your condition is met, rather than the button press itself?
In general i could do that. But for each A/C i have a different FlightLog.lua and an according Window.lua
I start them with one Joystick Button on the Press and Release Event. My Aim is now, to open a second Window if necessary for the used Plane.
This could be named Window2.lua and could be assigned to a separate Joystick Button in the FSUIPC Button Assignments. And so i want to simulate
the Button Press with Lua Code, if my Condition is fulfilled. I want to do it this Way to hold the FlightLog itself as small as possible for Maintenance Reasons.
I know, i could fill all the Window Texts in the FlightLog, but i would prefer the separate File Solution for each Window.lua, if possibleJoachim
-
8 hours ago, ark1320 said:
In general yes (see the FSUIPC Lua Event library), but it depends on if the special condition can be detected with code; that is, are the necessary simvars (variables) associated with the special condition available? I think it would help John give you the best answer if you would provide him with some information on the nature of the special condition you are talking about.
I have several Planes, that were controlled and directed by a File named FlightLog.lua
For every Plane there is a separate File, that contains the SimVars and Lvars of this Plane. This File is also named FlightLog but extended with the ID of this Aircraft, i.E. FlightLog.DAIJB
The Reason for this is to save my Flights in a MS Access Database. Before starting a Flight, i file FlightPlans, Fuel Amounts, PayLoad, etc. in this DB. Once everything is done, i rename
the File FlightLog.DAIJB to FlightLog.lua and copy it from the Scripts Folder to the FSUIPC Folder. Because of that, i have all Variables according to the used Plane in the FlightLog.lua and
can assure, that the Variables are available at the Runtime. For each of this Aircraft there are different Variables, that will be used, to trigger the Condition where the simulated Joystick Button should be pressed. -
Hey John,
is it possible, to simulate a Press of a Joystick with Lua Code?
I want to simulate this Button Press if a special Condition is fulfilled.Thanks in Advance
Joachim -
14 hours ago, John Dowson said:
Yes, and I quoted it in my previous comment....again:
The options can be any mix of these (add them together):WND_BOLD, WND_ITALIC, WND_UNDER, WND_STRIKE. Okay, Thats what is stated in the Docs. Do you see a + Sign in here?
I can add them together. Maybe you should explain this more clearly that this only works with the + Sign and not as stated here with the , Sign.
But anyway, thanks for the Help. -
So, where is my Fault?
I issued this Command: wnd.font(w, WND_ARIAL,64, WND_UNDER, WND_BOLD)
That doesn't work.
From where should i know, that those Attributes had to be combined with a +?
Is this stated anywhere in the Docs? I didn't find it.Anyway thank you for the Help.
-
Tried the new Version. Works okay. But i got a Question about Multi Combinations like this:
wnd.font(w, WND_ARIAL,64, WND_UNDER, WND_BOLD)
This shows the Text Underlined but not Underlined and Bold as expected.Tried several Writings like this:
wnd.font(w, WND_ARIAL,64)
wnd.font(w, WND_UNDER, WND_BOLD)
wnd.text(w, "Arbeitsliste FBW A20N" .. " Local Time " .. fstime .. " Zulu Time ".. zulu)
This shows the so small, that is unreadable.
Is there a Solution for?Joachim
-
Sorry for asking again.
This is from your Example before except from the Time Values.
fstime = string.format("%02d:%02d:%02d", ipc.readUB(0x0238), ipc.readUB(0x0239), ipc.readUB(0x023A))
zulu = string.format("%02d:%02d:%02d", ipc.readUB(0x0238) - 2, ipc.readUB(0x0239), ipc.readUB(0x023A))wnd.font(w, WND_ARIAL,64,WND_UNDER)
wnd.text(w, "Arbeitsliste FBW A20N" .. " Local Time " .. fstime .. " Zulu Time ".. zulu)
Unfortunately it seems not to work. I expected an Underline, but this is the Result.
There is no Underline to see. Do you have any Hint for me please? -
Thanks for your Help and sorry for complicating Things for you. This will never happen again.
-
May i please you, to help me out? I understand, what you have texted, but i don't have any Idea, how to code it.
I will give you a short Overview of my Window:These are the Font Settings adapted from your Example:
-- These set the colours and font to be used.
wnd.backcol(w, 0x000)
wnd.textcol(w, 0x6c0)
wnd.font(w, WND_ARIAL,64)And this is a Part of my Window Code:
On the left Side, you can see the Line Numbers in the Code.
Could you please give a short Code Example, how to set the Text in LineNbr. 30 to Bold and underlined and to reset them back to normal at LineNbr. 31 and further?
I know, you normally code not for your Customers. But i would highly appreciate a little Help.
Thanks a lot in AdvanceJoachim
-
If i understand the Manual in the right Way, those Commands are Manipulators for the whole Text in the Window.
I wish to Manipulate several Lines of Text in the Window. Is this possible? -
Thanks for your Help.
-
Hey John,
this Window Technic is great. Got highly Efforts on them.
But i have a short Question. Is it possible to manipulate the Text except from the Font Height?
I mean underlined and Bold.Joachim
-
Hey John,
thanks for the great Explanation. I think, i use the Button Press/Release Option.
Joachim
-
Hey John,
is it possible, to start two Lua Files at the same Time when pressing one Joystick Button?
Both Files are individual and don't depend on the other.Thanks a lot in Advance, Joachim
-
Hey John,
great Explanation. Thanks for the valuable Hints.
I will now try to change the Code for displaying fixed Text Values. Hope, i can make it.
If i have Questions, i hope for your great Help.Joachim
-
Hi John,
in this Thread
you attached the FPS_MonitorW.lua.
As you documented in ther, i have just to change the Values in this Line of Code:
I have tried several Values, but there is no Effect. The Window Size and Position doesn't change.
Could you please explain, why there is no Change visible?
Thanks in Advance, Joachim -
Hi John,
this
3 hours ago, John Dowson said:ipc.execCalcCode("25 84 (>K:2:LIGHT_POTENTIOMETER_SET)")
brought the Solution.
I used several Codes before. But they hadn't any Effects.
Now it works, as it should.Thank you so much for your Patience and the extremely valuable Help.
Joachim
-
Changed to the Dev Version but again no Effect on the Light Potis.
I don't know, what i am doing wrong. -
I am using the normal Version of the A320. I will turn over to the Dev Version and try again.
Thanks for this valuable Hint.Joachim
-
Neither this
5 hours ago, John Dowson said:ipc.execPreset("A32NX_OH_INTEG_LIGHT_25")
nor that
5 hours ago, John Dowson said:ipc.execCalcCode("(A:LIGHT POTENTIOMETER:86,percent) 25 (>K:2:LIGHT_POTENTIOMETER_SET)")
works in my Script.
I try to find a Solution in the Mobiflight Discord.
Thanks for your Attemts to help me.Joachim
-
16 hours ago, John Dowson said:
ipc.execCalcCode("50 (>K:2:LIGHT_POTENTIOMETER_SET)")
That also has no Effect. Seems, this Technology is too high for me.
I put a new Line in the events.txt.
A32NX_OH_INTEG_LIGHT_25#(A:LIGHT POTENTIOMETER:86,percent) 25 (>K:2:LIGHT_POTENTIOMETER_SET)
This should set the Light Poti to 25. But how do i code this in my Lua Script?Sorry that i stretch your Nervs with my Lack of Knowledge.
Joachim
-
The Presets are a great Work. Finding and Binding them to a Button or Key in FSUIPC 7.3.23 is pretty easy.
But unfortunately this is not, what i need. I want to set a fixed Value i.E. to Potentiometer:86 via ipc.execCalcCode or any other Command in my Lua Script.
I tried this Command: ipc.execCalcCode("0.5 (>A:LIGHT POTENTIOMETER:86, Percent over 100)")
But that has no Effect.Seems like i am unable to do, what i need and i have to set all those Potis by Mouse Clicks in the VC.
Thanks for your Help so far and have a nice Sunday.Joachim
Another non Aircraft specific Question - Detect a specific Keypress
in FSUIPC7 MSFS
Posted
Thank you John.
Joachim