Else 
        Goto 按上
    EndIf 
    Delay 1000
    Rem 小旗放置A
    VBSCall FindPic(413,90,711,506,"d:\小旗.bmp",0.9,x,y)
    If x>=0 and y>=0
        Delay 50
        MoveTo x,y
        Delay 200
        LeftDownS 1
        Delay 200
        MoveToS 636,589
        Delay 200
        LeftUpS 1
        Delay 200
        KeyPressH 27,1
        Goto 小旗结束
    Else 
        IfColor 660,404,395d63,2
            Goto 按下
        Else 
            Delay 200
            KeyPressH 27,1
            Goto 小旗结束
        EndIf 
    EndIf 
    Rem 按下
    IfColor 661,402,18cf7b,2
    Else 
        MoveToS 661,426
        Delay 200
        LeftClickS 1
        Delay 200
        Goto 小旗放置A
    EndIf 
    Rem 小旗结束
    MoveToS 0,0
    xq=1
Return 黄巾令旗数量检测
////////////////////////////////////////////////////////////////
Sub 棉质黄巾数量检测
    IfColor 664,582,181c10,2
        Goto 包裹里找黄巾
    Else 
        Goto 黄巾结束
    EndIf 
    Rem 包裹里找黄巾
    Delay 200
    MoveToS 794,256
    Delay 200
    LeftClickS 1
    Delay 2000
    IfColor 661,218,18d373,2
        Goto 准备按上B
    Else 
        Goto 黄巾放置A
    EndIf 
    Rem 准备按上B
    MoveToS 660,219
    Delay 200
    LeftDownS 1
    Rem 按上2
    IfColor 660,246,9e63,2
        Delay 50
        LeftUpS 1
        Delay 50
        MoveToS 0,0
    Else 
        Goto 按上2
    EndIf 
    Delay 1000
    Rem 黄巾放置A
    VBSCall FindPic(413,90,711,506,"d:\头巾.bmp",0.9,x,y)
    If x>=0 and y>=0
        Delay 50
        MoveTo x,y
        Delay 200
        LeftDownS 1
        Delay 200
        MoveToS 668,588
        Delay 200
        LeftUpS 1
        Delay 200
        KeyPressH 27,1
        Goto 黄巾结束
    Else 
        IfColor 660,404,395d63,2
            Goto 按下B
        Else 
            Delay 200
            KeyPressH 27,1
            Goto 黄巾结束
        EndIf 
    EndIf 
    Rem 按下B
    IfColor 661,402,18cf7b,2
    Else 
        MoveToS 661,426
        Delay 200