adrem Posted February 21, 2020 Report Posted February 21, 2020 (edited) Could you please add a function to the lua library for firing mouse macros without using macro files, something like this: ipc.macro(0x25C01807, 13)? Edited February 21, 2020 by adrem
John Dowson Posted February 21, 2020 Report Posted February 21, 2020 I don't see a problem adding this, but it may take some time as I'm quite busy at the moment....I'll flag this and add it to the list. I'll post again here when I have something for you to test. John
Pete Dowson Posted February 22, 2020 Report Posted February 22, 2020 19 hours ago, adrem said: Could you please add a function to the lua library for firing mouse macros without using macro files, something like this: ipc.macro(0x25C01807, 13)? Why not just call the names macro using the existing form of ipc.macro? Seems more complicated for both you and us to have extra work to do, reading .mcro files for you and more complex code for us. The existing facility is surely adequate and clearer, and in fact more flexible in case of updates to the add-on aircraft causing the macro rectangle numbers to be changed. You'd only have the macros to re-make, note the Lua files to be edited too. Pete
adrem Posted February 26, 2020 Author Report Posted February 26, 2020 On 2/22/2020 at 2:01 PM, Pete Dowson said: Why not just call the names macro using the existing form of ipc.macro? Seems more complicated for both you and us to have extra work to do, reading .mcro files for you and more complex code for us. The existing facility is surely adequate and clearer, and in fact more flexible in case of updates to the add-on aircraft causing the macro rectangle numbers to be changed. You'd only have the macros to re-make, note the Lua files to be edited too. Pete I'm making a lua library for FSLabs' cockpit controls. I have a JSON file that's generated with the help of a PDK dll - I interact with the control, the dll looks which lvar has changed its value and maps the macro to the lvar. I then manually add a field specifying which mouse action on that rectangle rotates a switch left/right etc. The lua library loads the file and makes cockpit control object from lvar names. If an FSLabs update changes the macro, I load the dll and interact with the control. I can leave with the current system, of course - by auto-generating entries in a macro file.
Pete Dowson Posted February 26, 2020 Report Posted February 26, 2020 6 hours ago, adrem said: I can leave with the current system, of course - by auto-generating entries in a macro file. If that is just as easy, fine. If not then, whilst it should be easy enough to add to the ipc.macro facility, it probably won't see release for a while due to other pressures. But let me know, and I'll take a look before John can get to it. Pete
John Dowson Posted February 26, 2020 Report Posted February 26, 2020 Hi, can you please try the attached dll: FSUIPC5.dll I've added a new function called ipc.mousemacro, taking two arguments, the first being the rectangle id as an unsigned int, and the second the mouse operation. e.g. ipc.mousemacro(0x25C01807, 13) I've not added much (any!) error checking yet, so please use/test with caution. Cheers, John
Pete Dowson Posted February 26, 2020 Report Posted February 26, 2020 1 hour ago, John Dowson said: can you please try the attached dll You are too quick for me, John! 😉 Dad
adrem Posted February 27, 2020 Author Report Posted February 27, 2020 15 hours ago, John Dowson said: Hi, can you please try the attached dll: FSUIPC5.dll I've added a new function called ipc.mousemacro, taking two arguments, the first being the rectangle id as an unsigned int, and the second the mouse operation. e.g. ipc.mousemacro(0x25C01807, 13) I've not added much (any!) error checking yet, so please use/test with caution. Cheers, John Thanks, that was fast. I've already encountered an issue, however: with consecutive macro actions lua eventually crashes (Crash C0000005). You can try the following code with the default raptor (it's the HUD button, located in the row of buttons just under the HUD): while true do ipc.mousemacro(0x40000039, 3) ipc.sleep(1000) ipc.mousemacro(0x40000039, 13) ipc.sleep(1000) end It crashes on my system within a few seconds (if I remove the sleeping - immediately). Of course, it doesn't crash if I replace ipc.mousemacro with ipc.macro and a macro file (same rectangle and click types).
John Dowson Posted February 27, 2020 Report Posted February 27, 2020 What aircraft are you using - the FSLabs A320? I don't have that aircraft so cannot reproduce here. What function is your rectangle id (0x40000039) activating? I've tried here using an A2A Cherokee and cannot reproduce, even with no delay, and have tried various multi-mouse operations. Can you try see if you can reproduce with a default aircraft so I can reproduce here? John
adrem Posted February 27, 2020 Author Report Posted February 27, 2020 38 minutes ago, John Dowson said: What aircraft are you using - the FSLabs A320? I don't have that aircraft so cannot reproduce here. What function is your rectangle id (0x40000039) activating? I've tried here using an A2A Cherokee and cannot reproduce, even with no delay, and have tried various multi-mouse operations. Can you try see if you can reproduce with a default aircraft so I can reproduce here? John 0x40000039 is pressing the HUD button in the default F-22 Raptor - like I said in my previous post 🙂
John Dowson Posted February 27, 2020 Report Posted February 27, 2020 Ah sorry, missed that! I'll check here....
John Dowson Posted February 27, 2020 Report Posted February 27, 2020 Can you try the following please: FSUIPC5.dll Cheers, John
adrem Posted February 28, 2020 Author Report Posted February 28, 2020 7 hours ago, John Dowson said: Can you try the following please: FSUIPC5.dll Cheers, John Happy to report that it's working as intended and not crashing anymore. Thank you!
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