当前位置:文档之家› 魔兽后台钓鱼

魔兽后台钓鱼

UserVar Var1 = DropList{"不上鱼饵":1|"自动上饵":2}=0 "上饵设置"
Dimenv hwnd_zz,数量
ddx = "dx.public.active.api|dx.public.active.message|dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.state.api|dx.mouse.state.message|dx.mouse.api|dx.mouse.focus.input.api|dx.mouse.focus.input.message|dx.mouse.clip.lock.api|dx.mouse.input.lock.api|dx.mouse.cursor"
Call 注册()
Call 初始化()

//==========================初始化===========================//
Sub 初始化()
// 创建大漠对象,绑定窗口
Set dm = CreateObject("dm.dmsoft")
hwnd_zz = dm.GetMousePointWindow()
dm_ret = dm.BindWindowEx(hwnd_zz, "dx.graphic.2d|dx.graphic.3d", ddx, "windows", "dx.public.fake.window.min",4)
If dm_ret = 0 Then
MessageBox "绑定失败"
EndScript
End If

// 设置搜索间隔
a = 25 : b = 45
数量 = 0

// 视角初始化
dm.KeyPress (35)
For 10
Delay 500
dm.KeyPress (36)
Next

BeginThread 计时

// 开始钓鱼
上饵时间 = now
Call 钓鱼()

End Sub

//==========================找鱼漂(鼠标变鱼钩形状)===========================//
Sub 钓鱼()
// 设置搜索起始点
m = 1 : x = 247 : y = 376

// 上鱼饵
If var1 = 2 and DateDiff("s", 上饵时间, now) >= 600 Then
Delay 2000
dm.KeyPress (50)
Delay 2000
上饵时间 = now
End If

// 甩竿
时间 = now
dm.KeyPress (49)
Delay 1000

// 搜索鱼漂位置
Call 鱼漂(x, y)
Do
For m + 12
x = x + a
Call 鱼漂(x,y)
Next

For m
y = y - b
Call 鱼漂(x,y)
Next
m = m + 1

For m + 12
x = x - a
Call 鱼漂(x,y)
Next

For m
y = y + b
Call 鱼漂(x,y)
Next
m = m + 1

Loop Until m = 9

//没有找到鱼漂,重新开始
If m = 9 Then
Call 钓鱼()
End If

End Sub

//==========================鼠标变化===========================//
Sub 鱼漂(x,y)

dm.MoveTo x, y
Delay 50
shape = dm.GetCursorShape()

// 如果鼠标变成鱼钩形状(即找到鱼漂)
If shape = "3f1ccdd4" Then
// 往下移动鼠标直到鼠标形状刚好不是鱼钩
Do
dm.MoveTo x, y
Delay 100
shape = dm.GetCursorShape()
y = y + 5
Loop Until shape = "4f84c2ac"


Do
Delay 100
shape = dm.GetCursorShape()

// 等待鱼吃钩,鼠标变成鱼钩立即收竿并甩竿
If shape = "3f1ccdd4" Then
dm.Rightdown
dm.Rightup
数量 = 数量 + 1
Call 钓鱼()
End If

//20秒无变化就重新甩竿(应对意外情况)
If DateDiff("s", 时间, now) >= 20 Then
Call 钓鱼()
End If
Loop


End If
End Sub

//==========================注册===========================//
Sub 注册()
PutAttachment "d:\大漠", "*.*"
PutAttachment ".\Plugin", "RegDll.dll"
Call Plugin.RegDll.Reg("d:\大漠\dm.dll")
End Sub

//==========================计时===========================//
Sub 计时()

hwnd = hwnd_zz
开始时间 = now

Do

aaa = DateDiff("s", 开始时间, now)
t1 = aaa mod 60
t2 = Fix(aaa / 60) mod 60
t3 = Fix(aaa / 3600)

If t1 < 10 Then
text_t1 = "0" & t1
Else
text_t1 = t1
End If

If t2 < 10 Then
text_t2 = "0" & t2
Else
text_t2 = t2
End If

If t3 < 10 Then
text_t3 = "0" & t3
Else
text_t3 = t3
End If

new_title = "已钓"&数量&"条,用时 " & text_t3 & ":" & text_t2 & ":" & text_t1
Call Plugin.Window.SetText(hwnd, new_title)
Loop

End Sub

//==========================标题还原解绑窗口===========================//
Sub OnScriptExit()
Call Plugin.Window.SetText(hwnd_zz, "魔兽世界")
dm_ret = dm.UnBindWindow()
End Sub

相关主题
文本预览
相关文档 最新文档