dserrano Posted June 21, 2020 Report Posted June 21, 2020 Hi, I would like to now how can I add a delay between actions which are programmed I the same button. I could see something about lua plugins. How could I create a .lua file? How would I do the programming? I have buttons and macros created Thanks!!!
Pete Dowson Posted June 21, 2020 Report Posted June 21, 2020 6 hours ago, dserrano said: I would like to now how can I add a delay between actions which are programmed I the same button. I could see something about lua plugins. How could I create a .lua file? How would I do the programming? The Lua sequence would simply have three parts: First action Delay Second action For example, sending controls:ipc.control(control number, parameter) --send first controlipc.sleep(2000) --wait for 2 secondsipc.control(control number, parameter) --send second control The control numbers are listed in the List of Controls document provided (or, for FSUIPC added controls, near the end of the Advanced Users document). There are many other things you can do instead of sending controls -- eg key presses. See the Lua library document. Save the Lua script as a file (eg "twoactions.lua") into the FSUIPC folder. Then assign your button to Lua twoactions, which will appear in the assignments dropdown after you use the "reload" option on the button assignments option tab. Pete
dserrano Posted June 22, 2020 Author Report Posted June 22, 2020 Hi Pete! Thanks for your answer, today I was triyng to make a code and I did this: 1. create a LUA file (A32S_gear_dn) 2. the code: ipc.control(66080,0) -{GEAR_DOWN}- ipc.sleep(500) ipc.control(66066,0) -{SPOILERS_ARM_ON}- ipc.sleep(500) ipc.macro(Macro A32S: RWY TURN OFF) -{Macro A32S: RWY TURN OFF}- ipc.sleep(500) ipc.macro(Macro A32S: NOSE LIGHT) -{Macro A32S: NOSE LIGHT}- ipc.macro(Macro A32S: NOSE LIGHT) -{Macro A32S: NOSE LIGHT}- ipc.sleep(500) ipc.macro(Macro A32S: WING LIGHT) -{Macro A32S: WING LIGHT}- 4. Then I select the button in FSUIPC to assigned LUA A32S gear dn but nothing happens it doesn't work kind Regards, Diego!!!
John Dowson Posted June 22, 2020 Report Posted June 22, 2020 Hi Diego, first, try activating lua debug logging (from the FSUIPC logging options) which should help you debug any lua script. On a first glance, your ipc.macro calls are obviously wrong - the parameter is a string and needs to be in quotes, e.g. ipc.macro("<macro file name>: <macro entry name>"), as described in the documentation. John
dserrano Posted June 22, 2020 Author Report Posted June 22, 2020 Hi John thanks I already solved it you were right the macro were wrong I forgot the "" "". the last question. Is it normal that after activating the button with the sequence prepar3d in the taskbar it blinks once the sequence ends? Diego
John Dowson Posted June 23, 2020 Report Posted June 23, 2020 13 hours ago, dserrano said: Is it normal that after activating the button with the sequence prepar3d in the taskbar it blinks once the sequence ends? I don't know, sorry. I've not noticed that here for my macros. Usually a flashing taskbar icon indicates a pending message or event in the application that requires attention, but not sure why it would flash just once.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now