VBS file.Close
EndIf
VBS Set file=fso.OpenTextFile(filename,2)
VBS file.WriteLine(txt)
VBS file.Close
now01=timer
Return CX.句柄_02
Sub CX.找到精灵
chose = 0
txt_record="CX.找到精灵"
var01=Split(var1,",")
Gosub CX.日志.记录
//原来位置查找精灵
For 100
Delay 200
Rem 精灵好像不在
If X_last>0
X01 = X_last-15 : Y01= Y_last-15 : X02= X_last+15 : Y02 = Y_last+15
Else
X01 = A : Y01= B : X02= C : Y02 = D
EndIf
Plugin XY = Bkgnd.FindCenterColor(Hwnd, X01, Y01, X02, Y02, COL01)
If XY = "-1|-1"
Plugin XY = Bkgnd.FindCenterColor(Hwnd, X01, Y01, X02, Y02, COL02)
COL01 = COL02
EndIf
MyArray = Split(XY, "|")
X_last = CInt(MyArray(0)): Y_last = CInt(MyArray(1))
If X_last >0
If X_last > a1 and X_last < a2 and Y_last > b1 and Y_last < b2
X01 = A : Y01= B : X02= C : Y02 = D
Goto 精灵好像不在
EndIf
//下面这句用于向后台窗口句柄(变量:Hwnd)的客户区域(坐标:X_last, Y_last)处发送一个鼠标左键单击
Plugin Bkgnd.LeftClick(Hwnd, X_last, Y_last)
Plugin Bkgnd.LeftClick(Hwnd, X_last, Y_last)
For 5
Delay 100
Plugin GetColor = Bkgnd.GetPixelColor(Hwnd, 789, 748)
If GetColor = "9C5108"
Plugin Bkgnd.LeftClick(Hwnd, 789, 748)
Delay 200
Goto 精灵好像不在
EndIf
Plugin GetColor = Bkgnd.GetPixelColor(Hwnd, X_n, Y_n )
If GetColor <> Color_N
txt_record="X坐标:" & X_last & " Y坐标:" & Y_last & "颜色:" & COL01
Gosub CX.日志.记录
Goto 找到精灵了
EndIf
Gosub 点到玩家
Gosub CX.选择面向精灵
If chose = 1
Goto END.找到精灵
EndIf
EndFor
EndIf
txt_record=XY
Gosub CX.日志.记录
Plugin GetColor = Bkgnd.GetPixelColor(Hwnd, X_n, Y_n )
If GetColor <> Color_N
txt_record="X坐标:" & X_last & " Y坐标:" & Y_last & "颜色:" & COL01
Gosub CX.日志.记录
Goto 找到精灵了
EndIf
Delay time101
EndFor
Rem 找到精灵了
//下面这句是最小化窗口
Plugin Window.Min(Hwnd)
filename="..\7time_A.txt"
Gosub CX.读文件
time_A=cint(txt)
Delay time_A * 45
//下面这句是还原窗口
Plugin Window.Restore(Hwnd)
//Plugin Window.Size(Hwnd01, A_1, B_1)
//下面这句按从左到右,从上到下的顺序查找窗口句柄(变量:Hwnd)窗口的指定矩形区域内指定颜色
i=-1
For 6
Delay 44
Plugin XY = Bkgnd.FindColor(Hwnd, 545, 480, 577, 492, "FFD384")
MyArray = Split(XY, "|")
X = CInt(MyArray(0)): Y = CInt(MyArray(1))
If X > 0 and Y >0
Goto OK!可以选择技能
EndIf
i=i+1
EndFor
Rem OK!可以选择技能
time_A=time_A+i
txt=time_A:filename="..\7time_A.txt"
Gosub CX.写入文件
Gosub CX.选择技能
Rem END.找到精灵
Return CX.找到精灵
Sub CX.选择技能
i10=0
Rem 动画中
Plugin GetColor = Bkgnd.GetPixelColor(Hwnd, 468, 224)