Dimenv hwnd, 数量, title
//初始化镜头
Hwnd = Plugin.Window.Foreground()
title = Plugin.Window.GetText(hwnd)
Call Plugin.Bkgnd.KeyPress(Hwnd,35)
Delay 50
For 10
Call Plugin.Bkgnd.KeyPress(Hwnd, 36)
Delay 50
Next
//获取窗口坐标
rect = Plugin.Window.GetClientRect(Hwnd)
rect = Split(rect, "|")
//开始
开始线程=BeginThread(开始)
计时线程=BeginThread(计时)
Sub 开始()
//获取窗口坐标
rect = Plugin.Window.GetClientRect(Hwnd)
rect = Split(rect, "|")
//定义屏幕矩形变量
Dim x1
Dim y1
Dim x2
Dim y2
//变量赋值
x1 = rect(0) + rect(2) / 2 - rect(2) / 4
y1 = rect(1) + rect(3) / 2
x2 = rect(0) + rect(2) / 2 + rect(2) / 4
y2 = rect(1) + rect(3) / 2 + rect(3) / 3
数量 = 0
Rem fish
LockMouse
//放鱼竿
KeyPress 49, 1
//移动鼠标遍历屏幕直到找到鱼漂
intA = x1
intB = y1
i = 0
j=0
MoveTo intA, intB
Delay 1000
//获取鼠标形状,1053591638为鱼钩形状
shape = GetCursorShape(0)
//如果鼠标不是鱼钩形状则循环
Do While shape <> 1053591638
If intA + 5 > x2 Then
If intB + 50 > y2 Then
Exit Do
Else
intA = x1
intB =intB + 30
End If
Else
intA = intA + rect(2)/100
End If
MoveTo intA, intB
shape = GetCursorShape(0)
Delay 10
Loop
//将鼠标向左移动到鱼漂最左方恰好不变形状的位置
Do While shape = 1053591638
MoveTo intA, intB
If shape = 1053591638 Then
intA = intA - 1
Delay 5
End If
shape = GetCursorShape(0)
Loop
//将鼠标向右移动到鱼漂左方恰好变形状的位置
Do While shape <> 1053591638
MoveTo intA, intB
If shape <> 1053591638 Then
intA = intA + 1
j = j + 1
If j > 15 Then //15次未找到则认为出错,提出循环
Exit Do
End If
Delay 50
End If
xx1=intA
shape = GetCursorShape(0)
Loop
//将鼠标向右移动到鱼漂最右方恰好不变形状的位置
Do While shape = 1053591638