1

用 js 写应用的自动化辅助脚本, 有什么框架适合这种逻辑?

 2 years ago
source link: https://www.v2ex.com/t/821863
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

用 js 写应用的自动化辅助脚本, 有什么框架适合这种逻辑?

  FaiChou · FaiChou · 10 小时 7 分钟前 · 366 次点击

使用 autojs 来写应用的自动化辅助脚本, 比如「抖音养号(浏览 /关注 /点赞)」「蚂蚁森林收取能量」「游戏日常任务」等.

这类脚本的特征是几种任务状态的转化.

拿游戏日常任务来举例, 脚本启动后:

  1. 打开游戏程序, 登陆等操作
  2. 进入首页, 判断各种弹框, 领取奖励
  3. 进入聊天频道, 抢悬赏
  4. 抢到悬赏, 判断是否已完成悬赏任务, 未完成则准备
  5. 进入战斗, 开大招打完一套. 胜利点击确定进入下一轮抢悬赏, 失败则重新准备或者退出悬赏
  6. 每小时进行通灵兽巡逻任务
  7. 每小时检测修炼任务
  8. 时刻准备着有邀请弹框
  9. 游戏卡住几分钟, 杀死程序重启

像以上这种逻辑任务, 状态机合适吗? 用 redux-saga (without redux)? 还有什么设计模式适合这种程序任务?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK