使用按键精灵助手制作精灵手游辅助跑位打怪加血修装备卖垃圾脚本

最近没事玩了下手游,由于太穷没有钱买挂机卡,于是自己手动写了个挂机脚本,用起来非常稳定,非常NICE,总体来说实现简单功能非常简单,就只是需要点点点即可

脚本内容基本是以下内容,可以自动修理装备,购买药水,以及跑位到怪点打怪,最新增加了自动保存不锈钢和经验加成装备到仓库的功能

源文件如下:

//SetScreenScale 960,540,1 // 屏幕缩放,不是这个比例的请去掉注释
//以下配置可能不同模拟器或者电脑需要重新取色
Dim bloodPixelColor = "0E27BB" //血条固定位置颜色(GetPixelColor(200, 45))
Dim bluePixelColor = "6B5A29" //魔条固定位置颜色(GetPixelColor(120, 60))
Dim autoButtoColor = "9EF0F8" //挂机按钮位置颜色(GetPixelColor(930, 260))
//以下配置不用修改
Dim packBloodPng = "Attachment:blood.png|Attachment:top.png" //背包高级|顶级药水颜色)
Dim destroyTabPng = "Attachment:drop_brown.png|Attachment:drop_green.png|Attachment:drop_green2.png" //摧毁标签
Dim dropItemPng = "Attachment:molao2.png|Attachment:xlb.png|Attachment:jianlao2.png" //摧毁物品{魔牢卷|小喇叭|监牢卷}
Dim stonePng = "Attachment:xls.png|Attachment:dzs.png|Attachment:szs.png" //保存仓库物品{洗练石|锻造石|神铸石}
Dim arriveAtPng = "Attachment:s4.png|Attachment:d3.png|Attachment:sd2.png|Attachment:sd2_2.png|Attachment:sd3.png" //跑位目的地小地图
Dim checkTransferPng = "Attachment:s3.png|Attachment:sd1.png"
Dim scrollPng = "Attachment:go_back.png" //回城卷
Dim ghostScrollGreen = "Attachment:ghost_scroll_green.png" //鬼城回城卷颜色
Dim saveTabPng = "Attachment:save.png|Attachment:save1.png" //保存标签
Dim packEmptyPng = "Attachment:empty_pack.png" //空背包格子
Dim cityPng = "Attachment:lcd_city.png" //理查登小地图
Dim otherCityPng = "Attachment:fel_city.png" //菲尔拉小地图
Dim transferPng = "Attachment:lcd_transfer.png" //传送点小地图
Dim ringPng = "Attachment:ring.png" //装备戒指图标
Dim orangePng = "Attachment:orange.png" //橙装色块
Dim purplePng = "Attachment:purple.png" //紫装色块
Dim bluePng = "Attachment:blue.png" //蓝装色块
Dim greenPng = "Attachment:green.png" //绿装色块
Dim whitePng = "Attachment:white.png" //白装色块
//以下可控制一些功能开启和关闭
Dim isMonthCard,isPick,isPosition,isSave,isSave2,isPackUp,isSell,bloodNum,arriveAt
isMonthCard = CInt(ReadUIConfig("isMonthCard")) //月卡用户
isPick = CInt(ReadUIConfig("isPick")) //捡取物品
isPosition = CInt(ReadUIConfig("isPosition")) //跑位
isSave = CInt(ReadUIConfig("isSave")) //保存石头、不锈钢和经验装
isSave2 = CInt(ReadUIConfig("isSave2")) //保存橙装
isPackUp = CInt(ReadUIConfig("isPackUp")) //清理药水
isSell = CInt(ReadUIConfig("isSell")) //售卖垃圾
bloodNum = CInt(ReadUIConfig("bloodNum")) //保留药水数量(格)
arriveAt = CInt(ReadUIConfig("arriveAt")) //0是S4,1是D3,2是SD2,3是SD2三怪点

//加血
Function AddBlood(bloodPixelColor)
    Dim bloodColor
    bloodColor = GetPixelColor(200, 45)
    If bloodColor <> bloodPixelColor Then 
        Tap 660, 430
        TracePrint GetNetworkTime()&" 当前血量不足,正在加血!"
    End If
    Delay 500
End Function

//加魔
Function AddBlue(bluePixelColor)
    Dim blueColor
    blueColor = GetPixelColor(120, 60)
    If blueColor <> bluePixelColor Then 
        Tap 660, 500
        TracePrint GetNetworkTime()&" 当前魔力不足,正在加魔!"
        Delay 500
    End If
End Function

//比对物品
Function ComparisonItem(packColor, comparisonItemColorArray)
    Dim num = 0
    For Each comparisonItemColor In comparisonItemColorArray
        If packColor = comparisonItemColor Then
            num = num + 1
            Exit For
        End If
    Next
    ComparisonItem = num
End Function

//物品和摧毁标签坐标
Function FindPoint(ItemPng, packX1, packY1, packX2, packY2, offsetColor)
    Dim intX, intY, index
    index = FindPic(packX1, packY1, packX2, packY2, ItemPng, "222222", 0, offsetColor, intX, intY)
    FindPoint = Array(intX, intY)
End Function

//查找特殊物品名字坐标
Function LookWord(word, packX1, packY1, packX2, packY2, colorRange, offsetColor)
    Dim ret,str,intX,intY
    ret = SetDict(0, "Attachment:dm_soft.txt")
    If ret = 0 Then
        TracePrint GetNetworkTime()&" 特殊物品库创建失败..."
    End If
    UseDict (0)
    FindStr packX1, packY1, packX2, packY2, word, colorRange, offsetColor, intX, intY 
    LookWord = Array(intX, intY)
End Function

//扫描背包药水并删除多余药水
Function ScanPack(packBloodPng, destroyTabPng, bloodNum)
    Dim i, n, k, v, l, packItemPoint, destroyPoint, space_x, space_y
    Dim pack_x = 439
    Dim pack_y = 155
    Dim t = 0
    For i = 0 To 4
        n = i * 69
        For k = 0 To 4
            v = k * 73
            space_x = (pack_x + v) - 30
            space_y = (pack_y + n) - 30
            packItemPoint = FindPoint(packBloodPng, space_x, space_y, space_x + 60, space_y + 60, 0.6)
            If packItemPoint(0) > -1 Then 
                t = t + 1
                If t > bloodnum Then 
                    Tap packItemPoint(0), packItemPoint(1) //打开
                    Delay 300
                    //Tap 630, 170 //摧毁
                    destroyPoint = FindPoint(destroyTabPng, 590, 100, 930, 300, 0.6)
                    If destroyPoint(0) > -1 Then 
                        Tap destroyPoint(0), destroyPoint(1) //摧毁
                        Delay 300
                        Tap 560, 340 //确认
                        TracePrint GetNetworkTime()&" 成功删除药水..."
                    Else 
                        Tap 900, 290 //找不到摧毁坐标随便点关闭
                        TracePrint GetNetworkTime()&" 无法找到摧毁药水标签"
                    End If
                End If
            End If
        Next
    Next
    scanPack = t
End Function

//查找鬼城回城卷
Function FindGhostScroll(scrollPng, ghostScrollGreen)
	Dim i, n, k, v, l, space_x, space_y, packItemPoint, ghostScrollColor, flag
	Dim pack_x = 410
    Dim pack_y = 120
    For i = 0 To 4
        n = i * 69
        For k = 0 To 4
            v = k * 73
            space_x = pack_x + v
            space_y = pack_y + n
            packItemPoint = FindPoint(scrollPng, space_x, space_y, space_x + 60, space_y + 60, 0.7)
            If packItemPoint(0) > -1 Then 
            	Tap packItemPoint(0), packItemPoint(1)
            	Delay 500
            	ghostScrollColor = FindPoint(ghostScrollGreen, 430, 140, 480, 180, 0.8)
            	Tap 900, 290 //随便点关闭
            	Delay 500
            	If ghostScrollColor(0) > -1 Then 
            		TracePrint GetNetworkTime()&" 找到鬼城回城卷,跳出循环..."
            		flag = 1
            		Exit For	
            	End If
            End If
        Next
        If flag = 1 Then 
        	Exit For
        End If
    Next
    FindGhostScroll = packItemPoint
End Function

//打开仓库扫描背包要存储的物品
Function ScanInventory(stonePng, saveTabPng, packBloodPng, scrollPng, isSave2, ringPng, orangePng, purplePng, bluePng, greenPng, whitePng)
    //首先存储各种石头
    Dim i, n, k, v, l, itemPoint, packItemPoint, space_x, space_y, susItemPoint, expItemPoint, saveTabPoint, flag
    For i = 1 To 8  
        itemPoint = FindPoint(stonePng, 120, 120, 470, 455, 0.7)
        If itemPoint(0) > -1 Then 
            TracePrint GetNetworkTime()&" 已找到石头,即将存入仓库..."
            Tap itemPoint(0), itemPoint(1)
            Delay 500
            saveTabPoint = FindPoint(saveTabPng, 360, 270, 600, 455, 0.7)
            If saveTabPoint(0) > -1 Then 
                Tap saveTabPoint(0), saveTabPoint(1)
            Else 
                Tap 900, 290 //找不到存入标签随便点关闭
            End If
        Else 
            Exit For
        End If
        Delay 500
    Next
    //逐个武器检查,最多检查前25个
    Dim pack_x = 120
    Dim pack_y = 125
    Dim keepItemPng = packBloodPng&"|Attachment:magic.png|"&scrollPng
    For i = 0 To 4
        n = i * 69
        For k = 0 To 4
            v = k * 73
            space_x = pack_x + v
            space_y = pack_y + n
            packItemPoint = FindPoint(keepItemPng, space_x, space_y, space_x + 60, space_y + 60, 0.6)
            If packItemPoint(0) > -1 Then
                TracePrint GetNetworkTime()&" 所有物品检查完毕,准备关闭仓库..."
                flag = 1
                Exit For
            Else 
                Dim ringPoint, point_offset_x, point_offset_y
                TracePrint GetNetworkTime()&" 准备打开武器,查看武器属性..."
                Tap space_x + 30, space_y + 30
                Delay 300
                //先检查是不是戒指,是戒指后面整体增加横向偏移
                ringPoint = FindPoint(ringPng, 115, 65, 190, 135, 0.7)
                If ringPoint(0) > -1 Then 
                    TracePrint GetNetworkTime()&" 当前装备可能是戒指,重新设置存入按钮偏移量..."
                    point_offset_x = 120
                Else 
                    point_offset_x = 0
                End If
                //如果开启保存特色装备优先检测
                If isSave2 = 1 Then 
                    Dim specialPng, specialPoint
                    specialPng = orangePng
                    If ReadUIConfig("purple") Then 
                    	specialPng = specialPng&"|"&purplePng
                    End If
                    If ReadUIConfig("blue") Then 
                    	specialPng = specialPng&"|"&bluePng
                    End If
                    If ReadUIConfig("green") Then 
                    	specialPng = specialPng&"|"&greenPng
                    End If
                    If ReadUIConfig("white") Then 
                    	specialPng = specialPng&"|"&whitePng
                    End If
                    specialPoint = FindPoint(specialPng, 555+point_offset_x, 65, 620+point_offset_x, 105, 0.9)
                    If specialPoint(0) > -1 Then 
                        TracePrint GetNetworkTime()&" 当前物品为保存装备,准备入库..."
                        saveTabPoint = FindPoint(saveTabPng, 600+point_offset_x, 345, 720+point_offset_x, 495, 0.6)
                        If saveTabPoint(0) > -1 Then 
                            Tap saveTabPoint(0), saveTabPoint(1)
                        Else 
                            TracePrint GetNetworkTime()&" 找不到存入标签..."
                            Tap 900, 290 //找不到存入标签随便点关闭
                        End If
                        Goto save_done //跳转到循环到当前循环尾
                    End If
                End If
                TouchDown 500+point_offset_x, 440, 1
                TouchMove 500+point_offset_x, 70, 1, 300
                TouchUp 1
                Delay 300
                susItemPoint = LookWord("不锈钢", 490+point_offset_x, 330, 590+point_offset_x, 500, "8ca6b8-444444", 0.7)
                expItemPoint = LookWord("经验装", 490+point_offset_x, 330, 720+point_offset_x, 500, "aecae0-555555", 0.7)
                If susItemPoint(0) > -1 Or expItemPoint(0) > -1 Then 
                    TracePrint GetNetworkTime()&" 找到特殊装备,正在存入仓库..."
                    saveTabPoint = FindPoint(saveTabPng, 600+point_offset_x, 345, 720+point_offset_x, 495, 0.8)
                    If saveTabPoint(0) > -1 Then 
                        Tap saveTabPoint(0), saveTabPoint(1)
                    Else 
                        Tap 900, 290 //找不到存入标签随便点关闭
                    End If
                Else 
                    Tap 900, 290 //不是特殊物品随便点关闭
                End If
                Rem save_done
                Delay 500
            End If
        Next
        If flag = 1 Then 
            Exit For
        End If
    Next	
    Tap 510, 480 //整理仓库
    Delay 2000
End Function 

//修理售卖装备
Function RepairEquipment(packBloodPng, scrollPng, isSell)
    Dim screen1_color, screen2_color
    Tap 890, 75 //点击小地图
    Delay 1000
    Tap 275, 365 //理查登药店
    Delay 500
    Tap 900, 290 //随便点关闭大地图
    Do While true
        screen1_color = GetPixelColor(250, 150)
        Delay 2000
        screen2_color = GetPixelColor(250, 150)
        If screen1_color = screen2_color Then 
            TracePrint GetNetworkTime()&" 已经到药店开始处理装备!"
            Exit Do
        End If
    Loop
    Tap 740, 340 //打开药店
    Delay 1000
    //出售武器
    If isSell = 1 Then 
        Tap 815, 200 //切换出售标签卡
        Delay 500
        Dim num, packColor, packItemPoint
        Dim keepItemPng = packBloodPng&"|Attachment:magic.png|"&scrollPng 
        For num = 1 To 25
            packItemPoint = FindPoint(keepItemPng, 130, 125, 175, 170, 0.6)
            //如果第一格是保留物品时跳出
            If packItemPoint(0) > -1 Then
                TracePrint GetNetworkTime()&" 已售完所有装备, 现在准备去买药水..."
                Exit For
            End If
            Tap 150, 150 // 选中第一个武器
            Delay 500
            Tap 630, 480 //点击出售按钮
            Delay 500
        Next
    End If
    //修理武器
    Tap 820, 260 //切换到修理标签卡
    Delay 500
    Tap 700, 480 //点击一键修理装备
    Delay 2000
    Tap 900, 290 //随便点关闭商店
    Delay 500
    
    Tap 870, 200 //打开背包
    Delay 1000
    Tap 710, 485 //整理背包
    Delay 4000
    Tap 900, 290 //随便点关闭背包
    Delay 500
End Function

//买药
Function BuyBlood(bloodNum, liquidNum)
	Dim buy_num
    Tap 740, 340 //打开药店
    Delay 1000
    buy_num = bloodNum - liquidNum
    //购买 *99瓶高级药水
    For i = 1 To buy_num
        Tap 225, 310 //选择高级生命药水
        Delay 500
        Tap 640, 375 //选择数量
        Delay 500
        Tap 445, 180 //选择9
        Delay 500
        Tap 445, 180 //再次选择9
        Delay 500
        Tap 530, 350 //确认
        Delay 500
        Tap 630, 480 //购买
        Delay 500
    Next
    Tap 900, 290 //随便点关闭药店
End Function

//沙漠4传送点附近5怪点
Function s4()
    Tap 555, 285 //s4
    Delay 500
    Tap 560, 340 //确认
    Delay 10000
    TracePrint GetNetworkTime()&" 传送成功,准备跑到杀怪地点..."
    Tap 890, 75 //点击小地图
    Delay 1000
    Tap 350, 240 //s4指定位置
    Delay 500
    Tap 900, 290 //随便点关闭大地图
    Delay 500
End Function

//地下3层左下角4怪点
Function d3()
    //选择位置跑位开始
    Tap 400, 255 //废墟3
    Delay 500
    Tap 560, 340 //确认
    Delay 10000
    TracePrint GetNetworkTime()&" 传送成功,准备跑到杀怪地点..."
    Tap 890, 75 //点击小地图
    Delay 1000
    Tap 140, 470 //切换世界地图
    Delay 500
    Tap 440, 340 //诅咒之地
    Delay 500
    Tap 395, 235 //地下城1层
    Delay 500
    Tap 265, 440 //地下城2层
    Delay 500
    Tap 200, 225 //地下城3层
    Delay 500
    Tap 250, 420 //地下城3层指定位置
    Delay 500
    Tap 900, 290 //随便点关闭大地图
    Delay 500
End Function

//神殿2层高台
Function sd2(stepPoint, useScroll, checkTransferPng)
	Dim screen1_color, screen2_color, transferPoint
	If useScroll <> 1 Then
    	Tap 510, 330 //鬼城
    	Delay 500
    	Tap 560, 340 //确认
    End If
    Delay 10000
    TracePrint GetNetworkTime()&" 传送成功,准备跑到杀怪地点..."
    //先跑神殿门口
    Tap 890, 75 //点击小地图
    Delay 1000
    Tap 140, 470 //切换世界地图
    Delay 500
    Tap 400, 280 //古代战场
    Delay 500
    Tap 505, 365 //神殿门口
    Delay 500
    Tap 900, 290 //随便点关闭大地图
    Do While true
        screen1_color = GetPixelColor(250, 150)
        Delay 3000
        screen2_color = GetPixelColor(250, 150)
        transferPoint = FindPoint(checkTransferPng, 815, 30, 950, 120, 0.8)
        If screen1_color = screen2_color And transferPoint(0) > -1 Then 
            TracePrint GetNetworkTime()&" 跑位成功,成功跑位到神殿门口!"
            Exit Do
        End If
    Loop
    //拖动进去神殿
    TouchDown 140, 425, 1
	TouchMove 255, 570, 1, 4000
	TouchUp 1
	Delay 5000
	Tap 890, 75 //点击小地图
    Delay 500
    Tap 345, 250 //神殿2层
    Delay 500
    If stepPoint = 4 Then
        Tap 350, 110 //神殿2高台
    Else 
        Tap 395, 135 //神殿2右上侧三怪点
    End If
    Delay 500
    Tap 900, 290 //随便点关闭大地图
    Delay 500
End Function

//神殿3层三怪
Function sd3(useScroll, checkTransferPng)
	Dim screen1_color, screen2_color, transferPoint
	If useScroll <> 1 Then
    	Tap 510, 330 //鬼城
    	Delay 500
    	Tap 560, 340 //确认
    End If
    Delay 10000
    TracePrint GetNetworkTime()&" 传送成功,准备跑到杀怪地点..."
    //先跑神殿门口
    Tap 890, 75 //点击小地图
    Delay 1000
    Tap 140, 470 //切换世界地图
    Delay 500
    Tap 400, 280 //古代战场
    Delay 500
    Tap 505, 365 //神殿门口
    Delay 500
    Tap 900, 290 //随便点关闭大地图
    Do While true
        screen1_color = GetPixelColor(250, 150)
        Delay 3000
        screen2_color = GetPixelColor(250, 150)
        transferPoint = FindPoint(checkTransferPng, 815, 30, 950, 120, 0.8)
        If screen1_color = screen2_color And transferPoint(0) > -1 Then 
            TracePrint GetNetworkTime()&" 跑位成功,成功跑位到神殿门口!"
            Exit Do
        End If
    Loop
    //拖动进去神殿
    TouchDown 140, 425, 1
	TouchMove 255, 570, 1, 4000
	TouchUp 1
	Delay 5000
	Tap 890, 75 //点击小地图
	Delay 500
	Tap 345, 250 //神殿2层
	Delay 500
	Tap 325, 480 //神殿3层
	Delay 500
	Tap 375, 140 //神殿3层大祭坛左上角
	Delay 500
	Tap 900, 290 //随便点关闭大地图
	Delay 500	
End Function

//铁路1四怪
Function tl1(stepPoint)
	
End Function

//理查登跑位
Function Position(transferPng, arriveAt, arriveAtPng, useScroll, go_ghost_city_scroll)
    Dim screen1_color, screen2_color, screen3_color, screen4_color, transferPoint, arriveAtPoint
    //跑到理查登传送点
    If useScroll = 1 Then 
    	Tap 870, 200 //打开背包
        Delay 1000
        Tap go_ghost_city_scroll(0), go_ghost_city_scroll(1) //打开鬼城卷
        Delay 500
        Tap 545, 395 //使用鬼城卷
    Else
    	Tap 890, 75 //点击小地图
    	Delay 1000
    	Tap 455, 170 //跑到理查登传送点
    	Delay 500
    	Tap 900, 290 //随便点关闭大地图
    	Do While true
        	screen1_color = GetPixelColor(250, 150)
        	Delay 3000
        	screen2_color = GetPixelColor(250, 150)
        	transferPoint = FindPoint(transferPng, 815, 30, 950, 120, 0.8)
        	If screen1_color = screen2_color And transferPoint(0) > -1 Then 
            	TracePrint GetNetworkTime()&" 跑位成功,准备传送到指定地点!"
            	Exit Do
        	End If
    	Loop
    	TouchDown 140, 420, 1
    	TouchMove 110, 420, 1, 300
    	TouchUp 1
    	Delay 1000
    End If
    //选择位置跑位开始
    Select Case arriveAt
    Case 0
        Call s4()
    Case 1
        Call d3()
    Case 2
        Call sd2(4, useScroll, checkTransferPng)
    Case 3
        Call sd2(3, useScroll, checkTransferPng)
    Case 4
    	Call sd3(useScroll, checkTransferPng)
    Case Else
        Call s4()
    End Select
    //选择位置跑位结束
    Do While true
        screen3_color = GetPixelColor(250, 150)
        Delay 1000
        Call AddBlood(bloodPixelColor)
        screen4_color = GetPixelColor(250, 150)
        arriveAtPoint = FindPoint(arriveAtPng, 815, 30, 950, 120, 0.8)
        If screen3_color = screen4_color And arriveAtPoint(0) > -1 Then
            TracePrint GetNetworkTime()&" 已跑到杀怪地点,开始杀怪..."
            Exit Do
        End If
    Loop
End Function

Do While true
    Dim num, num1, num2, num3, liquid_num, screen1_color, screen2_color
    //跑位
    If isPosition = 1 Then
        Dim other_city_point, city_point, go_back_scroll, go_ghost_city_scroll
        other_city_point = FindPoint(otherCityPng, 815, 30, 950, 120, 0.7)
        If other_city_point(0) > -1 Then 
            TracePrint GetNetworkTime()&" 当前可能在菲尔拉城里..."
            Tap 870, 200 //打开背包
            Delay 1000
            go_back_scroll = FindPoint(scrollPng, 410, 120, 760, 440, 0.7)
            If go_back_scroll(0) > -1 Then 
                TracePrint GetNetworkTime()&" 找到回城卷轴,马上回城..."
                Tap go_back_scroll(0), go_back_scroll(1) //打开回城卷
                Delay 300
                Tap 545, 430 //使用回城卷
                Delay 10000
            End If
        End If
        city_point = FindPoint(cityPng, 815, 30, 950, 120, 0.7)
        If city_point(0) > -1 Then
            TracePrint GetNetworkTime()&" 当前可能在理查登城里..."
            Tap 870, 200 //打开背包
            Delay 1000
            Tap 710, 485 //整理背包
            Delay 4000
            Tap 900, 290 //随便点关闭背包
            Delay 500
            //如果开启保存物品就先去仓库存储保存物品
            If isSave = 1 Then 
                Tap 890, 75 //点击小地图
                Delay 1000
                Tap 280, 305//跑到理查登仓库
                Delay 500
                Tap 900, 290 //随便点关闭大地图
                Do While true
                    screen1_color = GetPixelColor(250, 150)
                    Delay 2000
                    screen2_color = GetPixelColor(250, 150)
                    If screen1_color = screen2_color Then 
                        TracePrint GetNetworkTime()&" 已经跑到仓库..."
                        Exit Do
                    End If
                Loop
                Tap 740, 340 //打开仓库
                Delay 2000
                //保存物品到仓库
                Call ScanInventory(stonePng, saveTabPng, packBloodPng, scrollPng, isSave2, ringPng, orangePng, purplePng, bluePng, greenPng, whitePng)
                Delay 500
                Tap 900, 290 //随便点关闭仓库
                Delay 500
            End If
            Call RepairEquipment(packBloodPng, scrollPng, isSell) //修理售卖装备
            Tap 870, 200 //打开背包
            Delay 1000
            liquid_num = scanPack(packBloodPng, destroyTabPng, bloodNum) //扫描背包药水数量
            Delay 500
            go_ghost_city_scroll = FindGhostScroll(scrollPng, ghostScrollGreen)
            Delay 500
            //Tap 710, 485 //整理背包
            //Delay 4000
            Tap 900, 290 //随便点关闭背包
            If liquid_num < bloodNum Then //当药水数量少于需要购买药水数量,就去商店买药
                TracePrint GetNetworkTime()&" 当前总共"&liquid_num&"格药水,需要购买药水..."
                Call BuyBlood(bloodNum, liquid_num) //买药水
            Else
                TracePrint GetNetworkTime()&" 当前药水充足,即将奔赴怪点..."
            End If
            Delay 500
            Tap 900, 290 //随便点关闭背包
            Dim useScroll = 0
            If arriveAt > 1 And arriveAt < 5 Then 
            	If go_ghost_city_scroll(0) > -1 Then 
            		useScroll = 1
            	End If
            End If
            Call Position(transferPng, arriveAt, arriveAtPng, useScroll, go_ghost_city_scroll) //跑位
        End If
    End If
    //如果是月卡用户使用月卡的挂机功能
    If isMonthCard = 1 Then 
        Delay 1000
        If autoButtoColor <> GetPixelColor(930, 260) Then 
            Tap 930, 260
        Else 
            TracePrint GetNetworkTime()&" 已经在挂机中..."
        End If
        Delay 150000
    Else 
        Tap 890, 330 //第一技能
        //TracePrint GetNetworkTime()&" 正在使用第1技能!"
        Call AddBlood(bloodPixelColor)
        Delay 300
        For num = 1 To 240
            num1 = num Mod 8
            If num1 = 0 Then 
                Tap 750, 415 // 第三技能
                //TracePrint GetNetworkTime()&" 正在使用第3技能!"
                Call AddBlood(bloodPixelColor)
            End If
            num2 = num Mod 12
            If num2 = 0 Then
                Tap 760, 500 // 第四技能
                //TracePrint GetNetworkTime()&" 正在使用第4技能!"
                Call AddBlood(bloodPixelColor)
                Tap 835, 515 //怪物目标定位
            End If
            If isPick = 1 //捡取物品
                num3 = num Mod 3
                If num3 = 0 Then
                    Tap 930, 510 //捡东西
                End If
            End If
            Tap 800, 345 //第二技能
            //TracePrint GetNetworkTime()&" 正在使用第2技能!"
            Call AddBlood(bloodPixelColor)
        Next
        Call AddBlood(bloodPixelColor)
        Call AddBlue(bluePixelColor)
    End If
    
    //整理背包和卖垃圾
    If isPackUp = 1 Then
        Tap 870, 200 //打开背包
        Delay 1000
        Call ScanPack(packBloodPng, destroyTabPng, bloodNum) //扫描背包清理药水
        Delay 300
        //删除指定物品(魔牢卷,小喇叭,监牢卷)
        Dim dropItemPoint, destroyPoint
        dropItemPoint = FindPoint(dropItemPng, 410, 120, 760, 440, 0.7)
        If dropItemPoint(0) > -1 Then 
            Tap dropItemPoint(0), dropItemPoint(1)
            Delay 500
            destroyPoint = FindPoint(destroyTabPng, 410, 75, 760, 500, 0.7)
            TracePrint GetNetworkTime()&" 摧毁标签坐标"&destroyPoint(0),destroyPoint(1)
            If destroyPoint(0) > -1 Then 
                Tap destroyPoint(0), destroyPoint(1)
                Delay 500
                Tap 560, 340 //确认
                TracePrint GetNetworkTime()&" 成功删除物品..."
            Else 
                Tap 900, 290 //随便点关闭物品
            End If
        End If
        Delay 300
        //回城卖垃圾
        If isSell = 1 Then 
            Dim packEmptyNum, scrollPoint
            If isMonthCard = 1 Then 
                //如果是月卡用户格子较多,往下拉再检测
                TouchDown 730, 420, 1
                TouchMove 730, 260, 1, 200
                TouchUp 1
                Delay 300
            End If
            packEmptyNum = FindPoint(packEmptyPng, 410, 120, 760, 440, 0.7)
            If packEmptyNum(0) > -1 Then 
                TracePrint GetNetworkTime()&" 当前背包还未装满..."
            Else 
                //月卡用户检测如果满的再拉回去使用回城卷
                If isMonthCard = 1 Then 
                    TouchDown 730, 260, 1
                    TouchMove 730, 420, 1, 200
                    TouchUp 1
                    Delay 300
                End If
                scrollPoint = FindPoint(scrollPng, 410, 120, 760, 440, 0.7)
                If scrollPoint(0) > -1 Then 
                    TracePrint GetNetworkTime()&" 找到回城卷轴,马上回城..."
                    Tap scrollPoint(0), scrollPoint(1) //打开回城卷
                    Delay 300
                    Tap 545, 430 //使用回城卷
                    Delay 10000
                End If
            End If	
        End If
        Tap 900, 290 //随便点关闭背包
        Delay 300
        Call AddBlood(bloodPixelColor)
    End If   
Loop

界面UI代码如下:

界面1:
{
	游戏挂机设置:
	{
		水平布局:
		{
			文字框:
			{
				名称:"notice",
				显示内容:" 请使用雷电模拟器,分辨率使用960*540(dpi160),且请勿开启极致多开模式! ",
				文字大小:16,
				高度:30,
				宽度:0
			},
		},
		水平布局:
		{
			文字框:
			{
				名称:"isMonthCardtips",
				显示内容:"是否月卡用户  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"isMonthCard",
				选项:
				[
				"否",
				"是",
				],
				初始选项:0
			},
			文字框:
			{
				名称:"isMonthCardtips1",
				显示内容:"  (如果是月卡用户将使用月卡用户的挂机功能)  ",
				文字大小:12,
				高度:30,
				宽度:0
			},
		},	
		水平布局:
		{
			文字框:
			{
				名称:"isPicktips",
				显示内容:"是否捡取物品  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"isPick",
				选项:
				[
				"否",
				"是",
				],
				初始选项:1
			},	
			文字框:
			{
				名称:"isPicktips1",
				显示内容:"  (如果配置是月卡用户此配置将失效,默认使用月卡用户捡取配置)  ",
				文字大小:12,
				高度:30,
				宽度:0
			},
		},	
		水平布局: 
		{
			文字框:
			{
				名称:"isPositiontips",
				显示内容:"是否怪点跑位  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"isPosition",
				选项:
				[
				"否",
				"是",
				],
				初始选项:1
			},	
			文字框:
			{
				名称:"isPositiontips1",
				显示内容:"  (角色死亡将重新跑位到怪点打怪,其中还包含修理装备,购买清理药水)  ",
				文字大小:12,
				高度:30,
				宽度:0
			},		
		},
		水平布局: 
		{
			文字框:
			{
				名称:"isSavetips",
				显示内容:"是否保存物品  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"isSave",
				选项:
				[
				"否",
				"是",
				],
				初始选项:1
			},	
			文字框:
			{
				名称:"isSavetips1",
				显示内容:"  (锻造石和洗练石还有不锈钢和经验装将自动保存到仓库)  ",
				文字大小:12,
				高度:30,
				宽度:0
			},			
		},
		水平布局: 
		{
			文字框:
			{
				名称:"isPackUptips",
				显示内容:"是否整理背包  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"isPackUp",
				选项:
				[
				"否",
				"是",
				],
				初始选项:1
			},	
			文字框:
			{
				名称:"isPackUptips1",
				显示内容:"  (删除指定物品,当药水大于指定数量时删除多余药水)  ",
				文字大小:12,
				高度:30,
				宽度:0
			},
		},
		水平布局: 
		{
			文字框:
			{
				名称:"isSelltips",
				显示内容:"是否售卖垃圾  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"isSell",
				选项:
				[
				"否",
				"是",
				],
				初始选项:1
			},	
			文字框:
			{
				名称:"isSelltips1",
				显示内容:"  (背包满了将自行回城卖垃圾,需开启整理背包功能,确保背包内有'回到理查登')  ",
				文字大小:12,
				高度:30,
				宽度:0
			},
		},
		水平布局: 
		{
			文字框:
			{
				名称:"bloodNumtips",
				显示内容:"保持药水数量  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"bloodNum",
				选项:
				[
				"0",
				"1",
				"2",
				"3",
				"4",
				"5",
				"6",
				],
				初始选项:5
			},	
			文字框:
			{
				名称:"bloodNumtips1",
				显示内容:"  (背包保留药水格数,超过设置值将删除多余药水,反之则自动去商店购买)  ",
				文字大小:12,
				高度:30,
				宽度:0
			},
		},
		水平布局: 
		{
			文字框:
			{
				名称:"arriveAttips",
				显示内容:"自动挂机位置  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
			下拉框:
			{
				名称:"arriveAt",
				选项:
				[
				"沙4五怪点",
				"地3四怪点",
				"神殿2高台",
				"神殿2三怪",
				"神殿3三怪",
				"铁路1四怪",
				"铁路1两怪",
				],
				初始选项:2
			},	
			文字框:
			{
				名称:"arriveAttips1",
				显示内容:"  (需开启跑位功能,开启后将跑到怪点打怪,神殿怪点优先使用鬼城卷)  ",
				文字大小:12,
				高度:30,
				宽度:0
			},
		},	
		水平布局: 
		{
			文字框:
			{
				名称:"isSave2tips",
				显示内容:"是否保存装备  ",
				文字大小:14,
				高度:30,
				宽度:0
			},
			下拉框:
			{
				名称:"isSave2",
				选项:
				[
				"否",
				"是",
				],
				初始选项:1
			},
			多选框:
			{
				注释:"文字大小、高度、宽度是可选属性,如需使用默认值,可保持值为0或直接删除此属性",
				名称:"purple",
				提示内容:"紫装",
				选中:false,
				文字大小:12,
				高度:0,
				宽度:0
			},
			多选框:
			{
				注释:"文字大小、高度、宽度是可选属性,如需使用默认值,可保持值为0或直接删除此属性",
				名称:"blue",
				提示内容:"蓝装",
				选中:false,
				文字大小:12,
				高度:0,
				宽度:0
			},
			多选框:
			{
				注释:"文字大小、高度、宽度是可选属性,如需使用默认值,可保持值为0或直接删除此属性",
				名称:"green",
				提示内容:"绿装",
				选中:false,
				文字大小:12,
				高度:0,
				宽度:0
			},
			多选框:
			{
				注释:"文字大小、高度、宽度是可选属性,如需使用默认值,可保持值为0或直接删除此属性",
				名称:"white",
				提示内容:"白装",
				选中:false,
				文字大小:12,
				高度:0,
				宽度:0
			},
			文字框:
			{
				名称:"isSave2tips",
				显示内容:" (开启后可保存,橙色装备必存)  ",
				文字大小:14,
				高度:30,
				宽度:0
			},	
		},
	},	
}

附件需要解压传入按键精灵手机助手附件中attchment.zip

20200511150945.jpg

Screenshot_20200504-170319.png

对应技能如图所示,第二技能是无CD技能,第三技能大概5秒左右触发一次,第四技能大概30秒左右触发一次,可以自动捡取,自动定位怪物,自动加血加魔,建议回蓝在8.0以上无需带魔力药水

使用方法比较简单,在模拟器中安装按键精灵,然后在脚本的地方添加脚本,选择循环执行,然后打开游戏,按下音量-即可启动脚本,再按同一个按键就是暂停

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://sulao.cn/post/765.html

我要评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。