//查找窗口类名(0)或者标题("Element Client"),返回找到的句柄Hwnd
Hwnd = Plugin.Window.Find(0, "Element Client")
//得到窗口句柄的客户区大小
sRect = Plugin.Window.GetClientRect(Hwnd)
Dim Myarray
myarray = Split(sRect, "|")
ux = Clng(myarray(0))
uy = Clng(myarray(1))
Rem 选怪
Call 吃药()
KeyPress "1", 1
Delay 2000
KeyPress "Tab", 1
Delay 1000
IfColor 353+ux, 27+uy, "1D1DD0", 0 Then
Rem 打怪
Call 吃药()
KeyPress "F1", 1
Delay 1000
IfColor 233+ux,32+uy,"B5D5E9",0 Then
Goto 打怪
Else
Goto 选怪
End If
Else
Goto 选怪
End If
Sub 吃药()
IfColor 186+ux,25+uy,"2323BF",0 Then
KeyPress "3", 1
Delay 1000
End If
IfColor 179+ux,39+uy,"D6B200",0 Then
KeyPress "4", 1
Delay 1000
End If
End Sub