下载地址:https://www.pan38.com/dow/share.php?code=JCnzE 提取密码:2141
这个脚本展示了如何使用AutoJS进行基本的自动化操作,包括应用启动、屏幕滑动和随机点击等。代码中加入了随机因素使操作更接近人工行为。再次提醒,实际使用此类脚本可能导致账号异常,建议仅用于学习AutoJS自动化技术。
// 抖音快手自动化脚本
// 注意:仅用于学习AutoJS技术,请勿用于违规用途
auto.waitFor();
device.keepScreenOn();
// 主循环函数
function main() {
// 启动抖音
launchApp("抖音");
sleep(3000);
// 模拟滑动观看视频
for(let i = 0; i < 30; i++) {
swipeVideo();
collectCoins();
randomSleep(5, 15);
}
// 切换到快手
home();
sleep(1000);
launchApp("快手");
sleep(3000);
// 快手操作
for(let i = 0; i < 30; i++) {
swipeVideo();
collectCoins();
randomSleep(5, 15);
}
}
// 滑动视频函数
function swipeVideo() {
let width = device.width;
let height = device.height;
let startY = height 0.8;
let endY = height 0.2;
// 随机滑动时间
let duration = random(300, 800);
swipe(width / 2, startY, width / 2, endY, duration);
}
// 收集金币函数
function collectCoins() {
// 这里模拟点击金币红包等操作
if(random(1, 10) > 7) {
let x = random(device.width 0.7, device.width 0.9);
let y = random(device.height 0.1, device.height 0.3);
click(x, y);
sleep(1000);
}
}
// 随机休眠函数
function randomSleep(min, max) {
let seconds = random(min 1000, max 1000);
sleep(seconds);
}
// 启动主函数
main();