Sub 攻击
    t3=now
    Rem 普通攻击
    //Gosub 窗口状态
    If datediff("s",t3,now)>=30
        //如果超过30秒怪没死则重新寻怪
        Goto 寻怪
    Else 
        IfColor x+85,y+32,ffcd4b,2
            KeyPress 112,1
            KeyPress 113,1
            Gosub 加血
            Gosub 加蓝
        Else 
            KeyPress 49,1
            Delay 50
            KeyPress 49,1
            Gosub 加血
            Gosub 加蓝
        EndIf 
        IfColor x+228,y+24,566bff,2
            //判断怪是否死亡
            Goto 普通攻击
        Else 
            Delay 100
            KeyPress 49,1
        EndIf 
    EndIf 
Return 攻击
//********攻击子程序结束********
//*******下面是加血子程序*******
Sub 加血
    //Gosub 窗口状态
    IfColor x+85,y+23,4d61ff,2
        //判断是否需要回城
        IfColor x+96,y+23,4d61ff,2
            //不需要回城则判断是否需要加血
        Else 
            KeyPress 52,1
            Delay 1000
            //喝血并延迟1秒钟,延迟过短会造成一次喝几瓶红的现象
        EndIf 
    Else 
        //Gosub 窗口状态
        KeyPress 57,1
        For 10
            IfColor x+85,y+23,4d61ff,2
                //回城状态下检查血并紧急加血,按键为F8
                Delay 1000
            Else 
                KeyPress 119,1
                Delay 1000
            EndIf 
        EndFor 
        //回城
        For 5
            Beep 
            Delay 1000
        EndFor 
        Gosub 死亡回城
        //VBSCall RunApp("shutdown.exe -s")
    EndScript 
    //没红则回城并结束脚本,可自行修改回城按键
EndIf 
Return 加血
//********加血子程序结束********
//*******下面是加蓝子程序*******
Sub 加蓝
    IfColor x+96,y+32,ffcd4b,2
        //蓝够不加蓝,否则不加蓝
    Else 
        KeyPress 53,1
        Delay 1000
        //喝蓝并延迟1秒钟,延迟过短会造成一次喝几瓶蓝的现象
    EndIf 
Return 加蓝
//********加蓝子程序结束********
//*****下面是拾取物品子程序*****
Sub 拾取物品
    For 3
        KeyPress 51,1
        Delay 500
    EndFor 
Return 拾取物品
//******拾取物品子程序结束******
//*****下面是扔掉配方子程序*****
Sub 扔掉配方
    //Gosub 窗口状态
    VBSCall FindPic(x+11,y+332,x+200,y+578,"Attachment:\配方win.bmp",0.5,x1,y1)
    //查找背包里是否有配方
    If x1>0 and y1>0
        Goto 过滤
        //有配方则进行过滤
    Else 
        KeyPress 66,1
        Delay 100
        t2=now
        //重新计算检查背包计时
        Goto 开始
        //没有配方就直接进入正常打怪