Call 注册
Call 绑定
A类 = "a1.bmp|a2.bmp|a3.bmp|a4.bmp|a5.bmp"//如果图片多,可以再加
A类 = split(A类, "|")//数组
B类 = "b1.bmp|b2.bmp"
C类 = "c1.bmp|c2.bmp"
Do//这个是无限循环,当A类的N个图片找完后,反回继续从A类第一个图片开始找,如此反复,直到你停止脚本运行
For i = 0 To UBound(A类)
Do
dm_ret = dm.FindPic(0, 0, 2000, 2000, A类(i), "000000", 0.9, 0, x, y)
If x >= 0 and y >= 0 Then
dm.MoveTo x + 5, y + 5
Delay 100
dm.LeftClick
Delay 100
Exit Do//找到A类第i个图后跳出循环,否则一直找
End If
Delay 100
Loop
Do
dm_ret = dm.FindPic(0, 0, 2000, 2000, 图B, "000000", 0.9, 0, x, y)
If x >= 0 and y >= 0 Then
dm.MoveTo x + 5, y + 5
Delay 100
dm.LeftClick
Delay 100
Exit Do //找到B类图内的任一图片后跳出循环,否则一直找
End If
Delay 100
Loop
Do
dm_ret = dm.FindPic(0, 0, 2000, 2000, 图C, "000000", 0.9, 0, x, y)
If x >= 0 and y >= 0 Then
dm.MoveTo x + 5, y + 5
Delay 100
dm.LeftClick
Delay 100
Exit Do//找到C类图内的任一图片后跳出循环,否则一直找
End If
Delay 100
Loop
//这组找完,返回并找下一个A类图片
Next
//A类图片都找完了,如果想一直循环找,就加一个无限循环
Loop
Sub 绑定
Rem 绑定
hwnd = dm.GetMousePointWindow()
Delay 100
dm_ret = dm.BindWindow(hwnd,"dx2","windows2","dx",0)
Delay 1000
If dm_ret = 1 Then
Call Plugin.Msg.Tips("绑定成功")
Delay 100
Else
Goto 绑定
End If
End Sub
Sub 注册大漠()
need_ver = "3.1233"
Delay 50
set ws=createobject("Wscript.Shell")
Delay 50
ws.run "regsvr32 atl.dll /s"
Delay 50
set ws=nothing
PutAttachment "c:\test_game","*.*"
Delay 50
PutAttachment ".\Plugin", "RegDll.dll"
Delay 50
Call Plugin.RegDll.Reg("c:\test_game\dm.dll")
Delay 50
set dm = createobject("dm.dmsoft")
Delay 50
ver = dm.Ver()
Delay 50
if ver <> need_ver then
Delay 50
set dm = nothing
Delay 50
set ws=createobject("Wscript.Shell")
Delay 50
ws.run "regsvr32 c:\test_game\dm.dll /s"
Delay 50
set ws=nothing
Delay 50
set dm = createobject("dm.dmsoft")
Delay 50
ver = dm.Ver()
Delay 50
if ver <> need_ver then
messagebox "插件版本错误,当前使用的版本是:"&ver&",插件所在目录是:"&dm.GetBasePath()
messagebox "请关闭程序,重新打开本程序再尝试"
endscript
end if
end if
dm.SetPath "c:\test_game"
Delay 50
dm_ret = dm.SetDict(0, "dm_soft.txt")
Delay 50
End Sub
Sub OnScriptExit()
dm.UnBindWindow
End Sub
如果你的大漠插件不是3.1233版本,请将注册开头的 need_ver = "3.1233" 改为你用的大漠插件版本号
Dim ta(4), tb(1)//申明两个数组来存放图片
//假设图A类有5张图.图的名称为:图A-1,图A-2...
For i = 0 To UBound(ta)
i1 = i+1
ta(i) = "Attachment:\图A-" & i1 & ".bmp"//循环给数组A赋值
Next
For i = 0 To UBound(tb)
i1 = i+1
tb(i) = "Attachment:\图B-" & i1 & ".bmp"//循环给数组B赋值
Next
i = 0
Do
FindPic 0,0,1024,768,ta(i),0.9,intX,intY
If intX > 0 And intY > 0 Then
i1 = 0
Do
FindPic 0, 0, 1024, 768, tb(i1), 0.9, intX, intY
If intX > 0 And intY > 0 Then
MoveTo intX + 5, intY + 5
Delay 10
LeftClick 1
Exit Do//找到单击后跳出找图B的循环
Else
i1 = i1 + 1//找不到就找B类下一个图
If i1 = 2 Then //如果B类都没有找到,就一直不停的找
i1 = 0
End If
End If
Delay 200
loop
End If
i = i + 1
If i > UBound(ta) Then //如果找到A类最后一张图,则返回重找
i = 0
End If
Delay 200
Loop
如果图片的命名方式不规则,就只能一个一个的给数组赋值