//调整游戏登录的窗口位置,最长操作时间约1分钟 Gosub 调整游戏登录的窗口位置 Delay 1000 ElseIf newwindow<=0 //按键F5刷新方法 KeyPress 116,1 Delay 3000 SetWaitColor=Array("6B6D31",60000,503,561,0) Gosub 等待设定之类似颜色出现 EndIf RefreshLoop = RefreshLoop+1 EndWhile // If RefreshLoop>=20 If ColorCompare(GetPixelColor(503,561),"6B6D31",20)<=0 Or ColorCompare(GetPixelColor(496,627),"2928C6",25)<=0 //刷新失败!重试刷新20次都没成功. RefreshResult = -1 EndIf Else Plugin ismlxthw=Window.IsWindow(mlxthw) If ismlxthw=1 //刷新完成. RefreshResult = 1 EndIf EndIf If RefreshResult=1 ChangeContent "Tex2", "刷新完成:" & RefreshResult ElseIf RefreshResult=-1 ChangeContent "Tex2", "刷新失败:" & RefreshResult Else ChangeContent "Tex2", "刷新错误:" & RefreshResult EndIf // Goto 开始 Return // Sub 刷新部分[停用] Rem 刷新部分重新执行 reref=1 KeyPress 44,1 If newwindow<=0 KeyPress 116,1 ElseIf newwindow=1 //把原来的窗口关闭,再打开窗口,调整窗口位置. KeyDown 18,1 KeyPress 115,1 KeyUp 18,1 Plugin Window.Close(mlxthw) Delay 3000 notexit=1 Gosub 调整魔力学堂窗口位置Sub //打开新窗口 notexit=0 Delay 1000 Gosub 调整游戏登录的窗口位置 EndIf Delay 500 cshshx=0 Rem 重试刷新 cshshx=cshshx+1 IfColor 503,561,6b6d31,2 IfColor 496,627,292cc6,2 //刷新后为游戏登录界面 Delay 200 MoveTo 423,561 LeftClick 1 Else If cshshx=21 KeyPress 116,1 EndIf Delay 2000 //约40秒后F5重试刷新 If cshshx<41 Goto 重试刷新 Else cshshx=0 Gosub 刷新部分重新执行 EndIf EndIf Else If cshshx>21 cshshx=0 KeyPress 116,1 EndIf Delay 2000 Goto 重试刷新 EndIf rere=0 Goto 开始 Return Sub 防卡刷新重置 rere=0 TimeOutRefreshTimeArray(0)=0 TimeOutRefreshTimeArray(1)=0 Return Sub 登录游戏 MoveTo 426,585 Delay 200 LeftDoubleClick 1 Delay 200