- 超级版主
- 1228894
- 26975
- 25
- 8050 朵
- 36129 个
- 4746 个
- 421340
- 2012-07-18
|
1#
t
T
发表于 2022-04-13 15:26
|
|只看楼主
用途:1. 例查找所有怪物坐标,并排除中间人物区域的坐标[即阴影处]2. 例游戏怪物太远无法点击到怪物,排除掉太远的坐标[即阴影处]安卓返回符合特征的所有坐标找图返回所有坐标- Dim img,startx,starty,endx,endy,count
- Dim intX, intY
- img = "Attachment:1.png"'改成自己图片名称
- startx = 1 : starty = 1 : endx = 720 : endy = 1028 : count = 0'前4参数改成自己分辨率
- Do
- FindPic startx, starty, endx, endy, img, "000000", 0, 0.9, intX, intY
- If intx = - 1 Then
- If startx=0 Then Exit do //查找结束
- starty = starty + 1 : startx = 0
- Else
- If inty = starty or startx = 0 Then
- startx = intx + 1:starty=inty
- count = count + 1
- TracePrint intX, intY
- Else
- startx = 0 : starty = starty + 1
- End If
- End If
- Loop
复制代码 找字返回所有坐标- TracePrint SetDictEx(0, "Attachment:123.txt")
- TracePrint UseDict(0)
- //以上两句脚本只需要调用一次
- Dim img,startx,starty,endx,endy,count
- Dim intX, intY
- img = "安装"'改成自己文字
- startx = 1 : starty = 1 : endx = 1028: endy = 720 : count = 0'前4参数改成自己分辨率
- Do
- FindStr(startx, starty, endx, endy,img,"A0A0A0-303030",0.8,intX,intY)
- If intx = - 1 Then
- If startx=0 Then Exit do //查找结束
- starty = starty + 1 : startx = 0
- Else
- If inty = starty or startx = 0 Then
- startx = intx + 1:starty=inty
- count = count + 1
- TracePrint intX, intY
- Else
- startx = 0 : starty = starty + 1
- End If
- End If
- Loop
复制代码 多点找色返回所有坐标,并排除指定1个范围【即1】- TracePrint 返回排除区域坐标(1, 1,610, 220,"1FC5F4","-2|14|199FB3,25|4|1FC5F4")
- Function 返回排除区域坐标(x1, y1, x2, y2,颜色,颜色特征)
- 返回排除区域坐标=""
- Dim img,startx,starty,endx,endy,count
- Dim intX, intY,总
- startx = 1 : starty = 1 : endx = 720 : endy = 1028 : count = 0'前4参数改成自己分辨率
- Do
- FindMultiColor startx,starty,endx,endy,颜色,颜色特征,0,0.9,intX,intY
- If intx = - 1 Then
- If startx=0 Then Exit do //查找结束
- starty = starty + 1 : startx = 0
- Else
- If inty = starty or startx = 0 Then
- startx = intx + 1:starty=inty
- count = count + 1
- If intX > x2 or intx < x1 Then
- If inty > y2 or inty < y1 Then
- TracePrint intX, intY
- 总=总&intX&","& intY&"|"
- End If
- End If
- Else
- startx = 0 : starty = starty + 1
- End If
- End If
- Loop
- 返回排除区域坐标=Mid(总,1,len(总)-1)
- End Function
复制代码 多点找色返回所有坐标,并排除指定多个范围【即2】 - dm.txt (, 下载次数:74)
|