1- const VERSION = '2023618-O '
1+ const VERSION = '20231111-F '
22
33if ( ! auto . service ) {
44 toast ( '无障碍服务未启动!退出!' )
@@ -153,7 +153,7 @@ try {
153153 sleep ( 8000 )
154154 return findTask ( )
155155 }
156- if ( ! ( taskName . match ( / 淘 金 币 | 提 醒 | 开 通 | 续 费 | 乐 园 | 话 费 | 斗 地 主 | 消 消 乐 | 流 浪 猫 | 开 8 8 | 扔 喵 币 | 占 领 | 邀 请 | 登 录 | 组 队 | 参 与 | 施 肥 | 浇 水 | 特 价 版 | 小 鸡 | 消 除 | 穿 搭 | 森 林 | 点 淘 | 人 生 | 我 的 淘 宝 | 庄 园 | 支 付 宝 | 点 击 人 物 | 省 钱 卡 | 年 卡 | 积 分 / ) || content . match ( / 小 互 动 | 开 通 / ) ) ) {
156+ if ( ! ( taskName . match ( / 首 页 | 提 醒 | 开 通 | 续 费 | 乐 园 | 话 费 | 斗 地 主 | 消 消 乐 | 流 浪 猫 | 开 8 8 | 扔 喵 币 | 占 领 | 邀 请 | 登 录 | 组 队 | 参 与 | 施 肥 | 浇 水 | 特 价 版 | 小 鸡 | 消 除 | 穿 搭 | 森 林 | 点 淘 | 人 生 | 我 的 淘 宝 | 庄 园 | 支 付 宝 | 点 击 人 物 | 省 钱 卡 | 年 卡 | 积 分 | 答 题 | 分 享 | 订 阅 | 连 连 消 / ) || content . match ( / 小 互 动 | 开 通 / ) ) ) {
157157 return [ taskName , jumpButtons [ i ] , content ]
158158 }
159159 }
@@ -163,11 +163,15 @@ try {
163163
164164 function backToList ( ) {
165165 console . log ( '返回' )
166+ if ( textContains ( '当前已有金币' ) . exists ( ) ) {
167+ console . log ( '已在任务列表' )
168+ return
169+ }
166170 back ( )
167171 sleep ( 1000 )
168172 let flag = 0
169173 for ( let i = 0 ; i < 3 ; i ++ ) {
170- if ( ! textContains ( '累计任务奖励 ' ) . findOne ( 5000 ) ) {
174+ if ( ! textContains ( '当前已有金币 ' ) . findOne ( 5000 ) ) {
171175 if ( currentActivity ( ) == 'com.taobao.tao.TBMainActivity' ) {
172176 console . log ( '返回到了主页,请重新运行任务!' )
173177 quit ( )
@@ -262,7 +266,7 @@ try {
262266 // console.log('请手动切换回主页面')
263267 // device.cancelKeepingAwake()
264268 // quit()
265- if ( textContains ( '累计任务奖励 ' ) . exists ( ) ) {
269+ if ( textContains ( '当前已有金币 ' ) . exists ( ) ) {
266270 console . log ( '店铺已主动返回,继续任务' )
267271 return
268272 }
@@ -280,8 +284,8 @@ try {
280284 function getCoin ( ) {
281285 console . log ( '获取喵币数量' )
282286 try {
283- let e = textContains ( '我的喵币 ' ) . findOnce ( )
284- let num = e . text ( ) . match ( / ( \d * ) 个 / ) [ 1 ]
287+ let e = textContains ( '当前已有金币 ' ) . findOnce ( )
288+ let num = e . parent ( ) . child ( 2 ) . child ( 1 ) . text ( ) . match ( / ( [ \d \. ] * ) 万 \/ / ) [ 1 ]
285289 console . log ( '当前共有' , num , '喵币' )
286290 return num
287291 } catch ( err ) {
@@ -295,7 +299,7 @@ try {
295299 if ( autoOpen ) {
296300 // 打开淘宝活动页面
297301 console . log ( '正在打开淘宝...' )
298- var url = 'pages.tmall.com/wow/z/hdwk/hd2023618/home ?disableNav=YES&qd_from=tbsybutton'
302+ var url = 'pages.tmall.com/wow/z/hdwk/d11fy24/singleplayer ?disableNav=YES&qd_from=tbsybutton'
299303
300304 app . startActivity ( {
301305 action : "VIEW" ,
@@ -304,23 +308,23 @@ try {
304308 sleep ( 2000 )
305309
306310 console . log ( '等待页面加载...' )
307- textContains ( '赚猫币 ' ) . findOne ( 20000 )
311+ textContains ( '戳我赚金币 ' ) . findOne ( 20000 )
308312 console . log ( '准备打开任务列表' )
309313 // sleep(10000)
310314
311- let c = textContains ( '赚猫币 ' ) . findOne ( 20000 )
315+ let c = textContains ( '戳我赚金币 ' ) . findOne ( 20000 )
312316 if ( c ) {
313317 console . log ( '使用默认方法尝试打开任务列表' )
314318 sleep ( 1000 )
315- c . click ( )
319+ c . parent ( ) . parent ( ) . child ( c . parent ( ) . parent ( ) . childCount ( ) - 2 ) . click ( )
316320 sleep ( 1000 )
317321 c . click ( )
318322 console . log ( '已点击,未能打开建议手动点击一下任务列表。此问题并非bug,和网络以及设备性能有关。' )
319323 console . log ( '检测任务列表,准备进行二次尝试' )
320324 } else {
321325 throw '无法找到任务列表入口'
322326 }
323- if ( ! textContains ( '累计任务奖励 ' ) . findOne ( 8000 ) ) {
327+ if ( ! textContains ( '当前已有金币 ' ) . findOne ( 8000 ) ) {
324328 console . log ( '默认方式打开失败,二次尝试' )
325329 console . log ( '首先检测弹窗' )
326330 for ( let i = 0 ; i < 2 && text ( '关闭' ) . findOne ( 2000 ) ; i ++ ) { // 关闭弹窗
@@ -330,20 +334,16 @@ try {
330334 }
331335 console . log ( '已试图自动关闭弹窗。有未能自动关闭的弹窗请手动关闭' )
332336 sleep ( 5000 )
333- // let right = c.bounds().right
334- // let left = c.bounds().left
335- // let top = c.bounds().top
336- // let bottom = c.bounds().bottom
337- // click(random(right,left), random(top, bottom))
337+ c = c . parent ( ) . parent ( ) . child ( c . parent ( ) . parent ( ) . childCount ( ) - 2 )
338338 click ( c . bounds ( ) . centerX ( ) , c . bounds ( ) . centerY ( ) )
339339 console . log ( '已点击,等待任务列表出现' )
340- if ( ! textContains ( '累计任务奖励 ' ) . findOne ( 8000 ) ) {
340+ if ( ! textContains ( '当前已有金币 ' ) . findOne ( 8000 ) ) {
341341 throw '无法打开任务列表'
342342 }
343343 }
344344 } else {
345345 console . log ( '请在30秒内打开淘宝活动页,并打开任务列表' )
346- if ( textContains ( '累计任务奖励 ' ) . findOne ( 30000 ) ) {
346+ if ( textContains ( '当前已有金币 ' ) . findOne ( 30000 ) ) {
347347 console . log ( '已打开,继续任务' )
348348 } else {
349349 console . log ( '未能检测到任务列表,退出' )
@@ -371,7 +371,7 @@ try {
371371
372372 if ( awardButtons ) {
373373 for ( var i = 0 ; i < awardButtons . length ; i ++ ) {
374- console . log ( '领取累计任务奖励 ' )
374+ console . log ( '领取当前已有金币 ' )
375375 awardButtons [ i ] . click ( )
376376 console . log ( '等待5秒再次领取...' )
377377 sleep ( 5000 )
@@ -398,12 +398,12 @@ try {
398398 liulan ( )
399399 sleep ( 2000 )
400400 }
401- back ( )
401+ backToList ( )
402402 } else if ( jumpButton [ 0 ] . match ( / .* 玩 游 戏 .* | .* 浏 览 餐 饮 卡 券 .* | .* 加 油 赛 .* | .* 赚 星 星 .* / ) ) {
403403 console . log ( '进行' + jumpButton [ 0 ] + '任务,10秒后返回' )
404404 jumpButton [ 1 ] . click ( )
405405 sleep ( 10000 )
406- back ( )
406+ backToList ( )
407407 } else if ( jumpButton [ 0 ] . match ( / 领 现 金 / ) ) {
408408 console . log ( '进行' + jumpButton [ 0 ] + '任务' )
409409 jumpButton [ 1 ] . click ( )
@@ -414,7 +414,7 @@ try {
414414 }
415415 into . click ( )
416416 liulan ( )
417- } else if ( jumpButton [ 0 ] . match ( / 搜 一 搜 / ) ) {
417+ } else if ( jumpButton [ 0 ] . match ( / 搜 一 搜 [ ^ # ] / ) ) {
418418 console . log ( '进行' + jumpButton [ 0 ] + '任务' )
419419 jumpButton [ 1 ] . click ( )
420420 console . log ( '等待搜索' )
0 commit comments