暗影格斗3吧 关注:43,069贴子:1,170,870
  • 11回复贴,共1

分享一下按键精灵的脚本,几乎涵盖所有意外情况,主页面,活动页

只看楼主收藏回复

分享一下按键精灵的脚本,几乎涵盖所有意外情况,主页面,活动页面,战斗过程都可识别,战斗过程暂停脚本重新运行会识别处于战斗,广告或者主页面特殊情况卡住会自动重启,主要是分享下思路,适合有一定脚本基础的参考,毕竟各机型分辨率不同 按键精灵没有暂停真是麻烦,有时候打一半我想调亮度啥的,停止脚本又得从头运行,所以加入了识别是否处于战斗并转跳战斗


IP属地:广东来自iPhone客户端1楼2023-06-13 19:29回复
    Dim rColor, intA, intB,t,i
    t = 1 //换数字可快速切换点击活动的点位
    Rem 找图
    i = 1
    Do
    ShowMessage "开始找图"
    Delay 1200
    rColor = GetPixelColor(318,115, 0)//装备的红色角标,也可主页其他任意一个红点
    If rColor = "2828C6" Then
    ShowMessage "处于主页面"
    Delay 1200
    Tap 520,980 //点击活动
    Delay 1200
    End If
    rColor = GetPixelColor(169,454, 0)//选择打哪个活动页面任意一个活动图标内一个点的颜色,最好选择图标放大后同点颜色也一样点,识别到即视为进入活动界面了
    If rColor = "62132E" Then
    Delay 1000 //确定点击哪个活动
    If t = 1 Then
    Tap 145,455 //点击趁火打劫
    Delay 1000
    Tap 70,1100 //点击战斗
    Delay 1000
    Goto 确定战斗
    ElseIf t = 2 Then
    Tap 230,500 //点击贪婪的代价
    Delay 1000
    Tap 70,1100 //点击战斗
    Delay 1000
    Goto 确定战斗
    ElseIf t = 3 Then
    Tap 370,565 //点击暗影护卫
    Delay 1000
    Tap 70,1100 //点击战斗
    Delay 1000
    Goto 确定战斗
    End If
    End If


    IP属地:广东来自iPhone客户端4楼2023-06-13 19:41
    回复
      FindPic 697,25,740,71, "Attachment:弹窗关闭.png", "050505", 0, 0.8, intA, intB //弹窗左上角的×
      If intA > -1 and intB > -1 Then
      ShowMessage "找到弹窗"
      Delay 1000
      Tap intA, intB
      End If
      FindColor 672,616,709,620, "E5EAC5", 0, 1.0, intA, intB//血条与时间中间的高亮条的区域选一个中间区域的颜色,范围限制在高亮条的区域内,找到颜色即处于战斗
      If intA > -1 Then
      ShowMessage "处于战斗"
      Goto 战斗
      Else
      ShowMessage "不在战斗"
      End If
      FindPic 185,919,220,979, "Attachment:广告出错.png", "050505", 0, 0.8, intA, intB
      If intA > -1 and intB > -1 Then
      ShowMessage "广告出错"
      Tap intA + 5, intB + 5 //点击广告出错窗口的确定
      Delay 1000
      Tap 70,1220 //点击继续
      Delay 500
      End If
      FindPic 184,841,220,899, "Attachment:关闭特惠.png", "050505", 0, 0.8, intA, intB
      If intA > -1 and intB > -1 Then
      ShowMessage "找到特惠弹窗"
      Delay 1000
      Tap intA +8, intB +8
      End If
      FindPic 192,803,227,837, "Attachment:以后再说.png", "050505", 0, 0.9, intA, intB
      If intA > -1 and intB > -1 Then
      ShowMessage "找到以后再说"
      Delay 1000
      Tap intA +8, intB +8
      End If
      FindPic 58, 1203, 86, 1257, "Attachment:复制人继续.png", "101010", 0, 0.8, intA, intB //防止看广告没正常退出增加一个点击继续
      If intA > -1 and intB > -1 Then
      Delay 500
      ShowMessage "找到继续"
      Tap intA + 8, intB + 8
      Delay 800
      End If
      FindPic 697,29,743,85, "Attachment:返回主页.png", "101010", 0, 0.4, intA, intB //装备等页面的左上角返回图标,误触可自动退出
      If intA > -1 and intB > -1 Then
      ShowMessage "找到返回按钮"
      Delay 800
      Tap intA , intB
      End If
      i = i + 1
      If i =80 Then //大概100秒没进入战斗就重启
      ShowMessage "卡住了,正在重启"
      Delay 3000
      KillApp "com.nekki.shadowfight3"
      Delay 3000
      RunApp "com.nekki.shadowfight3"
      Delay 45000 //等待45秒后重启脚本
      RestartScript
      End If
      Loop


      IP属地:广东来自iPhone客户端5楼2023-06-13 19:41
      回复
        Rem 确定战斗 //可加可不加,旧设备速度慢可能点击没反应所以加了个确定的步骤
        Delay 500
        FindPic 511,841,552,899, "Attachment:结束界面.png", "000000", 0, 0.8, intA, intB //进入战斗的过渡画面任意一个特色区域即可
        If intA > -1 and intB > -1 Then
        ShowMessage "进入战斗"
        Delay 4500
        Goto 战斗
        Else
        Goto 找图
        End If
        Rem 战斗
        Do
        Touch 216,372,230
        Tap 50,980
        Delay 60
        Tap 50,980 //50,980(脚踢和战斗 )230,1230(拳)
        FindPic 58, 1203, 86, 1257, "Attachment:复制人继续.png", "101010", 0, 0.8, intA, intB
        If intA > -1 and intB > -1 Then
        ShowMessage "战斗结束"
        Exit Do
        End If
        Loop
        Delay 1500
        FindPic 500,448,580,1280, "Attachment:奖励卡牌新.png", "101010", 1, 0.5, intA, intB //识别奖励卡牌文字部分,找不到就重启,可加可不加
        If intA > -1 and intB > -1 Then
        ShowMessage "找到奖励卡牌"
        Delay 1000
        Tap intA -190, intB //点击奖励卡牌
        Else
        ShowMessage "没找到奖励卡牌,即将重启"
        Delay 3000
        KillApp "com.nekki.shadowfight3"
        Delay 3000
        RunApp "com.nekki.shadowfight3"
        Delay 45000
        RestartScript
        End If
        ShowMessage "广告环节"
        Delay 10000 //等待时间可调
        i = 1
        Do While true
        ShowMessage "关闭广告中"
        Tap 722,1306
        Delay 1000
        Tap 708, 47
        Delay 1000
        Tap 722,1306
        Delay 800
        Tap 43, 20
        Delay 800
        Tap 225,800
        FindPic 58, 1203, 86, 1257, "Attachment:复制人继续.png", "101010", 0, 0.7, intA, intB
        If intA > -1 and intB > -1 Then
        Exit Do
        End If
        i = i + 1
        If i = 40 Then
        ShowMessage "卡住了,正在重启"
        Delay 3000
        KillApp "com.nekki.shadowfight3"
        Delay 3000
        RunApp "com.nekki.shadowfight3"
        Delay 45000
        RestartScript
        End If
        Loop
        Delay 2800
        Tap intA + 5, intB + 5 //点击继续返回主页面
        Delay 1500


        IP属地:广东来自iPhone客户端6楼2023-06-13 19:42
        回复
          拉,🐔百毒,天天吞链接,搞不懂了,本来想发个阿里云盘直接整个txt分享,吞了好几次


          IP属地:广东来自iPhone客户端7楼2023-06-13 19:50
          回复


            IP属地:四川来自Android客户端8楼2023-06-13 20:06
            回复
              小白看不懂


              IP属地:河南来自Android客户端10楼2023-06-13 21:56
              收起回复
                话说小白不懂这样的会不会让手机更热,本来用简单的就热的够呛


                IP属地:河北来自Android客户端11楼2023-06-13 23:26
                收起回复
                  这个是给iOS越狱设备用的脚本,安卓直接用自动精灵有老哥分享脚本,当然好像也有按键精灵安卓版,附件,找图范围,还有点位自己换一下其他的思路都一样


                  IP属地:广东来自iPhone客户端12楼2023-06-14 00:17
                  回复