• 新浪微博:
  • 按键公众号 :
按键精灵电脑版
立即下载

软件版本:2014.06
软件大小:22.9M
更新时间:03-18

按键精灵安卓版
立即下载

软件版本:3.5.3
软件大小:46.2M
更新时间:03-02

按键精灵iOS版
立即下载

软件版本:1.7.3
软件大小:29.2M
更新时间:12-06

最新企业版UiBot
立即下载

软件版本:3.3
软件大小:282M
更新时间:08-06

快捷导航

登录 后使用快捷导航
没有帐号? 注册

发新话题 回复该主题

[分享脚本] 发开大话西游2免费版自动登陆,主线,捉鬼,鬼王脚本,给学手学习用... [复制链接]

1#
本帖最后由 lark123 于 2015-1-22 17:55 编辑

大话西游2免费版 自动登录 主线,捉鬼,刷天脚本,解决前台多开问题,主线流程,各种常规任务问题,对新手有大大好处哦
有帮助记得给 花花 o(∩_∩)o

[hide=d360]
Call RegDM() //注册并创建大漠对象dm
dm_ret = dm.SetShowErrorMsg(0)
TracePrint dm_ret
dm.SetPath "D:\web\资源包"
If form1.CheckBox6.Value = 1 Then
    Else
    Call 打开登陆器 '此为自动登陆内容
Call 自动登陆
Call 输入账密
Call 自动组队
Call 队员进组
End If



hwnds = dm.EnumWindow(0, "大话西游2免费版", "WSWINDOW",1+2+8+16)
TracePrint hwnds
hwndss = split(hwnds, ",")
TracePrint join(hwndss)


Rem 标记
i = 0
Do
TracePrint "i="&i
Delay 200
If i > ubound(hwndss) Then
i = 0
End If
hwnd=hwndss(i)
TracePrint hwnd
dm.SetWindowState hwnd,5
dm.SetWindowState hwnd,12
Delay 500
Call BindWindows(hwnd)
// dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.input.lock.api|dx.mouse.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.graphic.protect",101)
// Delay 2000
If dm_ret = 1 Then
TracePrint "绑定成功"
End If
dm.LockInput 1
dm.DisableScreenSave
dm.DisablePowerSave
TracePrint "主进程"
If form1.OptionBox1.Value = 1 Then
If findimgex(2, 1, 147, 37, "地府.bmp") > - 1 Then
openbag 2, 31, 562, 601, "袍.bmp|叉.bmp|鞋.bmp|五色.bmp|面具.bmp|剑.bmp|衣.bmp|巾.bmp|锤.bmp"
Call 加点
If i > ubound(hwndss) Then
MessageBox "主线完成,脚本结束"
ExitScript
End If
Goto 标记
End If    
For 3
Delay 200
Call 主线
Next
ElseIf form1.OptionBox2.Value = 1 Then
Call 抓鬼
ElseIf form1.OptionBox3.Value = 1 Then
Call 天庭任务

End If
dm.SetWindowState hwnd,2
i = i + 1
dm_ret = dm.UnBindWindow()
Loop
Sub 自动组队
Dim i
hwnds = dm.EnumWindow(0, "大话西游2免费版", "WSWINDOW",1+2+8+16)
TracePrint hwnds
hwndss = split(hwnds, ",")
TracePrint join(hwndss)
i = 0
    Do
    Delay 100
    
    Delay 2000
    TracePrint "i="&i
Delay 200
If i > ubound(hwndss) Then
Exit sub
End If
hwnd=hwndss(i)
TracePrint hwnd
dm.SetWindowState hwnd, 12
dm.movewindow hwnd, 0, 0
Delay 100
dm.movewindow hwnd,0,0
Delay 500
Call BindWindows(hwnd)
    If findimgex(650, 2, 794, 77, "男人.bmp") > - 1 Then
        性质 = 1
        Else
        性质=2
    End If
    If 性质 = 1 Then
    Do
Delay 100
    KDown "alt"
        KPress "5"
        KUp "alt"
        Delay 3000
    KDown "alt"
        KPress "t"
        
    LClick 398,272
        KUp "alt"
    If FindImgEx(444, 0, 543, 58, "男人.bmp") > - 1 Then
        Exit do
    End If    
    
    loop
    Do
    Delay 100
    KDown "alt"
        KPress "f"
        KUp "alt"
    If findimgex(296, 112, 505, 209, "系统信息.bmp|队伍.bmp") > - 1 Then
        RClick imgx, imgy
        dm.mover 300,0
    End If

    If findimgex(664, 147, 791, 294, "我的好友.bmp") > - 1 Then
        LClick imgx, imgy
        Exit Do
        End if
        loop
        do '查找十次颜色
        Delay 100
        
        dm_ret = dm.FindColor(662,215,790,334,"c8b458-000000",1.0,0,intX,intY)
If intX >= 0 and intY >= 0 Then '如果找到就做以下操作
For k=0 to 100 step 25 '遍历好友坐标
RClick 728,225+k

Delay 100
Do
    Delay 100

If findimgex(415, 387, 571, 491, "邀请.bmp") > - 1 Then
    LClick imgx, imgy
    dm.mover 100, 0
         LClick imgx, imgy '点击2次邀请
    dm.mover 100, 0
    Exit do
End If

loop





Next
Exit do
End If

Loop
Delay 200
KDown "alt"
KPress "f"
KUp "alt"
Delay 200
If findimgex(296, 112, 505, 209, "系统信息.bmp|队伍.bmp|好友信息.bmp") > - 1 Then
        RClick imgx, imgy
        dm.mover 300,0
    End If
    Exit sub
        
    End If
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    i=i+1
    loop
    
    
    
    
    
End Sub
Sub 队员进组
Dim i
hwnds = dm.EnumWindow(0, "大话西游2免费版", "WSWINDOW",1+2+8+16)
TracePrint hwnds
hwndss = split(hwnds, ",")
TracePrint join(hwndss)
i = 0
    Do
    Delay 100
    
    Delay 2000
    TracePrint "i="&i
Delay 200
If i > ubound(hwndss) Then
Exit sub
End If
hwnd=hwndss(i)
TracePrint hwnd
dm.SetWindowState hwnd, 12
dm.movewindow hwnd, 0, 0
Delay 100
dm.movewindow hwnd,0,0
Delay 500
Call BindWindows(hwnd)
    If findimgex(650, 2, 794, 77, "男人.bmp") > - 1 Then
        性质 = 1
        Else
        性质=2
    End If
    If 性质 = 2 Then
        Do
        Delay 100
        If findimgex(268, 301, 422, 413, "接受.bmp") > - 1 Then
            LClick imgx, imgy
            dm.mover 0, - 100
            Delay 800
            If findimgex(268, 301, 422, 413, "接受.bmp") = - 1 Then
                Exit do
            End If
        End If
        

        loop
    End If
    
    
    
    
    
    
    
    
    i=i+1
    
        loop
End Sub
Sub 打开登陆器
    For int(form1.InputBox2.text)
        Delay 5000
        Call Lib.API.运行程序(form1.BrowseBox2.Path)

    Next
End Sub
Sub 自动登陆
Dim i
hwnds = dm.EnumWindow(0, "大话西游2免费版欢迎页", "",1+8+16)
TracePrint hwnds
hwndss = split(hwnds, ",")
TracePrint join(hwndss)
i=0
    Do
    Delay 2000
    TracePrint "i="&i
Delay 200
If i > ubound(hwndss) Then
Exit sub
End If
hwnd=hwndss(i)
TracePrint hwnd
dm.SetWindowState hwnd,12
Delay 500
Call BindWindows(hwnd)
    Do
    Delay 1000
    If findimgex(334, 532, 664, 574, "当前版本.bmp") > - 1 Then
        LClick 819, 465
        Delay 4000
        Exit do
    End If
    loop
    
    i=i+1
    loop
    
    
End Sub
Sub 输入账密
Dim i
hwnds = dm.EnumWindow(0, "大话西游2免费版", "WSWINDOW",1+2+8+16)
TracePrint hwnds
hwndss = split(hwnds, ",")
TracePrint join(hwndss)
i=0
    Do
    Delay 2000
    TracePrint "i="&i
Delay 200
If i > ubound(hwndss) Then
Exit sub
End If
hwnd=hwndss(i)
TracePrint hwnd
dm.SetWindowState hwnd, 12
dm.movewindow hwnd, 0, 0
Delay 100
dm.movewindow hwnd,0,0
Delay 500
Call BindWindows(hwnd)
    Do
    Delay 1000
    If findimgex(198,207,288,254, "账号.bmp") > - 1 Then
        LClick 443, 240
        Delay 200
    End If
    If findimgex(275, 220, 319, 255, "竖.bmp") > - 1 Then
        Exit do
    End If
    Loop
    '以下是除入账密的
    var1=form1.BrowseBox1.Path
MyArray = Split(Plugin.File.ReadFileEx(Var1), "|")
For a = 1 To UBound(MyArray)-1
Var2 = Lib.文件.读取指定行文本内容(Var1, a)
TracePrint Var2
Var3=Split(Var2,"----")
TracePrint Var3(0)
TracePrint Var3(1)
// TracePrint var3(2)
If InStr(Var2, "已读取") > 0 Then
//此处加入操作
TracePrint "已读取到第"&a&"行"
Else
KPressStr Var3(0),2
    Delay 200
    KPress 13
    Delay 500
    KPressStr Var3(1), 2

Call Lib.文件.替换指定行文本内容(Var1, Var2 & "已读取", a)
Exit for
End if
Next
    
'账密输入完成,判断登录游戏
Do
Delay 100
If findimgex(325,328,444,382,"登陆.bmp") > - 1 Then
    LClick imgx, imgy
    dm.mover 0, 200
    
End If
If findimgex(302, 439, 539, 570, "进入.bmp") > - 1 Then
    dm.moveto 137, 424
    Delay 2000
    If findimgex(83, 359, 238, 459, "杠子.bmp") > - 1 Then
        LClick 137, 424
        Do
        If findimgex(70, 406, 124, 446, "竖2.bmp") > - 1 Then
            SayString form1.InputBox1.text
            Delay 300
            KPress 13
            Exit do
        End If
        Loop
        Exit do
    End If
End If




Loop
Delay 5000
Do
Delay 100
If findimgex(289,468,501,555,"进入.bmp") > - 1 Then
    LClick imgx+20, imgy+8
    dm.mover 100, 0
    Exit do
End If

loop
    
    
    
    

    
    
    
    
    
    
    
    
    
    i=i+1
    loop    
    
    
    
    
    
    
End Sub
Sub 天庭任务
Dim cisu
cisu=0
dm.usedict 1
Delay 100
dm_ret = dm.Capture(678, 10, 711, 28, i & ".bmp")
TracePrint "第"&i&"张图"
TracePrint dm_ret
Delay 500
dm_ret = dm.FindPic(457, 1, 558, 46, i&".bmp", "000000", 0.7, 0, intX, intY)
Delay 200
If intX >= 0 and intY >= 0 Then
TracePrint "队长模式"
Do
renwu=判断当前任务("寻找李靖")

TracePrint 判断当前任务("寻找李靖")
If renwu = "寻找李靖" Then
If form1.CheckBox1.Value = 1 Then
Call 领盒子    
End If
Call 吃香

Call 寻找李靖

ElseIf renwu = "任务相关操作1" Then
// Call 巡视场景取消
Call 任务相关操作1
ElseIf renwu = "战斗" Then
Exit do

ElseIf renwu = "死亡归队" Then
dm_ret = dm.UnBindWindow()
Call 死亡归队
dm_ret = dm.UnBindWindow()
i=-1
Exit Sub
ElseIf renwu = "住店" Then

// Call 切换恢复召唤兽状态
// dm_ret = dm.UnBindWindow()
Call 住店
i=-1
dm_ret = dm.UnBindWindow()
Exit Sub
ElseIf renwu = "加血加蓝住店" Then
Call 加血加蓝住店
i=-1
dm_ret = dm.UnBindWindow()
Exit Sub

End If
Loop
dm_ret = dm.UnBindWindow()
Call 队员战斗
// cisu = cisu + 1
// If cisu = form1.InputBox3.text Then
//     
// End If
i=-1
dm_ret = dm.UnBindWindow()
End If
    
End Sub
Function 识别数字(setx,sety,setx1,sety1,setcolor,sim)
Dim s
dm.usedict 3
// If form1.OptionBox1.Value = 1 Then
//dm.usedict 0
//ElseIf form1.OptionBox2.Value = 1 Then
//dm.usedict 0
//ElseIf form1.OptionBox3.Value = 1 Then
//dm.usedict 3
//ElseIf form1.OptionBox4.Value = 1 Then
//dm.usedict 3
//
//End if

For 3
Delay 100    
s=dm.ocr(setx,sety,setx1,sety1,setcolor,sim)
TracePrint s
If len(s) > 0 Then
识别数字=s
Exit for
End If
next    
End Function
Sub 加血加蓝不住店
If comparecolor(793, 22, "101410-000000") Then
        打开背包
LClick 345, 342
Delay 200
For 100
If findimgex(14, 318, 376, 544, "无常丹.bmp") > - 1 Then '找红

RClick imgx, imgy
dm.mover 0,-100
If comparecolor(793, 22, "101410-000000") = False Then '比红
    Exit for
End If
Else

'此处住店
End If
Next
For 100
If findimgex(14, 318, 376, 544, "绿烟丸.bmp") > - 1 Then '找蓝

RClick imgx, imgy
dm.mover 0,-100
If comparecolor(793, 35, "101410-000000") = False Then '比蓝
    Exit for
End If
Else

'此处住店
End If
Next    
关闭背包    
        
    End If
    
End Sub
Function 判断是否住店
TracePrint "进入判断是否住店"
判断是否住店=False
If comparecolor(793, 22, "101410-000000") or comparecolor(793, 35, "101410-000000") Then
Call 打开背包
LClick 344, 344
Delay 500
If findimgex(14, 318, 376, 544, "无常丹.bmp") = - 1 or findimgex(14, 318, 376, 544, "绿烟丸.bmp")= - 1 Then

判断是否住店 = true
Call 关闭背包
Exit Function
End If
end if

End Function
Function 加血加蓝
TracePrint "进入加血加蓝"
    If comparecolor(793, 22, "101410-000000") or comparecolor(793, 35, "101410-000000") Then
    call 打开背包
LClick 345, 342
Delay 200
For 10
Delay 100
// If findimgex(14, 318, 376, 544, "无常丹.bmp") > - 1 Then '找红

RClick 731,20 '此处为加血
dm.mover 0,-100
If comparecolor(793, 22, "101410-000000") = False Then '比红
    Exit for
End If
// Else
//
// '此处住店
// Call 住店
// Exit sub
// End If
Next
If findimgex(14, 318, 376, 544, "盒子.bmp") > - 1 Then
RClick imgx, imgy
dm.mover 0,-100    
End If

For 100
// If findimgex(14, 318, 376, 544, "绿烟丸.bmp") > - 1 Then '找蓝

RClick 731,36 '找蓝
dm.mover 0,-100
If comparecolor(793, 35, "101410-000000") = False Then '比蓝
    Exit for
End If
// Else
//
// '此处住店
// Call 住店
// Exit sub
// End If
Next    
call 关闭背包    
    call 恢复召唤兽状态
    End If
End Function
Sub 恢复召唤兽状态
Dim ss
    Call 打开状态栏
ss = 识别数字(76, 317, 148, 340, "e8dcc8-888070", 0.9)
If int(ss) <= 85 Then
Call 驯养    
End If
        

    
    
    
//    Call 给召唤兽加血
    Call 关闭状态栏

End Sub
Sub 给召唤兽加血
If comparecolor(654, 20, "101410-000000") Then
    Call 唤兽加血
End If
    
End Sub
Sub 唤兽加血
Do
Delay 100

    If findimgex(10,418,185,550,"物品.bmp|物品1.bmp") > - 1 Then
        LClick imgx, imgy
        Exit Do
        Else
        TracePrint "没有找到加血标识"
    End If
    
    Loop
    For 100
    If findimgex(212,130,619,446,"无常丹.bmp") > - 1 Then
        RClick imgx, imgy
        dm.mover 0, - 100
        Else
        If findimgex(212,130,619,446, "xx.bmp") > - 1 Then
        LClick imgx + 5, imgy + 5
            Exit sub
    End If
    End If
    If comparecolor(654, 20, "101410-000000") = False Then
    If findimgex(212,130,619,446, "xx.bmp") > - 1 Then
        LClick imgx + 5, imgy + 5
            Exit sub
    End If

End If
    next
    
    
End Sub
Sub 驯养
For 3
    Delay 100
//    If findimgex(81, 318, 151, 334, "100.bmp|100a.bmp") > - 1 Then
//        Exit Sub
//        Else
        If findimgex(27, 69, 366, 499, "驯养.bmp") > - 1 Then
            LClick imgx, imgy
            dm.mover 100,0
        End If
//    End If
    next
End Sub
Sub 打开状态栏
    Do
    Delay 100
    If findimg("召唤兽.bmp") > - 1 Then
        Exit Sub
        Else
        KDown "alt"
        KPress "o"
        KUp "alt"
    End If
    loop
End Sub
Sub 关闭状态栏
    Do
    Delay 100
    If findimg("召唤兽.bmp") =- 1 Then
        Exit Sub
        Else
        KDown "alt"
        KPress "o"
        KUp "alt"
    End If
    loop
End Sub
Function comparecolor(setx, sety, setcolor)
comparecolor=False
dm_ret = dm.CmpColor(setx, sety, setcolor,0.9)
If dm_ret = 0 Then
comparecolor=true
End If
End Function
Sub 抓鬼
dm.usedict 1
Delay 100
dm_ret = dm.Capture(678, 10, 711, 28, i & ".bmp")
TracePrint "第"&i&"张图"
TracePrint dm_ret
Delay 500
dm_ret = dm.FindPic(457, 1, 558, 46, i&".bmp", "000000", 0.7, 0, intX, intY)
Delay 200
If intX >= 0 and intY >= 0 Then
TracePrint "队长模式"
Do

TracePrint 判断当前任务("寻找钟馗")
If 判断当前任务("寻找钟馗") = "寻找钟馗" Then
If form1.CheckBox1.Value = 1 Then
Call 领盒子    
End If
Call 吃香

Call 快速寻钟
ElseIf 判断当前任务("寻找钟馗") = "任务相关操作" Then
Call 巡视场景取消
Call 任务相关操作
ElseIf 判断当前任务("寻找钟馗") = "战斗" Then
Exit do
End If
Loop
dm_ret = dm.UnBindWindow()
Call 队员战斗

dm_ret = dm.UnBindWindow()
End If
End Sub
Sub 吃香
If findimgex(575,40,797,99, "香1.bmp") = - 1 Then
Call 用香
End If
End Sub
Sub 切换卖装备
Dim a,ii,aa
a=0
dm.usedict 1
Do
    TracePrint "a="&a
Delay 100
If a > ubound(hwndss) Then
Goto 标记

Exit sub
End If
hwnd=hwndss(a)
TracePrint hwnd
dm.SetWindowState hwnd,12
Delay 200
dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.input.lock.api|dx.mouse.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.graphic.protect",101)
Delay 2000
If dm_ret = 1 Then
TracePrint "绑定成功"
Else
TracePrint "绑定失败"

End If

Delay 100
If findimg("卖出.bmp") > - 1 Then
For ii = 0 To 250 Step 50

    For aa = 0 To 50 Step 50
        
    TracePrint ii&","&aa
Delay 100
lclick imgx-114+ii, imgy + 63+aa


next
Next
Do
    Delay 100
If findimg("卖了.bmp") > - 1 Then
    LClick imgx, imgy
    Delay 200
dm.mover 100,0
    
End If
dm.usedict 1
Delay 100
If findstrex(85, 154, 712, 515, "您出售了|您要出售空气", "f8fc00-000000") > - 1 Then

If findimg("卖出.bmp") > - 1 Then
RClick imgx,imgy

End if

Exit do
End If
loop
End if








a=a+1
dm_ret = dm.UnBindWindow()
loop    
    
    
    
End Sub


Sub 判断卖装备
do
    Delay 500

If findimgex(11, 7, 427, 278, "物品栏.bmp|物品栏1.bmp") > - 1 Then
LClick 343, 343
Delay 100
Exit Do
Else
KDown "alt"
Delay 100
KPress "e"
Delay 100
KUp "alt"

End If

loop
    If findimgex(276, 479, 326, 525, "空的.bmp") = - 1 Then
     KDown "alt"
Delay 100
KPress "e"
Delay 100
KUp "alt"
        Call 卖装备
        Call 切换卖装备
    End If
    

    
End Sub
Sub 用香
打开背包
LClick 345, 342
Delay 200
If findimgex(14, 318, 376, 544, "香.bmp") > - 1 Then
RClick imgx, imgy
Else
Call 买香(form1.InputBox2.text)
'此处买香
End If
Delay 500
LClick 343, 382
Delay 200
If findimgex(14, 318, 376, 544, "香.bmp") > - 1 Then
RClick imgx,imgy
End If    
关闭背包    
End Sub
Sub 买香(数量)
do
Delay 200
If ismove = False Then
KDown "alt"
Delay 100
KPress "2"
Delay 100
KUp "alt"
If findimg("洛阳|洛阳城.bmp") > - 1 Then
LClick imgx+10, imgy
Delay 100
dm.mover 100,100
End If
Delay 200
If findimg("高级搜索.bmp") > - 1 Then
LClick 631,325
End If
If ismove = False Then
If 识别当前坐标 = "[450,91]" Then
If findimg("高级搜索.bmp") > - 1 Then
KDown "alt"
Delay 100
KPress "1"
Delay 100
KUp "alt"
End If
If findimg("洛阳.bmp") > - 1 Then
Delay 100
KDown "alt"
Delay 100
KPress "2"
Delay 100
KUp "alt"
End If
LClick 498, 217
Delay 1000
Do
Delay 100
If right(识别当前坐标, 6) = "[11,7]" Then
LClick 426, 407
Do
Delay 100
dm.usedict 1
If findstrex(100, 184, 655, 399, "我想买点东西", "00d010-000000") > - 1 Then
LClick strx, stry
End If
If findimg("购买.bmp") > - 1 Then
If findimg("香3.bmp") > - 1 Then
LClick imgx, imgy
Call 购买(数量)
If findimg("购买2.bmp") > - 1 Then
LClick imgx, imgy
Exit sub
End If
End If
End If
loop
End If
loop
End If
End If
End if
loop
End Sub
Sub 购买(数量)
LClick 414,393
KPress 8
KPress 8
KPress 8
If len(数量) > 0 Then
TracePrint len(数量)
For i = 1 To len(数量)
Delay 500
KPress mid(数量, i, 1)
TracePrint mid(数量, i, 1)
TracePrint i
Next
End If
End Sub
Sub 用盒子
打开背包
LClick 345, 342
Delay 200
If findimgex(14, 318, 376, 544, "4万.bmp") > - 1 Then
RClick imgx,imgy
End If
Delay 500
LClick 343, 382
Delay 200
If findimgex(14, 318, 376, 544, "4万.bmp") > - 1 Then
RClick imgx,imgy
End If
End Sub
Sub 巡视场景取消
dm.usedict 2
Do
Delay 300
If findstrex(6, 151, 162, 224, "斧头帮总部|大唐|长安城东|长寿村外|普陀山","00fc00-000000") > - 1 Then
Call 寻找钟馗
Else
Exit sub
End if
loop    
End Sub
Sub 卖装备
Dim ii ,aa
    do
Delay 100
If ismove = False Then
Delay 200


If findimg("大话精灵1.bmp") > - 1 Then
RClick imgx, imgy
Delay 100
End If


dm.usedict 1
Delay 200
If findstrex(85, 154, 712, 515, "我这有点装备", "00fc00-000000") > - 1 Then
LClick strx+10,stry+2
Exit sub
End If
// If findimg("卖出.bmp") > - 1 Then
// For ii = 0 To 250 Step 50
//
//     For aa = 0 To 150 Step 50
//         
//     TracePrint ii&","&aa
// Delay 100
// lclick imgx-114+ii, imgy + 63+aa
//
//
//next
//Next
//     Do
//     Delay 100
// If findimg("卖了.bmp") > - 1 Then
//     LClick imgx, imgy
//     Delay 200
// dm.mover 100,0
//     
// End If
// dm.usedict 1
// Delay 100
// If findstrex(85, 154, 712, 515, "您出售了|您要出售空气", "f8fc00-000000") > - 1 Then
// If findimg("卖出.bmp") > - 1 Then
// RClick imgx,imgy
//
// End if
// Exit Sub
//
// End If
//
//
// loop

End If
Call 打开寻路
dm.usedict 2
If findstrex(158,67,635,492, "钟馗捉鬼", "e0b490-000000") > - 1 Then
LClick strx, stry
dm.moveto 0,0
Delay 100
If findimgex(229, 64, 536, 251, "钟馗NPC.bmp|钟馗3.bmp") > - 1 Then
Delay 100
LClick imgx + 10, imgy + 7
dm.moveto 0,0
End If
End If
// If datediff("s", t, now) > 1000 * 300 Then
// Call 关闭寻路
// If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47,299,454,492,"角2.bmp")>-1 Then
// If Findmycolor(135,231,668,368,"f8fcf8-000000") =1 Then
// If findmycolor(134,230,374,374,"00fc00-000000")=1 Then
// lclick intx + 10, inty + 5
// ElseIf findimgex(125, 222, 356, 299, "11.bmp") > - 1 Then
// dm.moveto imgx,imgy
// For 5
// Delay 100
// dm.leftclick
// Next
// End If
// Else
// TracePrint "没有找到对话标志"
// End If    
// End If    
// End If
// Delay 1500

dm.usedict 1
Delay 200
If findstrex(84,114,717,511, "我这有点装备", "00fc00-000000") > - 1 Then
LClick strx+10,stry+2
Exit sub
End If
// End If
Loop
    
    
    
    
    
End Sub
Sub 判断领双
dm.usedict 1
Delay 200
If findimgex(575,40,797,99, "双.bmp|双1.bmp") = - 1 Then
do
Delay 200
If ismove = False Then
KDown "alt"
Delay 100
KPress "2"
Delay 100
KUp "alt"
If findimg("长安城.bmp|长安城2.bmp") > - 1 Then
LClick imgx+10, imgy+5
Delay 100
dm.mover 100,100
End If
Delay 200
If findimg("高级搜索.bmp") > - 1 Then
LClick 639, 152
End If
If ismove = False Then
For 3
dm.usedict 1
Delay 200
If findstrex(124, 202, 688, 480, "领取", "00fc00-000000") > - 1 Then
Exit do
End If
Next
End If
End if
Loop
call 领双(datetime(form1.ComboBox1.ListIndex))
End If
End Sub
Function datetime(内容)
If 内容 = 0 Then
datetime = "一小时"
ElseIf 内容 = 1 Then
datetime = "二小时"
ElseIf 内容 = 2 Then
datetime= "四小时"
End If
End Function
Sub 寻找妖王
If findimgex(10, 3, 151, 39, "地.bmp|长.bmp|轮.bmp|大.bmp|天.bmp") = - 1 Then
If findimgex(0, 82, 203, 295, "关闭1.bmp") > - 1 Then
     LClick imgx + 5, imgy + 5
    dm.mover 200, 0
     End if
End if
    If findimgex(5, 127, 255, 327, "三头魔王.bmp") > - 1 Then
    LClick imgx + 5, imgy + 5
    dm.mover 200, 0
    Call 关闭小地图
     Exit Sub
    
    
    ElseIf findimgex(5, 127, 255, 327, "黑山妖王.bmp") > - 1 Then
     LClick imgx + 5, imgy + 5
    dm.mover 200, 0
    Call 关闭小地图
     Exit sub    
    ElseIf findimgex(5, 127, 255, 327, "蓝色妖王.bmp") > - 1 Then
     LClick imgx + 5, imgy + 5
    dm.mover 200, 0
    Call 关闭小地图
     Exit Sub
     ElseIf findimgex(5, 127, 255, 327, "万年熊王.bmp") > - 1 Then
     LClick imgx + 5, imgy + 5
    dm.mover 200, 0
    Call 关闭小地图
     Exit sub
    End if
    
    
    
End Sub
Sub 任务相关操作1
    Dim t
Call 吃香
t=now
Do
Delay 100
If ismove = False Then
Call 寻找妖王    
End If

If findimg("大话精灵.bmp") > - 1 Then
RClick imgx, imgy
Delay 100
RClick imgx,imgy
End If
dm.usedict 1
Delay 200
If findstrex(6, 151, 162, 224, "斧头帮总部|大唐|长安城东|长寿村外|普陀山","00fc00-000000") >- 1 Then
Exit sub
End If
Delay 200
If findstrex(127,182,608,472, "领取任务", "00fc00-000000") > - 1 Then
LClick strx, stry
Delay 100
dm.rightclick
End If
dm.usedict 1
Delay 300


// Call 关闭寻路
If findimgex(10,3,151,39, "地.bmp|长.bmp|轮.bmp|大.bmp|天.bmp") = - 1 Then
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47, 299, 454, 492, "角2.bmp") > - 1 and findimgex(600,170,734,442, "角3.bmp") > - 1 Then
If findstrex(134, 214, 663, 429, "各位且去|希望你能奋勇杀敌","f8fcf8-000000") > - 1 Then
LClick strx, stry
End If
dm.rightclick
End If
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47,299,454,492,"角2.bmp")>-1 Then
If Findmycolor(135,231,668,368,"f8fcf8-000000") =1 Then
If findmycolor(134,230,374,374,"00fc00-000000")=1 Then
lclick intx + 10, inty + 5
ElseIf findimgex(125, 222, 356, 299, "11.bmp") > - 1 Then
dm.moveto imgx,imgy
For 5
Delay 100
dm.leftclick
Next
End If
Else
TracePrint "没有找到对话标志"
End If    
End If    
    
    
    
    
    
End If
If findimgex(191, 75, 607, 122, "正常模式.bmp") > - 1 Then
    KPress "f1"
End If
If findimgex(4, 138, 187, 275, "抓鬼.bmp") > - 1 Then
If findmycolor(8,173,165,210, "00fc00-000000")=1 Then
lclick intx, inty
Delay 100
dm.moveto 0, 0
End If
Else
Exit sub
End If
If findstrex(133, 228, 656, 431, "妖孽受死吧", "00fc00-000000") > - 1 Then
LClick strx, stry
Exit sub
End If
// If findimg("窗口.bmp") > - 1 Then
//     RClick imgx+20,imgy+20
//     
// End If
If datediff("n", t, now) > 6 Then
KDown "alt"
Delay 100
KPress "q"
Delay 100
KUp "alt"
Delay 200
If findimg("取消任务.bmp") > - 1 Then
LClick imgx,imgy
End If
KDown "alt"
Delay 100
KPress "q"
Delay 100
KUp "alt"
Delay 200
exit sub
End if
loop
End Sub
Sub 任务相关操作
Dim t
Call 吃香
t=now
Do
Delay 100
If findimg("大话精灵.bmp") > - 1 Then
RClick imgx, imgy
Delay 100
RClick imgx,imgy
End If
dm.usedict 2
Delay 200
If findstrex(6, 151, 162, 224, "斧头帮总部|大唐|长安城东|长寿村外|普陀山","00fc00-000000") >- 1 Then
Exit sub
End If
Delay 200
If findstrex(127,182,608,472, "我来帮你", "00fc00-000000") > - 1 Then
LClick strx, stry
Delay 100
dm.rightclick
End If
dm.usedict 1
Delay 300
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47, 299, 454, 492, "角2.bmp") > - 1 and findimgex(600,170,734,442, "角3.bmp") > - 1 Then
If findstrex(134, 214, 663, 429, "各位且去|希望你能奋勇杀敌","f8fcf8-000000") > - 1 Then
LClick strx, stry
End If
dm.rightclick
End If
Call 关闭寻路
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47,299,454,492,"角2.bmp")>-1 Then
If Findmycolor(135,231,668,368,"f8fcf8-000000") =1 Then
If findmycolor(134,230,374,374,"00fc00-000000")=1 Then
lclick intx + 10, inty + 5
ElseIf findimgex(125, 222, 356, 299, "11.bmp") > - 1 Then
dm.moveto imgx,imgy
For 5
Delay 100
dm.leftclick
Next
End If
Else
TracePrint "没有找到对话标志"
End If    
End If
If findimgex(4, 138, 187, 275, "抓鬼.bmp") > - 1 Then
If findmycolor(8,173,165,210, "00fc00-000000")=1 Then
lclick intx, inty
Delay 100
dm.moveto 0, 0
End If
Else
Exit sub
End If
If findstrex(133, 228, 656, 431, "妖孽受死吧", "00fc00-000000") > - 1 Then
LClick strx, stry
Exit sub
End If
// If findimg("窗口.bmp") > - 1 Then
//     RClick imgx+20,imgy+20
//     
// End If
If datediff("n", t, now) > 6 Then
KDown "alt"
Delay 100
KPress "q"
Delay 100
KUp "alt"
Delay 200
If findimg("取消任务.bmp") > - 1 Then
LClick imgx,imgy
End If
KDown "alt"
Delay 100
KPress "q"
Delay 100
KUp "alt"
Delay 200
exit sub
End if
loop
End Sub
Sub 领盒子
For 3
Delay 200
If findimg("需要.bmp") > - 1 Then
LClick imgx, imgy
Call 用盒子
Exit sub
End If
Next
End Sub
Sub 快速寻钟
Call 吃香
If form1.CheckBox4.value = 1 Then
Call 判断领双    
End If
Delay 500
If findimg("卖出.bmp") > - 1 Then
RClick imgx,imgy

End if
打开背包
LClick 341, 502
For 5
Delay 1000
If findimgex(70,323,337,518,"三界符.bmp|三界符1.bmp") > - 1 Then
Delay 200
If left(识别当前地图, 2) = "地府" Then

Exit For
Else
RClick imgx, imgy
dm.moveto 400,300
End If
End if
Next
If form1.CheckBox5.Value = 1 Then
Call 判断卖装备    
End If

Call 关闭背包
Call 点击钟
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47, 299, 454, 492, "角2.bmp") > - 1 Then
Call 任务相关操作
Exit Sub
Else
Call 寻找钟馗
End If
End Sub
Sub 点击钟
If 识别当前地图 = "地府" Then
Call 寻找钟馗
ElseIf 识别当前地图 = "长安" Then
If findimgex(323, 256, 478, 342, "取消.bmp") > - 1 Then
LClick imgx, imgy
End If
For 10
Delay 200
dm.leftclick
next
ElseIf 识别当前地图 = "洛阳" Then
Call 寻找钟馗
End If    
End Sub
Function 识别当前坐标
Dim s
dm.usedict 2
s = dm.Ocr(74, 4, 136, 32, "e8dcc8-000000", 1.0)
TracePrint s
If len(s) > 0 Then
识别当前坐标=s
End If
End Function
Function 识别当前地图
dim s '判断人物是否在移动 829395 9fb3b3
dm_ret = dm.UseDict(2)
s = dm.Ocr(21,6,74,27, "e8dcc8-000000", 1.0)
If s <> "" Then
识别当前地图 = s
TracePrint s
End If
End function
Sub 打开背包

Delay 200

If findimgex(56,20,350,187, "物品栏.bmp") > - 1 Then
Exit sub
End If
KDown "alt"
Delay 100
KPress "e"
Delay 100
KUp "alt"

End Sub
Sub 关闭背包
If findimgex(56,20,350,187, "物品栏.bmp") = - 1 Then
Exit sub
End If
KDown "alt"
Delay 100
KPress "e"
Delay 100
KUp "alt"
End Sub
Sub 打开寻路
For 10
Delay 200
KDown "alt"
Delay 100
KPress "3"
Delay 100
KUp "alt"
Delay 100
If findimgex(210, 76, 623, 145, "游戏指引.bmp") > - 1 Then
LClick 592,300
For 8
Delay 100
dm.WheelUp
Next
Delay 300
Exit sub
End If
next    
End Sub
Sub 领取任务

    
End Sub
Sub 关闭寻路
For 10
Delay 100
If findimgex(210, 76, 623, 145, "游戏指引.bmp") =- 1 Then
Exit sub
End If
KDown "alt"
Delay 100
KPress "3"
Delay 100
Kup "alt"
next        
End Sub
Function 判断当前任务(str)
dm.usedict 1
If findimgex(523,328,800,566,"5.bmp|6.bmp") > - 1 Then
判断当前任务 = "战斗"
ElseIf findimgex(265, 0, 454, 48, "归.bmp|召.bmp|离.bmp") > - 1 Then
     判断当前任务 = "死亡归队"
     ElseIf 判断是否住店 Then
     判断当前任务 = "住店"
     ElseIf comparecolor(793, 22, "101410-000000") and findimgex(523,328,800,566,"5.bmp|6.bmp") = - 1 Then
    判断当前任务 = "加血加蓝住店"
    ElseIf comparecolor(793, 35, "101410-000000")and findimgex(523,328,800,566,"5.bmp|6.bmp") > - 1 Then
    判断当前任务="加血加蓝住店"
    
    
         

ElseIf findimgex(4, 138, 187, 275, "抓鬼.bmp") > - 1 and findimgex(753, 453, 791, 473, "5.bmp|6.bmp") = - 1 Then
判断当前任务 = "任务相关操作"
ElseIf findimgex(4, 138, 187, 275, " 三头魔王.bmp|黑山妖王.bmp|蓝色妖王.bmp|万年熊王.bmp") > - 1 and findimgex(753, 453, 791, 473, "5.bmp|6.bmp") = - 1 Then
判断当前任务 = "任务相关操作1"
// ElseIf findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47, 299, 454, 492, "角2.bmp") > - 1 and findimgex(600,170,734,442, "角3.bmp") > - 1 and findimgex(753, 453, 791, 473, "5.bmp|6.bmp") = - 1 Then
// If str = "寻找李靖" Then
// 判断当前任务 = "任务相关操作1"
//     Else
//     判断当前任务 = "任务相关操作"
//     End if
ElseIf findimgex(135, 224, 668, 444, "领取任务.bmp") > - 1 Then
判断当前任务 = "任务相关操作1"


Else
判断当前任务=str
End If    
End Function
Sub 加血加蓝住店
Dim a
a=0
dm.usedict 1
Do
    TracePrint "a="&a
Delay 100
If a > ubound(hwndss) Then
i=0
Exit sub
End If
hwnd=hwndss(a)
TracePrint hwnd
dm.SetWindowState hwnd,5
dm.SetWindowState hwnd,12

Call BindWindows(hwnd)
// dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.input.lock.api|dx.mouse.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.graphic.protect",101)
// Delay 2000
If dm_ret = 1 Then
TracePrint "绑定成功"
Else
TracePrint "绑定失败"

End If
// If form1.CheckBox3.value = 1 Then
// Call 领盒子    
// End If

Call 加血加蓝
dm.SetWindowState hwnd,2
a=a+1
dm_ret = dm.UnBindWindow()
loop    
End Sub
Sub 死亡归队

    Dim a
a=0
dm.usedict 1
Do
    TracePrint "a="&a
Delay 100
If a > ubound(hwndss) Then
i=0
Exit sub
End If
hwnd=hwndss(a)
TracePrint hwnd
dm.SetWindowState hwnd,5
dm.SetWindowState hwnd,12

Call BindWindows(hwnd)
// dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.input.lock.api|dx.mouse.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.graphic.protect",101)
// Delay 2000
If dm_ret = 1 Then
TracePrint "绑定成功"
Else
TracePrint "绑定失败"

End If
// dm.SetWindowState hwnd,12
// If form1.CheckBox3.value = 1 Then
// Call 领盒子    
// End If
//     Call 加血加蓝
If findimgex(142, 314, 226, 351, "认错.bmp") > - 1 Then
    LClick imgx + 5, imgy + 5
    dm.mover 0,-100
End If
If FindImgEx(265, 0, 454, 48, "归.bmp") >- 1 Then
        LClick imgx,imgy
        dm.mover 0, 100
        
     End If
     If findimgex(135,229,488,290, "各位且去1.bmp") > - 1 Then
LClick imgx,imgy
dm.mover 0,-100
End If
If ismove=False Then
Call 寻找队长    
End If
    
    
    
     If findimgex(7, 2, 150, 39, "御马监.bmp") > - 1 Then
    If findimgex(265, 0, 454, 48, "归.bmp") > - 1 Then
    LClick imgx, imgy
    dm.mover 0,100
    
     End If
End If
If findimgex(13, 5, 127, 38, "轮回司2.bmp") > - 1 Then
    If FindImgEx(265, 0, 454, 48, "归.bmp") >- 1 Then
        LClick imgx,imgy
        dm.mover 0, 100
        Exit do
     End If    
    End If
     If findimgex(265, 0, 454, 48, "归.bmp|召.bmp|离.bmp") = - 1 Then
         Exit sub
     End If
dm.SetWindowState hwnd,2
a=a+1
dm_ret = dm.UnBindWindow()
loop
End Sub
Sub 切换恢复召唤兽状态
Dim a
a=0
dm.usedict 1
Do
    TracePrint "a="&a
Delay 100
If a > ubound(hwndss) Then
i=0
Exit sub
End If
hwnd=hwndss(a)
TracePrint hwnd
dm.SetWindowState hwnd,12

Call BindWindows(hwnd)
// dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.input.lock.api|dx.mouse.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.graphic.protect",101)
// Delay 2000
If dm_ret = 1 Then
TracePrint "绑定成功"
Else
TracePrint "绑定失败"

End If
// If form1.CheckBox3.value = 1 Then
// Call 领盒子    
// End If

Call 恢复召唤兽状态

a=a+1
dm_ret = dm.UnBindWindow()
loop    
    
End Sub
Sub 住店
Call 吃香

If findimgex(14, 318, 376, 544, "盒子.bmp") > - 1 Then
RClick imgx, imgy
dm.mover 0,-100    
End If

Do
Delay 100
Call 打开大地图
Delay 500
If findimgex(142,135,699,496, "长安城.bmp|长安城1.bmp|长安城2.bmp|长安城3.bmp") > - 1 Then
    LClick imgx + 5, imgy + 5
    dm.mover 0,100
    Delay 500
    Else
    TracePrint "没有找到"
End If

If findimgex(137,325,249,398, "酒店老板.bmp") > - 1 Then
    LClick imgx + 5, imgy + 5
    dm.moveto 0,0
    Delay 3000
End If    

If findimgex(124, 214, 578, 366, "我要住店.bmp") > - 1 Then
    // 此处切换点击住店
    Call 点击住店
    Exit sub
End If


loop
    
    
    
End Sub
Sub 点击住店
Dim a
a=0
dm.usedict 1
Do
    TracePrint "a="&a
Delay 100
If a > ubound(hwndss) Then
a = 0
i=0
Exit sub
End If
hwnd=hwndss(a)
TracePrint hwnd
dm_ret = dm.SetWindowState(hwnd,5)


dm.SetWindowState hwnd,12
dm.SetWindowState hwnd,12
Call BindWindows(hwnd)
// dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.input.lock.api|dx.mouse.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.graphic.protect",101)
// Delay 2000
If dm_ret = 1 Then
TracePrint "绑定成功"
Else
TracePrint "绑定失败"

End If
Do
Delay 100
If findimgex(129,224,662,370, "我要住店.bmp") > - 1 Then
LClick imgx + 8, imgy + 5
dm.mover 0,-150
    Delay 1000
    
End If

If findimgex(129,224,662,370, "休息好了.bmp|状态很好.bmp") > - 1 Then
lClick imgx + 8, imgy + 5
dm.mover 0, - 150
Exit do
    
End If
Loop

Call 恢复召唤兽状态
dm_ret = dm.SetWindowState(hwnd,2)
a=a+1
dm_ret = dm.UnBindWindow()
loop    
    
End Sub
Sub 寻找队长

TracePrint "寻找队长"
For 20
    Delay 100
    If findimgex(167,94,664,503, "马监.bmp|马监1.bmp") > - 1 Then
TracePrint "人在yu马监"

    Do
     Delay 100
    If findimgex(89,194,712,396, "各位且去.bmp") > - 1 Then
        lClick imgx, imgy
        dm.mover 0,-100
    End If
    If findimgex(3, 149, 167, 208, "三头魔王.bmp|三头魔王1.bmp") > - 1 Then
        LClick imgx + 5, imgy + 5
        dm.mover 100, 0
        If ismove Then
            Exit sub
        End If
    End If    

    
    
    
    Loop
ElseIf findimgex(167,94,664,503, "轮回司.bmp") > - 1 Then
TracePrint "人在轮回司"
    Do
    Delay 100
    If findimgex(89,194,712,396, "各位且去.bmp") > - 1 Then
        lClick imgx, imgy
        dm.mover 0,-100
    End If
If ismove = False Then
    Call 打开大地图
    If findimgex(431,382,675,535,"轮回司1.bmp") > - 1 Then
        LClick imgx + 8, imgy
        dm.mover 0,-100
        
    End If
    If findimgex(319,223,505,348,"勾魂马面.bmp") > - 1 Then
        LClick imgx + 5, imgy + 5
        dm.mover 100, 0
        
    End If
    If ismove Then
            Exit sub
        End If
    If findimgex(6, 3, 130, 39, "轮回司2.bmp") > - 1 Then
        Exit sub
    End If    
End If
    
    
    
    loop
    
    
    End if
Next

End Sub
Sub 关闭小地图
Do
    Delay 100
    If findimg("小地图.bmp") = - 1 Then
        Exit Sub
        Else
        KDown "alt"
        KPress "1"
        KUp "alt"
        Delay 1000
    End If
    loop    
End Sub
Sub 关闭大地图
Do
    Delay 100
    If findimg("大地图.bmp") = - 1 Then
        Exit Sub
        Else
        KDown "alt"
        KPress "2"
        KUp "alt"
        Delay 1000
    End If
    loop
    
End Sub
Sub 打开大地图
    Do
    Delay 100
    If findimg("大地图.bmp|大地图1.bmp") > - 1 Then
        Exit Sub
        Else
        KDown "alt"
        KPress "2"
        KUp "alt"
        Delay 1000
    End If
    loop
End Sub
Sub 寻找李靖
     Call 吃香
If form1.CheckBox4.value = 1 Then
Call 判断领双    
End If
Call 关闭背包
If findimg("卖出.bmp") > - 1 Then
RClick imgx,imgy

End if
If findimgex(1, 134, 30, 172, "箭头.bmp") > - 1 Then
LClick imgx, imgy
Delay 200
dm.mover 200,0
End If
do
Delay 100
If ismove = False Then
Delay 200
dm.usedict 2
Delay 200
Call 关闭大地图

If findimg("大话精灵1.bmp") > - 1 Then
RClick imgx, imgy
Delay 100
End If
If findimgex(5, 127, 255, 327, "三头魔王.bmp|黑山妖王.bmp|蓝色妖王.bmp|万年熊王.bmp") > - 1 Then
TracePrint "找到妖王"

    Exit sub
End If

If findimgex(4, 138, 187, 275, "抓鬼.bmp") > - 1 and findstrex(6, 151, 162, 224, "斧头帮总部|大唐|长安城东|长寿村外|普陀山","00fc00-000000") = - 1 Then
Exit sub
End If
If findimgex(85, 154, 712, 515, "12.bmp") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
dm.usedict 1
Delay 200
If findstrex(85, 154, 712, 515, "领取任务", "00fc00-000000") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
If findimgex(5, 127, 255, 327, "三头魔王.bmp|黑山妖王.bmp|蓝色妖王.bmp|万年熊王.bmp") > - 1 Then
TracePrint "找到妖王"
    Exit sub
End If
Call 打开地图寻路
If findimgex(10, 3, 151, 39, "地.bmp|长.bmp|轮.bmp|大.bmp|天.bmp") = - 1 Then
If findimgex(0, 82, 203, 295, "关闭1.bmp") > - 1 Then
     LClick imgx + 5, imgy + 5
    dm.mover 200, 0
     End if
End if
dm.usedict 2
If findstrex(158,67,635,492, "钟馗捉鬼", "e0b490-000000") > - 1 Then
LClick strx, stry
dm.moveto 0,0
Delay 100
If findimgex(229, 64, 536, 251, "钟馗NPC.bmp|钟馗3.bmp") > - 1 Then
Delay 100
LClick imgx + 10, imgy + 7
dm.moveto 0,0
End If
End If
If datediff("s", t, now) > 1000 * 300 Then
// Call 关闭寻路
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47,299,454,492,"角2.bmp")>-1 Then
If Findmycolor(135,231,668,368,"f8fcf8-000000") =1 Then
If findmycolor(134,230,374,374,"00fc00-000000")=1 Then
lclick intx + 10, inty + 5
ElseIf findimgex(125, 222, 356, 299, "11.bmp") > - 1 Then
dm.moveto imgx,imgy
For 5
Delay 100
dm.leftclick
Next
End If
Else
TracePrint "没有找到对话标志"
End If    
End If    
End If
Delay 1500
If findimgex(85, 154, 712, 515, "12.bmp") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
dm.usedict 1
Delay 200
If findstrex(85, 154, 712, 515, "领取任务", "00fc00-000000") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
End If
Call 关闭大地图
If findimgex(5, 127, 255, 327, "三头魔王.bmp|黑山妖王.bmp|蓝色妖王.bmp|万年熊王.bmp") > - 1 Then
TracePrint "找到妖王"

    Exit sub
End If
Loop







End Sub

Sub 打开地图寻路
dm.usedict 1
If findstrex(85, 154, 712, 515, "领取任务", "00fc00-000000") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
If findimgex(5, 127, 255, 327, "三头魔王.bmp|黑山妖王.bmp|蓝色妖王.bmp|万年熊王.bmp") > - 1 Then
TracePrint "找到妖王"

    Exit sub
End If

    Do
    Delay 100
dm.moveto 0,0
    Call 关闭小地图
    Call 打开大地图
//    Delay 100
//    KDown "alt"
//    KPress "2"
//    KUp "alt"
//    Delay 800
If findimgex(129,224,662,370, "休息好了.bmp|状态很好.bmp") > - 1 Then
lClick imgx + 8, imgy + 5
dm.mover 0, - 150
End If
    If findimgex(140,142,235,192, "天宫.bmp|天宫1.bmp") > - 1 Then
        LClick imgx + 10, imgy + 8
        dm.mover 100,0
        Else
        TracePrint "没有找到"
    End If
    Delay 1000
    
    If findimgex(376,222,535,273, "李靖.bmp|选中.bmp") > - 1 Then
        LClick imgx + 5, imgy + 5
        dm.mover 100,0
//            KDown "alt"
//    KPress "1"
//    KUp "alt"
//    KDown "alt"
//    KPress "2"
//    KUp "alt"
Call 关闭小地图
Call 关闭大地图
        Exit do
    End If
    
    Loop

    
End Sub

Sub 寻找钟馗
Dim t
t=now
Call 吃香
If form1.CheckBox4.value = 1 Then
Call 判断领双    
End If
Call 关闭背包
If findimg("卖出.bmp") > - 1 Then
RClick imgx,imgy

End if
If findimgex(1, 134, 30, 172, "箭头.bmp") > - 1 Then
LClick imgx, imgy
Delay 200
dm.mover 200,0
End If
do
Delay 100
If ismove = False Then
Delay 200
dm.usedict 2
Delay 200
If findimg("大话精灵1.bmp") > - 1 Then
RClick imgx, imgy
Delay 100
End If
If findimgex(4, 138, 187, 275, "抓鬼.bmp") > - 1 and findstrex(6, 151, 162, 224, "斧头帮总部|大唐|长安城东|长寿村外|普陀山","00fc00-000000") = - 1 Then
Exit sub
End If
If findimgex(85, 154, 712, 515, "12.bmp") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
dm.usedict 1
Delay 200
If findstrex(85, 154, 712, 515, "我来帮你", "00fc00-000000") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
Call 打开寻路
dm.usedict 2
If findstrex(158,67,635,492, "钟馗捉鬼", "e0b490-000000") > - 1 Then
LClick strx, stry
dm.moveto 0,0
Delay 100
If findimgex(229, 64, 536, 251, "钟馗NPC.bmp|钟馗3.bmp") > - 1 Then
Delay 100
LClick imgx + 10, imgy + 7
dm.moveto 0,0
End If
End If
If datediff("s", t, now) > 1000 * 300 Then
Call 关闭寻路
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47,299,454,492,"角2.bmp")>-1 Then
If Findmycolor(135,231,668,368,"f8fcf8-000000") =1 Then
If findmycolor(134,230,374,374,"00fc00-000000")=1 Then
lclick intx + 10, inty + 5
ElseIf findimgex(125, 222, 356, 299, "11.bmp") > - 1 Then
dm.moveto imgx,imgy
For 5
Delay 100
dm.leftclick
Next
End If
Else
TracePrint "没有找到对话标志"
End If    
End If    
End If
Delay 1500
If findimgex(85, 154, 712, 515, "12.bmp") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
dm.usedict 1
Delay 200
If findstrex(85, 154, 712, 515, "我来帮你", "00fc00-000000") > - 1 Then
LClick imgx+10,imgy+2
Exit sub
End If
End If
Loop

End Sub
Sub 队员战斗
Dim a
a=0
dm.usedict 1
Do
    TracePrint "a="&a
Delay 100
If a > ubound(hwndss) Then
i=0
Exit sub
End If
hwnd=hwndss(a)
TracePrint hwnd
dm.SetWindowState hwnd,5
dm.SetWindowState hwnd,12

Call BindWindows(hwnd)
// dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.input.lock.api|dx.mouse.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.graphic.protect",101)
// Delay 2000
If dm_ret = 1 Then
TracePrint "绑定成功"
Else
TracePrint "绑定失败"

End If
// If form1.CheckBox3.value = 1 Then
// Call 领盒子    
// End If     
If findimg("大话精灵.bmp") > - 1 Then
RClick imgx, imgy
Delay 100
RClick imgx,imgy
End If
If findimgex(159,337,673,523,"确定1.bmp") > - 1 Then
LClick imgx,imgy
End If
Delay 100
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47, 299, 454, 492, "角2.bmp") > - 1 Then
LClick 400, 300
Delay 100
dm.moveto 0, 0
Delay 100
End If
If findimgex(323, 256, 478, 342, "取消.bmp") > - 1 Then
TracePrint "自动打怪中"
KDown "alt"
Delay 100
KPress "8"
Delay 100
KUp "alt"
Else
If a = 0 Then
    Delay 2000
End If
KPress 112


lclick 232, 189



For 2
    

dm.leftclick
Next
dm.mover 100,0
KDown "alt"
Delay 100
KPress "8"
Delay 100
KUp "alt"

End If
RClick 0,0
If findimgex(561,308,797,530,"5.bmp|6.bmp") = - 1 Then '自动打怪
If form1.ComboBox2.listindex = 0 Then
i = 0

End If
Exit Sub
End If
dm_ret = dm.SetWindowState(hwnd,2)
a=a+1
dm_ret = dm.UnBindWindow()
loop
End Sub
Sub 领双(shijian)
dm.usedict 1
If findstrex(124, 202, 688, 480, "领取", "00fc00-000000") > - 1 Then
If shijian = "一小时" Then
Delay 200
If findstrex(124, 202, 688, 480, "领取一小时", "00fc00-000000") > - 1 Then
LClick strx + 20, stry + 5
If findstrex(124, 202, 688, 480, "你这个星期的雇佣", "f8fcf8-000000") > - 1 Then
MessageBox "你本星期的双已用完"
End If
If findstrex(124, 202, 688, 480, "希望你能奋勇杀敌", "f8fcf8-000000") > - 1 Then
LClick strx,stry
End If
Exit sub
End If
ElseIf shijian = "二小时" Then
If findstrex(124, 202, 688, 480, "领取二小时", "00fc00-000000") > - 1 Then
LClick strx + 20, stry + 5
Delay 500
If findstrex(124, 202, 688, 480, "你这个星期的雇佣", "f8fcf8-000000") > - 1 Then
MessageBox "你本星期的双已用完"
End If
Delay 500
If findstrex(124, 202, 688, 480, "希望你能奋勇杀敌", "f8fcf8-000000") > - 1 Then
LClick strx,stry
End If
Exit sub
End If
ElseIf shijian = "四小时" Then
If findstrex(124, 202, 688, 480, "领取四小时", "00fc00-000000") > - 1 Then
LClick strx + 20, stry + 5
If findstrex(124, 202, 688, 480, "你这个星期的雇佣", "f8fcf8-000000") > - 1 Then
MessageBox "你本星期的双已用完"
End If
If findstrex(124, 202, 688, 480, "希望你能奋勇杀敌", "f8fcf8-000000") > - 1 Then
LClick strx,stry
End If
Exit sub
End If
Else
TracePrint "啥都没找到"
End If
End If
end sub
Sub setdime
注册码=form1.InputBox3.text
特征码 = Plugin.dbsoft.EthernetAddress()
Call Plugin.Sys.SetCLB(特征码)
TracePrint 特征码
scrit = Plugin.dbsoft.AES_ED(注册码, "jx132rose", 1)
TracePrint scrit
If 特征码 <> scrit Then
MessageBox "注册码错误,脚本停止"
ExitScript
Else
Call Plugin.Msg.Tips("注册成功,权限永久")
End if
End sub
Sub 战斗
dm.usedict 1
If findimg("大话精灵.bmp") > - 1 Then
RClick imgx, imgy
Delay 100
RClick imgx,imgy
End If
If findimgex(159,337,673,523,"确定1.bmp") > - 1 Then
LClick imgx,imgy
End If
If findimgex(323, 256, 478, 342, "取消.bmp") > - 1 Then
TracePrint "自动打怪中"
KDown "alt"
Delay 100
KPress "8"
Delay 100
KUp "alt"
Else
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47, 299, 454, 492, "角2.bmp") > - 1 Then
LClick 400,300
End if
Delay 1000
Delay 100
KPress 112
Delay 100
LClick 189,272
Delay 100
dm.leftclick
KDown "alt"
Delay 100
KPress "8"
Delay 100
KUp "alt"
RClick 100,0
End If
If findimg("帮助.bmp") > - 1 Then
    KPress "F1"
End If
RClick 11,11
If findimgex(753, 453, 791, 473, "5.bmp|6.bmp") = - 1 Then '自动打怪

Exit Sub
End if
End Sub
Sub 加点
LClick 696, 24
Delay 100
dm.moveto 0,0
If 判断人物 = "女人" Then
If findimgex(397, 44, 792, 498, "敏.bmp") > - 1 Then
LClick imgx + 100, imgy + 5
For 59
Delay 100
dm.leftclick
next
End If
If findimgex(397, 44, 792, 498, "法.bmp") > - 1 Then
LClick imgx + 100, imgy + 5
For 19
Delay 100
dm.leftclick
next
End If
ElseIf 判断人物 = "男鬼" Then
If findimgex(397, 44, 792, 498, "法.bmp") > - 1 Then
LClick imgx + 100, imgy + 5
For 59
Delay 100
dm.leftclick
next
End If
If findimgex(397, 44, 792, 498, "血.bmp") > - 1 Then
LClick imgx + 100, imgy + 5
For 19
Delay 100
dm.leftclick
next
End If
ElseIf 判断人物 = "男仙" Then
If findimgex(397, 44, 792, 498, "法.bmp") > - 1 Then
LClick imgx + 100, imgy + 5
For 79
Delay 100
dm.leftclick
next
End If
If findimgex(397, 44, 792, 498, "血.bmp") > - 1 Then
LClick imgx + 100, imgy + 5
For 19
Delay 100
dm.leftclick
next
End If
End If
If findimgex(397, 44, 792, 498, "加点确定.bmp") > - 1 Then
LClick imgx + 2, imgy + 2
End if
If findimgex(397, 44, 792, 498, "x.bmp") > - 1 Then
LClick imgx + 2, imgy + 2
End if    
End Sub
Function 判断人物
Dim dm_ret
dm_ret = dm.FindPic(662,1,794,67,"女人.bmp|男鬼.bmp|","000000",0.9,0,intX,intY)
If dm_ret = 0 Then
判断人物 = "女人"
ElseIf dm_ret = 1 Then
判断人物 = "男鬼"
ElseIf dm_ret = 2 Then
判断人物="男仙"
End If
End function
Function ismove()
Delay 300
TracePrint "判断人物是否在移动"
dim s,ss '判断人物是否在移动 829395 9fb3b3
ismove= False
dm_ret = dm.UseDict(2)
s = dm.Ocr(70, 6, 137, 32, "e8dcc8-000000", 1.0)
TracePrint s
For 3
Delay 200
ss = dm.Ocr(70,6,137,32, "e8dcc8-000000", 1.0)
TracePrint ss
If s <> ss and s<>""Then
TracePrint "person is moving"
ismove = true
Delay Random(50, 100)
Exit Function
End If
next
End Function
Sub entry
hwnd=父句柄
TracePrint "句柄:"&hwnd
set dm = createobject("dm.dmsoft")
dm.SetPath "D:\web\资源包"
dm_ret = dm.SetShowErrorMsg(0)
TracePrint dm_ret
dm_ret = dm.SetDict(0, "D:\web\资源包\宋10.txt") 'dx.graphic.2d.2| dx.graphic.3d dx.mouse.api| |dx.keypad.state.api|dx.keypad.api dx.public.active.api|
dm_ret = dm.SetDict(1, "D:\web\资源包\宋11.txt")
dm.EnableMouseMsg 1
dm.LockInput 1
dm.DisableScreenSave
dm.DisablePowerSave
dm_ret = dm.BindWindowEx(hwnd,"normal","dx.mouse.position.lock.api","dx.keypad.input.lock.api","dx.public.active.api|dx.public.active.message|dx.public.anti.api|dx.public.km.protect",101)
Delay 2000
TracePrint dm_ret
Do
Delay 200
dm_ret = dm.SetWindowState(父句柄, 1)
If dm_ret = 1 Then
Call 主线
End If
Delay 100
loop
End Sub
Sub 主线
Dim t
t=now
do
Delay 200
If findimgex(2,77,467,569, "8.bmp|9.bmp") > - 1 Then
exit do    
End If
If Findmycolor(11,158,74,173, "f8fc00-000000")=1 Then
If findmycolor(2,152,189,239, "00fc00-000000")=1 Then
lclick intx, inty
Delay 200
dm.moveto 0,0
End If
End If
Delay 200
If findimgex(104, 198, 198, 275, "角.bmp") > - 1 and findimgex(47,299,454,492,"角2.bmp")>-1 Then
If Findmycolor(135,231,668,368,"f8fcf8-000000") =1 Then
If findmycolor(134,229,374,374,"00fc00-000000")=1 Then
lclick intx + 10, inty + 5
ElseIf findimgex(125, 222, 356, 299, "11.bmp") > - 1 Then
dm.moveto imgx,imgy
For 5
Delay 100
dm.leftclick
Next
End If
Else
TracePrint "没有找到对话标志"
End If    
End If
Delay 200
If findimgex(6, 9, 215, 44, "2.bmp") > - 1 Then
KPress "esc"
End if
If findimgex(753, 453, 791, 473, "5.bmp|6.bmp") > - 1 Then '自动打怪
LClick imgx,imgy
End If
//If findstrex(323, 256, 478, 342, "取消", "00fc00-000000") > - 1 Then
//    LClick strx,stry
//End If
If findimgex(641,140,666,163, "礼包关闭.bmp") > - 1 Then
LClick imgx,imgy
End If
If findimgex(235, 341, 395, 389, "确定.bmp") > - 1 Then
LClick imgx,imgy
End If
If findimgex( 92,186,217,259,"关闭.bmp") > - 1 Then '此处有误点
LClick imgx+2,imgy+2
End If
If findimgex(485, 40, 520, 79, "x.bmp") > - 1 Then
LClick imgx+2,imgy+2
End If
Loop While datediff("s",t,now)>10000
TracePrint 任务类形
Select Case 任务类形
Case "传送知识问答"
Call 传送知识问答
Case "领取礼包"
Call 领取礼包
Case Else
TracePrint "未识别任务类形或无任务选择"
End Select
Delay 200    
End Sub
Function 任务类形()
Delay 300
If findimg("9.bmp") > - 1 Then
任务类形 = "领取礼包"
exit Function
elseIf findimg("8.bmp") > - 1 Then '郭长青.bmp与后面的瓦当之情有冲突
任务类形 = "传送知识问答"
Exit Function
end if
End Function
Sub 传送知识问答
dm.usedict 1
Do
Delay 200
TracePrint "进入传送知识问答"
question = dm.ocr(134,231,668,372, "f8fcf8-000000", 1.0)
TracePrint question
If question = "传送是想去哪就去哪么" Then
If findstrex(134,231,668,372,"不是", "00fc00-000000") > - 1 Then
LClick strx,stry
End If
ElseIf question = "组队可以传送么怎么收费" Then
If findstrex(134,231,668,372, "只收一个人的钱", "00fc00-000000") > - 1 Then
LClick strx,stry
End If
ElseIf question = "" Then
Exit sub
End If
If findimg("8.bmp") = - 1 Then
Exit do
End If
loop    
End Sub
Sub 领取礼包
Do
Delay 200
If FindImgEx(122, 131, 678, 469, "9.bmp|queding.bmp") > - 1 Then
LClick imgx, imgy
Else
If findimgex(641, 141, 665, 163, "10.bmp") > - 1 Then
LClick imgx,imgy
End If
Exit sub
End If
loop
End Sub
Function openbag(setx, sety, setx1, sety1, setimg)
Delay 200
Dim ss,sss,id,x,y,index
KDown "alt"
Delay 200
KPress "e"
Delay 200
dm_ret = dm.FindPicEx(setx,sety,setx1,sety1,setimg,"000000",0.9,0) '626,220 637,257
If len(dm_ret) > 0 Then
TracePrint len(dm_ret)
ss = split(dm_ret, "|")
index = 0
count = UBound(ss) + 1
Do While index < count
TracePrint ss(index)
sss = split(ss(index),",")
id = int(sss(0))
x = int(sss(1))
TracePrint "找到图片序号"&id&"坐标:"&x&","&int(sss(2))
y = int(sss(2))
TracePrint y
RClick x, y
Delay 800
dm.moveto 0, 0
Delay 400
If findimg("勾.bmp|勾1.bmp") > - 1 Then
LClick imgx, imgy
dm.moveto 0,0
End If
Delay 1000
index = index + 1
If findimg("确定.bmp|确定1.bmp|确定3.bmp") > - 1 Then
LClick imgx, imgy
dm.moveto 0,0
End If
If findimg("无法放入.bmp") > - 1 Then
MessageBox "背包已满请手动整里"&vbcrlf&"整理后再继续"
End If
Loop
End If
KDown "alt"
Delay 200
KPress "e"
End Function

[/hide]

附件:您需要登录才可以下载或查看附件。没有帐号? 注册

    已有5评分我要评分查看所有评分

    本主题由 超级版主 瑞祥幽冥狼 于 2022/5/4 12:23:43 执行 审核帖子 操作
    黎明破晓找自己
    日薄西山找自己
    皓月当空找自己
    ....
    接单:qq280523574
    2#

    怎么购买?

    3#

    学习学习

    4#

    sdsadasd

    5#

    00000

    6#

    没看到鬼王的啊。有没有鬼王的分享下。谢谢

    7#

    该用户帖子内容已被屏蔽

    8#

    该用户帖子内容已被屏蔽

    9#

    该用户帖子内容已被屏蔽

    10#

    学习学习

    11#

    学习下

    12#

    看看是什么东西

    13#

    6666666666666666

    14#


    15#

    看看

    16#

    厉害了我的哥

    17#

    特征码 = Plugin.dbsoft.EthernetAddress()
    Call Plugin.Sys.SetCLB(特征码)
    TracePrint 特征码
    scrit = Plugin.dbsoft.AES_ED(注册码, "jx132rose", 1)


    麻烦回下这是什么插件

    18#

    哥,能把dm.SetPath "D:\web\资源包"这个发出来么

    19#

    学学习习

    20#

    感谢分享

    发新话题 回复该主题