Jump to content
The simFlight Network Forums

Is there a way to make sure a Lua script is not interrupted?

Recommended Posts

I'm super rusty and I don't seem to remember if there's a way to do what I mention in the title. I need my script (it's tied to an axis range) to complete execution, but sometimes it doesn't, I suspect it's because another input is detected for the axis, but I'm not sure because the log doesn't print the lines I have at the beginning of the script after the interruption of the previous execution. Is there a way to get a "lock" or something like that? Thanks

Using FSX and FSUPIC4 v4.977, I believe it's the latest one 

Link to comment
Share on other sites

If you are starting the script when entering (or leaving) an axis range, it will only be sent once, assuming its not on repeat. If its being sent a second time then the range is left and then entered again. Logging the axis controls would show you this. Restarting a script would automatically kill the first thread. It is strange thar the log lines aren't showing - have you tried running with LuaDebug?

You could also try increasing the LuaRerunDelay parameter - see the Advanced User guide for details.

Link to comment
Share on other sites

Thanks, John. Turns out I had an ipc.exit() somewhere that was responsible for the thread interruption. The range wasn't being entered again before the thread completed running The LuaRerunDelay parameter could be useful for some other application, good to know. I don't think i'll need it this time around. The script is working fine already.

I really need to re-read the advanced guide again. It's been a while. 
Muchas gracias de nuevo 😃

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.