Else
            Goto 关闭宠物升级
        End if
    Else
        If DateDiff("n",TXZ,now)>=TX Then
            //宠物
            Call Plugin.Bkgnd.LeftClick(Hwnd,500,373)
            Delay 256
            //宠物栏1
            Call Plugin.Bkgnd.LeftClick(Hwnd,367,67)
            Delay 23
            i=0
            i=ch+1
            ic=0
            While i<> 0
                //点击宠物
                Call Plugin.Bkgnd.LeftClick(Hwnd,chongwux(ic),chongwuy(ic))
                Delay 256
                ic=ic+1
                i=i-1
                Color = Plugin.Bkgnd.GetPixelColor(Hwnd, 836,182)
                Delay 500
                //判断是否饥饿
                er = Plugin.Bkgnd.FindColorEx(Hwnd, 878,213,879,214,"0C4107",0,0.95)
                MyArray = Split(er, "|")
                xx = Clng(MyArray(0)): yy = Clng(MyArray(1))
                //如果饥饿喂食
                If xx<0 and yy<0 Then
                    Call Plugin.Bkgnd.LeftClick(Hwnd,912,207)
                    Delay 256
                    Call Plugin.Bkgnd.LeftClick(Hwnd,585,320)
                    Delay 256
                    Call Plugin.Bkgnd.LeftClick(Hwnd,585,320)
                    Delay 256
                    Call Plugin.Bkgnd.LeftClick(Hwnd,505,390)
                End if
                Delay 256
                If Color = "AEEAF6" Then
                    Goto nndd1
                Else
                    //点击升级
                    Delay 256
                    Call Plugin.Bkgnd.LeftClick(Hwnd,911,183)
                    Delay 300
                    //判断是否点成加速
                    er = Plugin.Bkgnd.FindColorEx(Hwnd, 526,329,532,339,"FFFFFF",0,0.9)
                    Delay 300
                    MyArray = Split(er, "|")
                    xx = Clng(MyArray(0)): yy = Clng(MyArray(1))
                    //如果是点错
                    If xx>0 and yy>0 Then
                        //就取消
                        Call Plugin.Bkgnd.LeftClick(Hwnd,531,391)
                        Delay 56
                        Call Plugin.Bkgnd.LeftClick(Hwnd,531,391)
                        Delay 56
                        Goto nndd1
                    End if
                    Delay 56
                    //Plugin Bkgnd.LeftClick(Hwnd,413,282)
                    //Delay 256
                    Call Plugin.Bkgnd.LeftClick(Hwnd,453,394)
                    Delay 1500
                    er = Plugin.Bkgnd.FindColorEx(Hwnd, 471,396,472,397,"010067",0,0.9)
                    Delay 300
                    MyArray = Split(er, "|")
                    xx = Clng(MyArray(0)): yy = Clng(MyArray(1))
                    If xx>0 and yy>0 Then
                        Delay 32
                        Call Plugin.Bkgnd.LeftClick(Hwnd,505,390)
                        Delay 500
                        Call Plugin.Bkgnd.LeftClick(Hwnd,533,399)
                    End if
                End if
                Rem nndd1
                Delay 500
            Wend
            TXZ=now
        End if
    End if
    Call 退出加血加蓝循环()
End Sub
Sub 古堡打怪()
    If dgjs>=gbcs Then
        MessageBox "古堡已经探险到规定的层数!~"
        EndScript
    Else
        Delay 256
        Call Plugin.Bkgnd.LeftClick(Hwnd,390,310)
        Delay 256
        Call Plugin.Bkgnd.LeftClick(Hwnd,453,394)
        Delay 150
        Call Plugin.Bkgnd.LeftClick(Hwnd,453,394)
        If yys=1 Then
            Delay 56
            Call 关闭打怪界面()
        Else
            Goto d2
        End if
        Rem d2