Plugin Hong8=DBsoft.OCR(0,331,584,353,593,0,1,11,1,1,"FFFF00",0,0,0)
    Delay 300
    //读取蓝药数量
    Plugin Lan7=DBsoft.OCR(0,293,584,319,593,0,1,11,1,1,"FFFF00",0,0,0)
    Delay 500
    //红小于60 蓝小于30 回城小于2 就买
    If hong8<=60 or lan7<=30 or hu0<=2
        Gosub 钱
        Rem 杂货店
        Delay 500
        //移动到阪泉杂货
        KeyPress 9,1
        Delay 300
        MoveTo 566,254
        Delay 300
        LeftClick 1
        Delay 300
        KeyPress 9,1
        Delay 100
        Gosub 当前坐标
        inputx=212:inputy=198:t1=now:gamex1=cint(gamex1):gamey1=cint(gamey1)
        //移动延时
        Delay 10000
        Gosub 移动
        VBSCall call FindPic(0,0,1280,1024,"Attachment:\dian.bmp",0.9,Dx,Dy)
        If DX>=0 and dy>=0
            Delay 100
            MoveTo dx,dy+60
            Delay 300
            RightClick 1
            Delay 300
            MoveTo 585,230
            Delay 500
            LeftClick 1
            Delay 1500
            //买红
            If cint(hong8)<cint(hong)
                MoveTo 88,189
                Delay 1000
                LeftClick 1
                Delay 300
                MoveTo 246,445
                Delay 300
                LeftClick 1
                Delay 300
                KeyPress 8,1
                Delay 300
                //a=180-hong8
                SayString cstr(cint(Hong)-cint(hong8))
                Delay 300
                MoveTo 237,475
                Delay 300
                LeftClick 1
                Delay 32
            EndIf 
            //买蓝
            If cint(lan7)<cint(lan)
                MoveTo 88,229
                Delay 300
                LeftClick 1
                Delay 300
                MoveTo 246,445
                Delay 300
                LeftClick 1
                Delay 300
                KeyPress 8,1
                Delay 300
                SayString cstr(cint(Lan)-cint(lan7))
                Delay 300
                MoveTo 237,475
                Delay 300
                LeftClick 1
                Delay 32
            EndIf 
            //买回
            If cint(hu0)<30
                MoveTo 55,269
                Delay 300
                LeftClick 1
                Delay 300
                MoveTo 246,445
                Delay 300
                LeftClick 1
                Delay 300
                KeyPress 8,1
                Delay 300
                SayString cstr(30-cint(Hu0))
                Delay 300
                MoveTo 237,475
                Delay 300
                LeftClick 1
            EndIf 
            //结束购买
            Delay 300
            MoveTo 289,118
            LeftClick 1
            Delay 300
            //关闭包裹
            KeyPress 66,1
            Delay 300