Skip to content

Instantly share code, notes, and snippets.

@fzls
Created November 14, 2020 09:41
Show Gist options
  • Save fzls/755ed3043090001a94a1377f727795d7 to your computer and use it in GitHub Desktop.
Save fzls/755ed3043090001a94a1377f727795d7 to your computer and use it in GitHub Desktop.
使用autojs来自动进行微信dnf签到的参考脚本
// re:先强制使用坐标来控制
DefaultSleepTime = 3000
function log(msg) {
console.info(msg)
toast(msg)
}
auto.waitFor()
if (!device.isScreenOn()) {
device.wakeUp();
sleep(1000);
//下拉状态栏
swipe(500, 30, 500, 1000, 300);
sleep(1000);
//点击时间
click(250, 230);
sleep(2000);
}
log("打开微信");
launchApp("微信");
sleep(DefaultSleepTime)
log("先确保跳到首页");
for (let i = 0; i < 5; i++) {
click(50, 135)
sleep(1000)
}
log("点击 [微信] tab");
click(140, 2075)
sleep(DefaultSleepTime)
log("双击跳到最上方");
click(50, 135)
click(50, 135)
sleep(DefaultSleepTime)
log("点击 [文件助手] 对话框");
click(500, 370)
sleep(DefaultSleepTime)
log("点击 [签到页面] 聊天记录");
click(450, 1870)
sleep(DefaultSleepTime)
// 为了保险起见,多点几次
for (let i = 0; i < 5; i++) {
log("点击 [签到] 按钮");
click(535, 1370)
sleep(DefaultSleepTime)
}
// 运行完毕后展示console
log("操作完成,请看看是否签到完成了")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment