//注册大漠 //释放附件 PutAttachment ".\plugin","regDll.dll" PutAttachment "C:\test_game","*.bmp" PutAttachment "C:\test_game","*.txt" PutAttachment "C:\test_game","dm.dll" //大漠注册 Call Plugin.RegDll.Reg("C:\test_game\dm.dll") set aa = createobject("dm.dmsoft") //指定 全局路径 aa.SetPath "C:\test_game" Delay 40 //获取鼠标指向的窗口句柄 hwnd = aa.GetMousePointWindow() //激活该窗口 aa_ret = aa.SetWindowState(hwnd,1) //绑定窗口句柄 aa_ret = aa.BindWindow(hwnd, "dx", "dx", "dx", 1) Delay 200 //创建一个对象(aa),并检查对象是否创建成功 If aa_ret=0 Then MessageBox "绑定“失败”" ExitScript End If //多线程控制小号 BeginThread min //大号脚本编写包括(移动游戏窗口、准备、开始) Delay 100 aa.MoveWindow hwnd, 0, 0 //显示气泡提示信息 Call Plugin.Msg.Tips("移动游戏屏幕到指定位置") Delay 500 Rem 大准备 aa_ret = aa.FindPic(0,0,1024,768,"打开.bmp","000000",1,1,intX,intY) If intX >= 0 and intY >= 0 Then aa.Moveto 495,127 Delay 100 aa.LeftClick Else End If //大号中的“一次找图”,判断是否开始游戏 aa_ret = aa.FindPic(0,0,1024,768,"确定.bmp","000000",1,1,intX,intY) If intX >= 0 and intY >= 0 Then Delay 200 aa.MoveTo 310,342 Delay 100 aa.LeftClick Else //大号中的“二次找图”判断是否开始游戏 aa_ret = aa.FindPic(0,0,1024,768,"准备.bmp|开始游戏.bmp","000000",1,1,intX,intY) If intX >= 0 and intY >= 0 Then aa.Moveto 64, 19 Delay 100 aa.LeftClick Delay 300 Else Goto 检测1 End If End If Goto 大准备 //大号开始跑了 Rem 检测1 aa.KeyDown 87 Delay 100 aa.keypress 69 Delay 100 aa.keypress 32 aa_ret = aa.FindPic(0,0,1024,768,"d.bmp","000000",1,1,intX,intY) If intX >= 0 and intY >= 0 Then aa.keypress 82 Else aa_ret = aa.FindPic(477,383,590,448,"300.bmp","000000",1,1,intX,intY) If intX >= 0 and intY >= 0 Then aa.keyUp 87 aa.KeyDown 68 Delay 2000 aa.keyup 68 End If End If Goto 大准备 //小号跑前准备、呵呵 Sub min() set cc = createobject("dm.dmsoft") //↑大漠·注册 cc.SetPath "C:\test_game" Delay 40 //小号标题名称(支持模糊查找、、例如我这里也可以用“忘记时间”)