If xa>0 and ya>0
    KeyPress 9,1
    Delay 50
Else 
    Rem 死亡
    Delay 50
    IfColor 72,67,212094,2
    Else 
        Gosub 红蓝
        IfColor 72,67,212094,2
        Else 
            LeftClick 1
            Delay 100
            MoveTo 539,354
            Delay 1000
            IfColor 539,354,219a9c,2
                LeftClick 1
                Delay 3000
                Goto 回城
            EndIf 
        EndIf 
    EndIf 
    Goto 范围
EndIf 
Goto 找怪
//此段为找不到怪时回挂机点和死亡检测
Rem 打怪
Delay 50
Gosub 红蓝
Rem 死亡
Delay 50
IfColor 72,67,212094,2
Else 
    Gosub 红蓝
    IfColor 72,67,212094,2
    Else 
        LeftClick 1
        Delay 100
        MoveTo 539,354
        Delay 1000
        IfColor 539,354,219a9c,2
            LeftClick 1
            Delay 3000
            Goto 回城
        EndIf 
    EndIf 
EndIf 
//打怪前红蓝检测和角色死亡检测
IfColor 420,14,108ace,1
    IfColor 424,13,009ece,1
        IfColor 411,28,002863,1
            IfColor 439,34,103810,1
                IfColor 417,44,21a663,1
                    IfColor 419,50,d6dbce,1
                        IfColor 414,12,633c18,1
                            IfColor 419,20,c692c6,1
                                IfColor 414,49,002c84,1
                                    IfColor 403,29,f7ffff,1
                                        IfColor 307,67,1018BD,2
                                            //打怪时角色过滤,避免点到的是角色
                                            KeyPress 49,1
                                            Delay 1000
                                            KeyPress 51,1
                                            Delay 500
                                            KeyPress 49,1
                                            Delay 2000
                                            KeyPress 50,1
                                            Delay 500
                                            KeyPress 53,1
                                            Delay 1000
                                            //战士打怪过程和拣物
                                            Gosub 躲怪
                                            Gosub 快红
                                            //躲怪和快速+红调用,防止遇到精英或被怪围攻
                                            VBSCall GetCursorPos(x2,y2)
                                            If x2=x1
                                                Delay 50
                                                KeyPress 9,1
                                                Delay 50
                                                Rem 范围
                                                MoveTo xd,yd
                                                Delay 1000
                                                LeftClick 1
                                                Delay 1000
                                                VBSCall FindColorEx(xd-10,yd-10,xd+10,yd+10,"00ebef",1,0.8,xa,ya)
                                                If xa>0 and ya>0
                                                    KeyPress 9,1
                                                    Delay 500
                                                Else 
                                                    Rem 死亡
                                                    Delay 50
                                                    IfColor 72,67,212094,2
                                                    Else 
                                                        Gosub 红蓝
                                                        IfColor 72,67,212094,2
                                                        Else 
                                                            LeftClick 1
                                                            Delay 100
                                                            MoveTo 539,354
                                                            Delay 1000