MCPcopy Create free account
hub / github.com/Yantesoft/LinuxdoAssistant / startAutoScroll

Function startAutoScroll

linuxdo-helper.user.js:988–1009  ·  view source on GitHub ↗

* 启动自动滚动功能

()

Source from the content-addressed store, hash-verified

986 * 启动自动滚动功能
987 */
988 async function startAutoScroll() {
989 try {
990 const commentElement = await waitForElement(SELECTORS.commentList);
991
992 console.log('找到评论列表元素:', commentElement);
993
994 const delay = randomDelay(
995 RANDOM_DELAY_CONFIG.startScrollDelayMin,
996 RANDOM_DELAY_CONFIG.startScrollDelayMax
997 );
998
999 console.log(`随机等待 ${delay}ms 后开始滚动`);
1000
1001 setTimeout(() => {
1002 if (getSwitchState()) {
1003 scrollComment(commentElement);
1004 }
1005 }, delay);
1006 } catch (error) {
1007 console.error('启动自动滚动失败:', error);
1008 }
1009 }
1010
1011 // ==================== 主程序入口 ====================
1012

Callers 1

mainFunction · 0.85

Calls 4

waitForElementFunction · 0.85
randomDelayFunction · 0.85
getSwitchStateFunction · 0.85
scrollCommentFunction · 0.85

Tested by

no test coverage detected