//密码:520
//以下是帖子的源码、
//注:紫色字体都是可以修改的提示话语
//============================================================
//注册大漠
//释放附件
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
//移动游戏窗口到屏幕0,0位置(这里0,0自己可以修改例如-300,0|-200,0|-100,0 随便改都可以)
aa.MoveWindow hwnd, 0, 0
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(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
//大号中的“二次找图”判断是否开始游戏
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|b.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
//小号标题名称(支持模糊查找、、例如我这里也可以用“忘记时间”)
hwnd = cc.FindWindow("", "忘记时间爱你")
cc_ret = cc.SetWindowState(hwnd, 1)
// display: dx 鼠标:windows后台 键盘:windows后台 模式1
cc_ret = cc.BindWindow(hwnd, "dx", "dx", "dx", 1)
Delay 100
If cc_ret=0 Then
MessageBox "绑定“失败”"
ExitScript
End If
//脚本编写包括(移动游戏窗口、准备、开始)
Delay 100
//移动游戏窗口到屏幕0,0位置(这里0,300自己可以修改例如-300,300|-400,200|-100,200 随便改)
cc.MoveWindow hwnd, 0, 300
Delay 500
Rem 小准
cc_ret = cc.FindPic(0,0,1024,768,"打开.bmp","000000",1,1,intX,intY)
If intX >= 0 and intY >= 0 Then
cc.Moveto 495,127
Delay 200
cc.LeftClick
Else
End If
cc_ret = cc.FindPic(484,386,587,437,"300.bmp","000000",1,1,intX,intY)
If intX >= 0 and intY >= 0 Then
cc.KeyUp 87
cc.keyDown 68
Delay 2000
cc.KeyUp 68
End If
//小号中的“一次找图”,判断是否开始游戏
Delay 200
cc_ret = cc.FindPic(0,0,1024,768,"确定.bmp","000000",1,1,intX,intY)
If intX >= 0 and intY >= 0 Then
Delay 200
cc.MoveTo 322,342
Delay 200
cc.LeftClick
Else
cc_ret = cc.FindPic(0,0,1024,768,"准备.bmp|开始游戏.bmp","000000",1,1,intX,intY)
If intX >= 0 and intY >= 0 Then
Delay 200
cc.moveto 55, 21
Delay 200
cc.leftclick
Else
Goto 检测2
End If
End If
Goto 小准
Rem 检测2
cc.KeyDown 87
Delay 100
cc.keypress 69
Delay 100
cc.keypress 32
cc_ret = cc.FindPic(0,0,1024,768,"x.bmp|b.bmp","000000",1,1,intX,intY)
If intX >= 0 and intY >= 0 Then
cc.KeyPress 82
Else
cc_ret = cc.FindPic(484,386,587,437,"300.bmp","000000",1,1,intX,intY)
If intX >= 0 and intY >= 0 Then
cc.KeyUp 87
cc.keyDown 68
Delay 2000
cc.KeyUp 68
End If
End If
Goto 小准
End Sub
//绑定之后,必须加上“这段代码”
//停止“主程序”和“每个线程”时,都会调用“这段代码”
Sub OnScriptExit()
aa_ret = aa.UnBindWindow()
End Sub
会就自己改