Set dm = createobject("dm.dmsoft")
dm.SetPath "c:\" //设置路径
dm.SetDict 0, "zk.txt" //设置字库
hwnd = dm.GetMousePointWindow() //绑定窗口
dm_ret = dm.BindWindow(hwnd, "gdi", "windows", "normal") //后台模式
For 100000 //循环次数,可自设
rem a //标记,如果找不到字则再次寻找,直到找到
Delay 500
dm_ret = dm.FindStr(0, 0, 2000, 2000, "艾", "f5ff01-000000", 1.0, intX, intY)
If intX >= 0 and intY >= 0 Then
dm.MoveTo intx+29,inty+68 //鼠标移动到指定位置
Delay 800
dm.LeftClick //执行鼠标动作
Delay 2000
dm_ret = dm.FindStr(0, 0, 2000, 2000, "入", "ffdd82-000000", 1.0, intC, intD)
If intC >= 0 Then
Delay 500
dm.MoveTo intC, intD+3
Delay 500
dm.LeftClick
Delay 3000
If intx > 0 and intc > 0 Then
Call zd
End if
End If
Else
goto a
End If
Next
Sub zd
For 5
Delay 3000
dm_ret = dm.FindStr(0, 0, 2000, 2000, "战", "ffffff-000000", 1.0, intA, intB)
If intA >= 0 Then
Delay 1000
dm.MoveTo intA, intB + 5
Delay 800
dm.LeftClick
End If
Next
End Sub
dm_ret = dm.UnBindWindow() //解除绑定,退出脚本
EndScript