Iceking007 Posted March 16, 2022 Report Share Posted March 16, 2022 Hello, I have a few problems running certain Lua code in FSUIPC 3.9. I have been working with the log files and starting to get the hang of understanding what is going on. I appreciate all the help so far and the push to get me to where I am now; I finally see some light at the end of the tunnel. The first problem I have rooted out and am unable to solve for the moment on my own is that I am using the event.key() function to pull controls and run functions inside my code. event.key(k,o,"'function'") seems to be working well (and therefore "keydown" registers properly). However if I'm looking for event.key(k,o,2,"'function'") - ie: key up - does not seem to return a result. To test this I literally used: event.key(k,o,"keyDown") event.key(k,o,2,"keyUp") where: function keyDown() ipc.lineDisplay("Key Down") end 《and》 function keyUp() ipc.lineDisplay("Key Up") end Even omitting the 'down' function, I don't get any results from the 'up' function. Perhaps I'm missing something somewhere? This is to run the "Triple Use" code, however I'm setting ipc flags to track Key up and down because the example Lua file uses a joystick test function (that I do not believe, has an equivalent "key" counterpart... not that I have found). According to the documentation this method should work. Another issue I found was with trying to get COM and NAV offset values. For example ipc.readUW(0x311A), If I use: comDisp = "1" .. ipc.readUW(311A) ipc.lineDisplay(comDisp) OR comDisp = "1" .. string.sub(ipc.readUW(0x311A), 3) ipc.lineDisplay(comDisp) I get results... but I cannot fathom how to interpret the results, the numbers I get on screen or something like 10007, or 1961. I tried converting these from hexadecimal to decimal but even that doesn't give me a "BCDE" frequency. So I'm not sure what step I'm missing; same happens with Com1, and Nav frequencies. A few minor issues I will hope to clean up, are, FSUIPC's log reports "... not defined, sent to FS"; but it still runs in my Lua script properly. Do you have to define keys (and joystick buttons for that matter... but mostly keys), in both fsuipc and Lua? If so do you just assign the key press to "Lua script" general? Or "Lua set"? Or one of the other options? Do you need to specify an offset or parameter?! I'm not clear on all that but it seems like there's a lot of wasted pushing around that I hope to clean up. Another thing; I haven't been able to get SPAD working... but I did notice during my COM display tests, as mentioned above, when I use my rotaries to adjust the COM frequency, while calling for the display to update there is a severe bottleneck; however it's not the rotary or display independently (it's mostly likely the circular reference in my code); if I adjust the COM frequency with the Saitek the display is instant, the rotary works well for other commands and is instant; but the code together has an issue I'll have to look at better. The login in fsuipc is actually very good; even helps with Lua code issues just like a terminal; thank you ever so much for this program! Link to comment Share on other sites More sharing options...
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 account
Already have an account? Sign in here.Sign In Now