B2B网络软件

标题: AIWROK软件完整的例子脚本分享1 [打印本页]

作者: YYPOST群发软件    时间: 前天 06:56
标题: AIWROK软件完整的例子脚本分享1


AIWROK软件完整的例子脚本分享1
https://www.yuque.com/aiwork/nba2pr/mf8wfx4tw5ct3rf2  这里下载附件


AIWROK软件完整的例子脚本分享1 B2B网络软件
AIWROK软件完整的例子脚本分享1 B2B网络软件

这段代码是一个使用AutoApp安卓自动化IDE编写的脚本,主要用于自动化操作名为“红果短视频”的应用程序。脚本的主要功能包括登录应用、播放视频、领取奖励和签到等操作。以下是对代码的详细说明:
  1. /*
  2.    欢迎使用AutoApp安卓自动化IDE
  3.    帮助文档: http://help.autoapp.net.cn
  4.    官方地址: www.aiwork24.com
  5.    qq群: 711841924
  6. */

  7. // console.debug(Math.floor(time.nowStamp()/1000))
  8. // stopAll()

  9. var mobile = uiText.findByID(控件ID="mobile").getText()
  10. var password = uiText.findByID(控件ID="password").getText()


  11. require("f.js")
  12. require("api.js")
  13. init()


  14. console.debug(mobile)
  15. console.debug(password)

  16. var data = { "mobile" : mobile, "password" : password, oaid: device.getOAID() }

  17. //data = new map().add('a','1')
  18. //console.debug( data )


  19. var res = login(data)
  20. console.debug(res.data.msg)


  21. function login_check( data ){
  22.         if ( data.data.msg == "登录成功" ){
  23.                 return true
  24.         }else{
  25.                 win.show();
  26. //                login_check( login(data) )
  27.                 stop()
  28.         }
  29. }

  30. login_check( login(data) )

  31. toast.show('登录成功')
  32. notice("红果短视频")

  33. var apf={}
  34. var ocrres

  35. apf.ocr={}
  36. apf.ocr['首页'] = {
  37.    ocr:[0.0509,0.8841, 0.2546,0.9518],
  38.    check:['首页'],
  39.    click:[0.3819,0.8997]
  40. }

  41. app.openApp('com.phoenix.read')

  42. //统计当前 界面
  43. var uiCount = 0;
  44. // 设置一种总轮数
  45. var run_time = 0;
  46. // 当前界面的镜像
  47. var uiSave = "";

  48. var play_time = nowTime()
  49. var play_time_used = 60*5
  50. var get_money_key = true


  51. while (true){
  52.     let img= screen.screenShotFull()
  53.     var lunRes = false
  54.     ocrres = img.MLKitOcr('zhs');
  55.     if ( uiSave  != ocrres ){
  56.             uiSave = ocrres
  57.             uiCount = 0
  58.     }else{
  59.             uiCount++
  60.             console.debug(uiCount)
  61.     }

  62.     if( nowTime() - play_time > play_time_used || uiCount > 10 ){
  63.         play_time = nowTime()
  64.             app.openApp('com.phoenix.read')
  65.     }
  66.     ocrres = JSON.parse(ocrres)
  67.    
  68.     for(let i=0;i<ocrres.length;i++){
  69.             console.debug(ocrres[i].text)
  70.     }

  71.     lunRes = hid_ocr_do(img, apf.ocr['首页'], true) || lunRes

  72.     if ( hid_ocr_all_like_once(ocrres, ['く第00集'], false, 1, 60) && hid_ocr_all_like_once(ocrres, ['倍速'], false, 1, 60) ){
  73.         console.debug("正在播放,视频")
  74.         delay(10)
  75.     }

  76.     var first_money = ['1.00元', '立即提现', '去支付宝绑定', '同意']
  77.     if (get_money_key && hid_ocr_all_like_once(ocrres, ['立即提现'], true, 15, 90)){
  78.         get_money_key = false
  79.         for(let i=0;i<first_money.length;i++){
  80.             let img= screen.screenShotFull()
  81.             hid_ocr_all_like(img, first_money[i], true, 15, 80)
  82.         }
  83.         hid.back()
  84.     }

  85.     lunRes = hid_ocr_all_like_once(ocrres, ['开宝箱得全币'], true, 1 ,80) || lunRes
  86.     lunRes = hid_ocr_all_once(ocrres, ['看视频最高再领','看视频再领', '去福利和页领', '立即领取'], true,1,80) || lunRes
  87.     lunRes = hid_ocr_all_like_once(ocrres, ['领取成功','领取戍功', '领取戌功'], [0.9051,0.0625], 1, 80) || lunRes
  88.     lunRes = hid_ocr_all_like_once(ocrres, ['关闭'], true,1, 80) || lunRes
  89.    
  90.     //第一个参数,图像,要查询的值【可以用数组表示,多个值,有一个包含就会判断成功】,是否点击,点后的等待时间,相似度
  91.     lunRes = hid_ocr_all_like_once(ocrres, ['领取奖励'], true,1, 80) || lunRes
  92.     if ( hid_ocr_all_like_once(ocrres, ['去看剧'], true,1,80)){
  93.             hid_click([Math.random(),Math.random()], 5)
  94.     }

  95.     lunRes = hid_ocr_all_like_once(ocrres, ['待颌取'], true, 1, 80) || lunRes
  96.     lunRes = hid_ocr_all_like_once(ocrres, ['立即签到+888金币', '立即签到', '去签到'], true, 1,80) || lunRes
  97.     lunRes = hid_ocr_all_like_once(ocrres, ['继续观看'], true, 15, 80) || lunRes

  98.     if ( hid_ocr_all_like_once(ocrres, ['更多直播', '已完结共00集'], false, 1, 80) ){
  99.             hid.back()
  100.             delay(2)
  101.     }
  102.    
  103.     run_time++
  104.     if(run_time%3 == 0  && !lunRes){
  105.         hid.back()
  106.     }

  107.     delay(3)
  108. }
复制代码









欢迎光临 B2B网络软件 (http://bbs.niubt.cn/) Powered by Discuz! X3.2