Jump to content
The simFlight Network Forums

adrem

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by adrem

  1. I just tried both ways and it didn't work most of the time either way, but actually it does very rarely print 'release' when I first release the 'A' key.
  2. Hi, I'm having the following issue: if I setup a key bind with a 'shifts' modifier, my callback is never called when the keys are released. I'm using FSUIPC 5.154. function testBind(keycode, shifts, downup) -- always prints all three print(downup == 1 and "initial press (A)" or downup == 3 and "repeated press (A)" or downup == 0 and "release (A)") end function testBindWithShifts(keycode, shifts, downup) -- doesn't print 'release'! print(downup == 1 and "initial press (CTRL+A)" or downup == 3 and "repeated press (CTRL+A)" or downup == 0 and "release (CTRL+A)" or "huh") end event.key(string.byte("A"), 8, 7, "testBind") event.key(string.byte("A"), 2, 7, "testBindWithShifts")
  3. Happy to report that it's working as intended and not crashing anymore. Thank you!
  4. 0x40000039 is pressing the HUD button in the default F-22 Raptor - like I said in my previous post 🙂
  5. 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).
  6. 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.
  7. 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)?
  8. 2) I wanted to replicate the issue outside of my actual scripts and I knew that it stemmed from multiple files interacting with the global variables. This is easier than creating and editing those multiple files by hand. The getting the variables before setting them isn't really necessary as removing that loop causes the same errors. Even if I insert ipc.sleep(2000) inside the setting loop, I still get the errors, eventually. I actually need a maximum interval of 50 ms between two ipc.get calls in one of my scripts, so I'll just use the user offsets instead if this is not fixable.
  9. I have a few scripts which share variables with each other using ipc.get and ipc.set. I noticed that FSUIPC would often mix up the values of different variables for a few milliseconds and very rarely one of the scripts would crash with an access violation error. I made the following script which replicates my problem: local modules_dir = lfs.currentdir():gsub("\\\\","\\") .. "\\Modules\\" local testdir = "__TEST__\\" lfs.mkdir(modules_dir .. testdir) for i = 1, 100 do local path = testdir .. "test" .. i .. ".lua" local content = [[while true do for i = 1,1000 do ipc.get('var' .. i) ipc.sleep(100) end for i = 1,1000 do ipc.set('var' .. i, "you're not supposed to see this") ipc.sleep(100) end end]] local file = io.open(path, "w") file:write(content) file:close() ipc.runlua(path) end while true do local myVar = ipc.get("myVar") if myVar then print(myVar) end ipc.sleep(100) end This is intentionally over the top to replicate the issue quickly. I only have a handful of scripts and variables.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.