From c0486412ecc9b18d1e53af32c9a76074ff7a3ca4 Mon Sep 17 00:00:00 2001 From: px5m9o7hn <3092715829@qq.com> Date: Sun, 3 Nov 2024 21:21:01 +0800 Subject: [PATCH] ADD file via upload --- 1.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 1.js diff --git a/1.js b/1.js new file mode 100644 index 0000000..ebeceb1 --- /dev/null +++ b/1.js @@ -0,0 +1,25 @@ +app.launchApp("小红书"); +sleep(3000); // 等待应用启动,根据设备性能调整时间 +click("直播"); +sleep(3000); +var positions = [ + {x: 300, y: 800}, + {x: 800, y: 900}, + {x: 300, y: 1700}, + {x: 900, y: 1980} +]; + +while(true) +{ + sleep(3000); + // 生成一个0到5之间的随机整数 +var randomIndex = Math.floor(Math.random() * positions.length); + +// 获取随机选择的位置 +var randomPosition = positions[randomIndex]; + +// 使用click函数点击随机位置 +click(randomPosition.x, randomPosition.y); +sleep(3000); +click(1120,220); +} \ No newline at end of file