Twitching Lurkist

Automatically lurk on Twitch channels you follow

< 脚本 Twitching Lurkist 的反馈

提问 / 留言

§
发布于:2024-06-07

Hope this helps - script wasn't running on my machine before these changes (source editor was showing eslint errors) - script ran after changes YMMV

Code block below (with line numbers)

//Running Tampermonkey version 5.1.1
//on Chromium Version 125.0.6422.113 (Official Build) (64-bit)

//corrected eslint no multispaces eroor - deleted space closest to btn.innertext

//original
265  btn.innerText  = 'X';

//new
265  btn.innerText = 'X';

//corrected eslint no-return-assign errors - enclosed return assignments in parens

//original
381   const autoTgl = createToggle('autoClose', 'Auto-close raids and hosts', prefs.autoClose, x => prefs.autoClose = x);
382   const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => prefs.autoCinema = x);

//new
381   const autoTgl = createToggle('autoClose', 'Auto-close raids and hosts', prefs.autoClose, x => (prefs.autoClose = x));
382   const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => prefs.autoCinema = x);

//original
384   const bufferTgl = createToggle('lowLatDisable', 'Disable low latency mode', prefs.lowLatDisable, x => prefs.lowLatDisable = x);
385   const pauseTgl = createToggle('detectPause', 'Pause streams detection', prefs.detectPause, x => prefs.detectPause = x);

//new
384   const bufferTgl = createToggle('lowLatDisable', 'Disable low latency mode', prefs.lowLatDisable, x => (prefs.lowLatDisable = x));
385   const pauseTgl = createToggle('detectPause', 'Pause streams detection', prefs.detectPause, x => (prefs.detectPause = x));
Xspeed作者
§
发布于:2024-06-09
//new
381   const autoTgl = createToggle('autoClose', 'Auto-close raids and hosts', prefs.autoClose, x => (prefs.autoClose = x));
382   const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => prefs.autoCinema = x);

What about this line 382 then? Doesn't look changed

§
发布于:2024-06-09

my bad, forgot to do the parens thing on line 382

382 const cinemaTgl = createToggle('autoCinema', 'Auto enable theatre mode', prefs.autoCinema, x => (prefs.autoCinema = x));

Xspeed作者
§
发布于:2024-06-09

Yeah, but this tells me that was not the reason the script was not working for you.

Parentheses are not required as per newer ES202X standards. Even more so with extraneous whitespace, some people use that to make multiple lines of assignments more readable.

§
发布于:2024-06-09

Thanks for the feedback, it helped a lot.
Have a good weekend!

发布留言

登录(不可用)以发布留言。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址