You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
163 lines
5.0 KiB
163 lines
5.0 KiB
const View = android.view.View;
|
|
|
|
// 创建悬浮窗
|
|
let window = floaty.window(
|
|
<vertical padding="10" bg="#ccffffff" w="250">
|
|
<button id="toggleBtn" text="展开/隐藏" textColor="#FFFFFF" bg="#FF5722" />
|
|
<vertical id="controlPanel" visibility="visible" padding="5">
|
|
<button id="enter" text="进入直播间" textColor="#333333" bg="#F5F5F5" />
|
|
<button id="push" text="自动发帖" textColor="#333333" bg="#F5F5F5" />
|
|
<button id="comment" text="评论" textColor="#333333" bg="#F5F5F5" />
|
|
<button id="follow" text="关注" textColor="#333333" bg="#F5F5F5" />
|
|
<horizontal>
|
|
<button id="likeToggle" text="自动点赞(关)" textColor="#333333" bg="#FFC107" />
|
|
</horizontal>
|
|
<horizontal marginTop="10">
|
|
<text text="速度调节:" textColor="#333333" textSize="14sp" />
|
|
<seekbar id="speedSeekBar" max="5000" layout_width="200dp" layout_height="wrap_content" />
|
|
</horizontal>
|
|
</vertical>
|
|
</vertical>
|
|
);
|
|
|
|
// 设置悬浮窗的位置
|
|
window.setPosition(0, 50);
|
|
|
|
// 初始化悬浮窗的状态
|
|
let isExpanded = true;
|
|
let isAutoLiking = false; // 点赞开关状态
|
|
let likeInterval = 1000; // 默认点赞间隔为1秒
|
|
|
|
// 隐藏和展开悬浮窗
|
|
window.toggleBtn.click(() => {
|
|
if (isExpanded) {
|
|
// 隐藏悬浮窗
|
|
window.controlPanel.setVisibility(View.GONE);
|
|
window.toggleBtn.setText("展开");
|
|
} else {
|
|
// 展开悬浮窗
|
|
window.controlPanel.setVisibility(View.VISIBLE);
|
|
window.toggleBtn.setText("隐藏");
|
|
}
|
|
isExpanded = !isExpanded;
|
|
});
|
|
|
|
// 调节点赞速度
|
|
window.speedSeekBar.setOnSeekBarChangeListener({
|
|
onProgressChanged: function(seekBar, progress) {
|
|
likeInterval = 5000 - progress; // 越长越快
|
|
if (likeInterval < 50) {
|
|
likeInterval = 50; // 确保最小值为50ms
|
|
}
|
|
}
|
|
});
|
|
|
|
// 自动点赞功能
|
|
function autoLike() {
|
|
while (isAutoLiking) {
|
|
click(900, 1500); // 第一次点击
|
|
sleep(likeInterval); // 根据设置的速度点赞
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
// 点赞开关按钮
|
|
window.likeToggle.click(() => {
|
|
isAutoLiking = !isAutoLiking;
|
|
if (isAutoLiking) {
|
|
window.likeToggle.setText("自动点赞(开)");
|
|
threads.start(autoLike); // 启动自动点赞线程
|
|
} else {
|
|
window.likeToggle.setText("自动点赞(关)");
|
|
}
|
|
});
|
|
|
|
// 进入随机直播间
|
|
window.enter.click(function() {
|
|
setTimeout(function() {
|
|
launchApp("小红书");
|
|
sleep(3000);
|
|
click("直播");
|
|
sleep(2000);
|
|
|
|
// 随机点击一个推荐的直播间
|
|
let x = random(100, 900); // 根据直播间推荐区域的 x 坐标范围
|
|
let y = random(600, 2200); // 根据直播间推荐区域的 y 坐标范围
|
|
click(x, y);
|
|
}, 0);
|
|
});
|
|
|
|
window.push.click(function() {
|
|
// 自动发帖的代码...
|
|
setTimeout(function() {
|
|
launchApp("小红书");
|
|
sleep(3000);
|
|
id("dx0").findOne().click();
|
|
sleep(2000);
|
|
id("bf3").className("android.widget.TextView").text("文字").findOne().parent().click();
|
|
sleep(2000);
|
|
id("caz").findOne().click();
|
|
sleep(2000);
|
|
id("c3z").findOne().setText("hello,xiaohongshu");
|
|
id("bey").findOne().click();
|
|
sleep(6000);
|
|
id("g5p").findOne().click();
|
|
sleep(2000);
|
|
id("amn").findOne().click();
|
|
}, 0);
|
|
});
|
|
|
|
window.comment.click(function() {
|
|
// 自动评论的代码...
|
|
setTimeout(function() {
|
|
launchApp("小红书");
|
|
sleep(3000);
|
|
click("直播");
|
|
sleep(2000);
|
|
let x = random(100, 900);
|
|
let y = random(600, 2200);
|
|
click(x, y);
|
|
|
|
let comments = ["廖老师帅爆了", "柯老师666", "软工", "龙卷风摧毁停车场", "23333"];
|
|
for (let i = 0; i < 5; i++) {
|
|
let commentText = comments[random(0, 4)];
|
|
let commentInput = text("说点什么…").findOne(5000);
|
|
commentInput.click();
|
|
sleep(1000);
|
|
setText(commentText);
|
|
sleep(1000);
|
|
text("发送").findOne(5000).click();
|
|
sleep(1000);
|
|
}
|
|
}, 0);
|
|
});
|
|
|
|
window.follow.click(function() {
|
|
// 自动关注和滑屏的代码
|
|
setTimeout(function() {
|
|
launchApp("小红书");
|
|
sleep(3000);
|
|
click("直播");
|
|
sleep(2000);
|
|
let x = random(100, 900);
|
|
let y = random(600, 2200);
|
|
click(x, y);
|
|
|
|
// 开始自动关注并滑屏
|
|
for (let i = 0; i < 6; i++) { // 执行6次
|
|
click(900, 900); // 点赞位置
|
|
sleep(1500);
|
|
click("关注");
|
|
sleep(1500);
|
|
swipe(500, 1500, 500, 500, 100); // 向上滑屏
|
|
sleep(2000);
|
|
}
|
|
}, 0);
|
|
});
|
|
|
|
threads.start(function() {
|
|
while (true) { sleep(1000); }
|
|
});
|