auto.js脚本自动点击屏幕双11自动领金币
auto软件和js脚本在本人的csdn的上传资源下载
js脚本操作手机屏幕的代码
auto.waitFor();
var height = device.height;
var width = device.width;
toast("\n设备宽" + width + "\n" + "设备高" + height + "\n" + "手机型号" + device.model + "\n安卓版本" + device.release)
if (height == 1920) { //设置脚本坐标点击所适合的屏幕宽高。
setScreenMetrics(1080, 1920);
toast("设备高" + height);
} else if (height == 2340) {
setScreenMetrics(1080, 2340);
toast("设备高"+height);
}
click(547,1264);//点猫 领金币
// //浏览15秒领金币
sleep(1500);
click(911,1716);
sleep(1500);
if(text("签到").exists()){
text("签到").findOne().click();
sleep(1600);
toast("签到成功")
}
sleep(1500);
while(text("去进店").exists()){
//要支持的动作
toast("存在去进店");
text("去进店").findOne().click();
sleep(2500);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(3500);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(10000);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(9000);
back();
sleep(1000);
}
while(text("去浏览").exists()){
//要支持的动作
toast("存在去浏览");
text("去浏览").findOne().click();
sleep(1500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(2500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(10000);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(8000);
back();
sleep(1600);
}
toast("结束");
改进版
auto.waitFor();
var height = device.height;
var width = device.width;
toast("\n设备宽" + width + "\n" + "设备高" + height + "\n" + "手机型号" + device.model + "\n安卓版本" + device.release)
if (height == 1920) { //设置脚本坐标点击所适合的屏幕宽高。
setScreenMetrics(1080, 1920);
toast("设备高" + height);
lingqu()
} else if (height == 2340) {
setScreenMetrics(1080, 2340);
toast("设备高" + height);
lingqu()
}
else if (height == 2160) {
setScreenMetrics(1080, 2160);
toast("设备高" + height);
lingqu();
}
function lingqu() {
app.launchApp("手机淘宝");
toast("打开淘宝")
sleep(6000);
click(600, 1235);//进入活动页
sleep(6000);
click(547, 1264);//点猫 领金币
// //浏览15秒领金币
sleep(1500);
click(911, 1716);
sleep(1500);
if (text("签到").exists()) {
text("签到").findOne().click();
sleep(1600);
toast("签到成功")
}
sleep(1500);
while (text("去进店").exists()) {
//要支持的动作
toast("存在去进店");
text("去进店").findOne().click();
sleep(2500);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(3500);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(10000);
swipe(width / 2, height - 600, width / 2, 0, 500);
sleep(9000);
back();
sleep(1000);
}
while (text("去浏览").exists()) {
//要支持的动作
toast("存在去浏览");
text("去浏览").findOne().click();
sleep(1500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(2500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(10000);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(8000);
back();
sleep(1600);
}
toast("结束");
}
本文来自博客园,作者:JackieDYH,转载请注明原文链接:https://www.cnblogs.com/JackieDYH/p/17634570.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现