bbzc1y=bbzbY+45
    bbzc2x=bbzbX+181
    bbzc2y=bbzbY+304 
  
    MoveTo 708+w1,253+h
    x=bbzbx-143
    y=bbzby+30
    Delay 300
    i=7
    While i>0
        Delay 30
        y=y+40
        i=i-1
        j=7
        While j>0
            delay 30
            x=x+40
            j=j-1
            //开始出售物品
            If cswbc=0 then
                If csw =0 then 
                   
                    Call 买药()                  

                Else 
                    MoveTo x,y
                    Delay 100
                    LeftClick 1
                    Delay 100
                    MoveTo 345+w1,410+h1
                    Delay 300
                    LeftClick 1
                    
                    Delay 400                 
                    csw =csw -1
                End if 
            Else 
                cswbc=cswbc-1
                    
            End if
        Wend
        x=586+w1-40
    Wend
    Call 买红药()
End Sub
 
 



   
Sub 买红药()
    Delay 500
    For jkhydll  
      
 

        If  hongyezl=1 then
            //活血丸
            Delay 100 
            MoveTo 95+w1,295+h1
            Delay 100
            LeftClick 1
        else
            Delay 100
            //通络丸
            If hongyezl=2 then
                Delay 100
                MoveTo 290+w1,295+h1
                Delay 100
                LeftClick 1
            else
                Delay 100
                //强身丸
                If hongyezl=3 then
                    Delay 100 
                    MoveTo 95+w1,410+h1
                    Delay 100
                    LeftClick 1
                else
                    Delay 100
                    //健骨丸
                    If hongyezl=4 then
                        Delay 100
                        MoveTo 290+w1,410+h1
                        Delay 100
                        LeftClick 1
                    else
                        Delay 100
                        //修筋丸
                        If hongyezl=5 then
                            Delay 100
                            MoveTo  95+w1,530+h1
                            Delay 100
                            LeftClick 1
                        else
                            Delay 100
                            //大补丸
                            If hongyezl=6 then
                                Delay 100