1、PutAttachment "c:\test","*.*" set ws=createobject("Wscript.Shell") ws.run "regsvr32 c:\test\dm.dll /s" set ws=nothing Delay 1500 Set dm = CreateObject("dm.dmsoft") ver = dm.Ver() If len(ver) = 0 Then MessageBox "创建对象失败,检查系统是否禁用了vbs脚本权限" EndScript End If //ss=50 dm.SetPath "c:\test" dm
2、SetDict 0, "dnfsz.txt" //dm.setpath "C:\Documents and Settings\Administrator\桌面\大漠" //dm.setdict 0, "C:\Documents and Settings\Administrator\桌面\大漠\拍卖行.txt" dm.LockInput 1 str="SUM" ux=0:uy=0 UserVar ss=0 "价格" do hwnd = dm.FindWindow("","地下城与勇士") dm_ret = dm.BindWindow(hwnd, "dx2", "windows
3、2", "dx", 0) dm.MoveWindow hwnd,0,0 If dm_ret = 1 Then MessageBox "开始" Exit do End If Delay 100 Loop // do IfColor ux+40,uy+462,"B7",0 Then Exit do End If Delay 100 Loop // dm.MoveTo ux+169, uy+127 dm.LeftClick Delay 100 While 1 = 1 For 100 IfColor ux+351,uy+199,"FFFFFF",0 T
4、hen Exit For End If IfColor ux+351,uy+199,"FFFFFF",1 Then dm.MoveTo ux+317,uy+410 dm.LeftClick Delay 100 dm.MoveTo ux+326, uy+182 Delay 100 IfColor ux+351,uy+199,"FFFFFF",0 Then Exit For End If End If Delay 10 Next For 100 IfColor ux+582,uy+175,"B1FF",0 Then Exit For End If IfColo
5、r ux+582,uy+175,"3232FF",0 Then Exit For End If Delay 10 Next jiage=dm.Ocr(493,173,565,183,"ffb100-000000|ff3232-000000",1.0) shuliang = dm.Ocr(122,173,159,182,"ffffff-000000|ffb500-000000",1.0) jinbi = dm.Ocr(496, 404, 595, 414, "ddc593-000000", 1.0) If shuliang = "" Then shuliang=1 End I
6、f danjia = jiage / shuliang // danjia=CLng(danjia) danjia = CInt(danjia) danjia=danjia*1 Call Plugin.QP.ShowQiPao( danjia,"单价为" ,1000,1) TracePrint "价格 "&jiage&",数量 "&shuliang&",单价为 "&danjia&",还剩金币 "&jinbi str=str & " " & danjia & "*" & shuliang & "=" & jiage & " | " TracePrint str dm_ret
7、 = dm.CmpColor(570,176,"ff3232-000000",0.9) If dm_ret = 0 Then TracePrint "太贵,买不起放弃……" //MsgBox "太贵,买不起放弃……" Else If danjia <= ss Then dm.LeftClick For 5 dm_ret = dm.FindStr(0,0,640,480,"公告","ffffff-000000",1.0,intX,intY) If intX >= 0 and intY >= 0 Then dm.LeftClick End If dm_ret = d
8、m.FindStr(0,0,640,480,"确认","ddc58d-000000",1.0,intX,intY) If intX >= 0 and intY >= 0 Then dm.MoveTo intX, intY dm.LeftClick End If Delay 10 dm_ret = dm.FindStr(0,0,640,480,"公告","ffffff-000000",1.0,intX,intY) If intX < 0 and intY < 0 Then Exit For End If Next dm.MoveTo ux+169, uy+127
9、 dm.LeftClick Delay 100 // MessageBox "" TracePrint "赶紧买下" // Call Plugin.Msg.Tips("赶紧买下") ///MsgBox "赶紧买下" End If If danjia > ss Then // Call Plugin.Msg.Tips("黑人啊,这么贵") //MsgBox "黑人啊,这么贵" End If End If dm_ret = dm.FindStr(0,0,640,480,"公告","ffffff-000000",1.0,intX,intY) If intX >= 0 and intY >= 0 Then dm.LeftClick End If dm_ret = dm.FindStr(0,0,640,480,"确认","ddc58d-000000",1.0,intX,intY) If intX >= 0 and intY >= 0 Then dm.MoveTo intX, intY dm.LeftClick End If dm.KeyPress 13 Wend Sub OnScriptExit() dm.LockInput 0 dm_ret = dm.UnBindWindow() End Sub






