Thanks for taking the time to reply. So helpful for a non-programmer.
I searched the web for Lua integer and only came up with math functions to do it which seemed to require a library.
INT seems such a simple function to be omitted from Lua
Now reading up about string format which seems to be a powerful programming language all to itself!!!
I spend some time last year writing a generic button instrument using a configurable json file but soon realised users don't want configurable they just want it to do what they want.
Now adapting it for Toliss aircraft which seem to be under represented on the instrument library and not using the configurable file to make it simpler
Might submit it when finished.
Interestingly initially I called it a "Stream Deck" clone and sure enough 6 months later someone wrote a configuration of Stream deck for flight sim.
Display a dataref in textadd
Re: Display a dataref in textadd
I know I said I would stop bothering you guys but can you give me a quick pointer how to repeat a function as a button is held down.
I want to increase decrease the set speed in the autopilot while the button is still being pressed.
A sort of do while
Is this possible or is there another object type for this?
I want to increase decrease the set speed in the autopilot while the button is still being pressed.
A sort of do while
Is this possible or is there another object type for this?
Code: Select all
button_2_4=button_add("BGreen.png", "BRed.png", 340, 120, 100, 100, function()
xpl_command("sim/autopilot/airspeed_down")
end)
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Display a dataref in textadd
Hi,
Use the "BEGIN" and "END" features.
https://siminnovations.com/wiki/index.p ... pl_command
Keith
Use the "BEGIN" and "END" features.
https://siminnovations.com/wiki/index.p ... pl_command
Code: Select all
button_2_4=button_add("BGreen.png", "BRed.png", 340, 120, 100, 100, function(press)
xpl_command("sim/autopilot/airspeed_down","BEGIN") ,
function((release)
xpl_command("sim/autopilot/airspeed_down","END")
end)
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Display a dataref in textadd
That worked perfect.
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Display a dataref in textadd
Hi
for that, I would prefer you to buy me a coffee rather than bear by the way.
LOL Just joking. I do it to help all and get great pleasure out of what I can share within my knowledge scope.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card