Auto.js 自动刷抖音极速版广告/宝箱任务
上次做了一个利用 Auto.js 自动刷快手极速版看广告领金币的任务脚本。这次来做一个抖音的。相对来说,抖音的稍微复杂一点。不过也没复杂到哪里去。多了一个随机坐标拟真操作。再多了一个循环定时的函数。
脚本源码:
adTime = 40000 + random(1000, 5000)
gapTime = 60000 * 21 + random(1000, 5000)
function click_bounds(obj) {
  var point = obj.bounds()
  click(point.centerX() + random(0, 10), point.centerY() + random(0, 10))
}
function closeAd() {
  if (desc('返回').exists()) {
    back()
    sleep(1000)
    back()
    sleep(1000)
  } else {
    back()
    sleep(1000)
  }
}
function runTask() {
  click_bounds(text('去领取').findOnce())
  sleep(adTime)
  closeAd()
  if (text('领取奖励').exists()) {
    click_bounds(text('领取奖励').findOnce())
    sleep(adTime)
    closeAd()
  }
}
function treasureBox() {
  click_bounds(text('开宝箱得金币').findOnce())
  sleep(3000)
  click_bounds(text('看广告视频再赚').findOnce())
  sleep(adTime)
  closeAd()
  if (text('领取奖励').exists()) {
    click_bounds(text('领取奖励').findOnce())
    sleep(adTime)
    closeAd()
  }
}
function main() {
  while (!text('去领取').exists()) {
    toast('请打开任务界面')
  }
  runTask()
  sleep(5000)
  treasureBox()
}
main()
setInterval(main, adTime)
			 
                 
16:06:38.942/E: TypeError: Cannot call method "bounds" of null ([remote]test.js#13)
TypeError: Cannot call method "bounds" of null
at click_bounds ([remote]test.js:13:0)
at runTask ([remote]test.js:30:0)
at main ([remote]test.js:57:0)
at [remote]test.js:62:0
我用的6.5.8是不是没有这个bounds的方法了?现在找好像找不着这些按钮了。大佬有什么新方法吗?
bounds方法依然存在,报错的原因是因为你的元素没有找到。btw, 现在很多人都move到autox.js了。
哈哈,博主到手了多少钱钱哈。
不明觉历。
刷完第2个广告就报错了,为什么