EndIf 
    //标记,没找到怪番
    a=0
    m=0
    Goto 开始捉妖
EndIf 
Delay 3000
//没到循环寻路
Goto 去地点
Rem 开始捉妖
Delay 100
//如果是奇门
If qimen=1
    VBS stoptime=timer
    If stoptime-starttime>=600
        Plugin Bkgnd.KeyPress(hwnd,48)
        Delay 7000
        VBS starttime=timer
    EndIf 
EndIf 
//加血
IfColor hongx+hong,hongy,hongc,2
    Goto 加蓝
Else 
    If jiahong=0
        //按4加红
        Plugin Bkgnd.KeyPress(hwnd,52)
    Else 
        Goto 休息
    EndIf 
EndIf 
Rem 加蓝
IfColor lanx+lan,lany,lanc,2
    Goto 选怪
Else 
    //按6加蓝
    Plugin Bkgnd.KeyPress(hwnd,54)
EndIf 
Rem 选怪
m=m+1
If m>=3
    MoveTo mddx-100,mddy
    Delay 1000
    RightDown 1
    Delay 1000
    MoveTo mddx+150,mddy
    Delay 1000
    RightUp 1
    m=0
    a=a+1
EndIf 
If a>=5
    a=0
    Goto 出城捉妖
EndIf 
//按8键照妖镜
Plugin Bkgnd.KeyPress(hwnd,56)
Delay 1000
//TAB选怪
Plugin Bkgnd.KeyPress(hwnd,9)
Delay 1000
//判断是否满血.不抢怪
IfColor shoux+215,hongy,0000fa,2
    Rem 判断打怪
    //取消决斗
    VBSCall FindPic(0,0,w,h,"Attachment:\取消决斗.bmp",0.8,x,y)
    If x>0 and y>0
        MoveTo x,y
        Delay 1000
        LeftClick 1
    EndIf 
    //死亡
    VBSCall FindPic(0,0,w,h,"Attachment:\死亡.bmp",0.8,x,y)
    If x>0 and y>0
        MoveTo x,y
        Delay 1000
        LeftClick 1
        Delay 5000
        r=1
        Goto 回城
    EndIf 
    //判断是否空血
    IfColor shoux+108,hongy,0000fa,2
        //判断是否血到40%
        IfColor shoux+155,hongy,0000fa,2
            m=0
            Delay 100
            Plugin Bkgnd.KeyPress(hwnd,49)
            Delay 2000
            IfColor shoux+155,hongy,0000fa,2
            Else 
                Goto 捉妖
            EndIf 
            Plugin Bkgnd.KeyPress(hwnd,50)
            Delay 2000
            IfColor shoux+155,hongy,0000fa,2
            Else 
                Goto 捉妖
            EndIf 
            Plugin Bkgnd.KeyPress(hwnd,51)