马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 denis 于 2020-9-8 23:28 编辑
Call 动态npc截图("酒店老板",{498,196,552,257},9)//第一步截图保存,默认9张图片
Function 动态npc截图(NpcName, Rang, SearchingTimes)
Dim PicturesPath
For SearchingTimes
PicturesPath = "/sdcard/pictures/" & NpcName & "/" & NpcName & "动态" & SearchingTimes & ".png"
SnapShot PicturesPath,Rang(0),Rang(1),Rang(2),Rang(3)
Delay 300
SearchingTimes = SearchingTimes - 1
Next
End Function
Call SearchMovingNpc("酒店老板",{373, 96, 627, 322},9)//第二步寻找,但注意范围一定要比截图的大很多
Function SearchMovingNpc(NpcName, Rang, SearchingTimes)
Dim PicturesPath,NpcPictures
dim 结果 = Dir.Exist("/sdcard/pictures/SearchNpc.txt")
If 结果 = 1 Then
Dir.Delete "/sdcard/pictures/SearchNpc.txt"
zmFile.Write("/sdcard/pictures/SearchNpc.txt","")
End If
Delay 2000
For SearchingTimes
PicturesPath = "/sdcard/pictures/" & NpcName & "/" & NpcName & "动态" & SearchingTimes & ".png"
NpcPictures = "|" & PicturesPath
File.Append "/sdcard/pictures/SearchNpc.txt", NpcPictures
SearchingTimes = SearchingTimes - 1
Next
NpcPictures = File.Read("/sdcard/pictures/SearchNpc.txt")
TracePrint NpcPictures
ret = zm.FindPic(Rang(0),Rang(1),Rang(2),Rang(3),NpcPictures,"0.70-0.85", 10000)
If ret Then
TracePrint "找到了"
TracePrint ret(3)
Tap ret(1)+30,ret(2)+30
Else
TracePrint "没有找到"
End If
End Function
(^-^)V
|