twitch2dcs icon indicating copy to clipboard operation
twitch2dcs copied to clipboard

Intermittent Error on line 236 of Twitch2DCS.lua

Open danw-eth opened this issue 1 year ago • 5 comments

Getting error intermittently something like every 2nd restart, sometimes 2/3 restarts of DCS. There's nothing wrong with options.lua and the oauth code is correct, because it works many other times.

Once the error/msgbox happens, the chatbox is non-functional and chat messages won't appear in that session of DCS.

Error is "[string "C:\Users\danwa\Saved Games\DCS.openbeta\Scripts\Twitch2DCS.lua"]:236: loop in gettable"

Removing the "self:isEnabled()" check from line 236 in Twitch2DCS.lua seems to have fixed the issue, and the chatbox will now function every time.

The new line 36 is if err and err ~= "timeout" and err == "closed" then

I leave mine enabled all the time, so I assume its ok to skip that check. You may want to look into why it is failing as there's a few recent posts on the DCS thread having similar issue. I can't find a definitive way to reproduce it except that it's intermittent and restarting sometimes fixes it.

danw-eth avatar May 19 '23 05:05 danw-eth

+1, only happens roughly 1/3 starts to me tho. thank you very much!

Eld0r avatar May 19 '23 08:05 Eld0r

Try this. Go to your Twitch settings 'Connections' tab and revoke TwitchApps. Go back to twitchapps.com and get a new token and enter the new one into the DCS settings box and restart DCS. Does it then stop doing it as frequent?

rthom91 avatar May 19 '23 15:05 rthom91

Thanks did this, but unfortunately it now started giving another random error "[string "C:\Users\username\Saved Games\DCS.openbeta\Scripts\twitch\server.lua"]:38: attempt to index field 'connection' (a nil value)"

This is also intermittent i.e. restarting DCS usually gets rid of the error. It's like on 50% of DCS starts or something like that.

danw-eth avatar May 23 '23 00:05 danw-eth

#10 This has already been fixed, but a release hasn't been created since 2021. You can grab the latest code from the repo instead though.

Camble avatar Jun 14 '23 10:06 Camble

I haven't bothered touching this in years but if you want a slightly more updated and thinner build, download my master. https://github.com/rthom91/twitch2dcs

rthom91 avatar Jun 14 '23 10:06 rthom91