暗黑破坏神吧 关注:681,706贴子:20,579,879
  • 4回复贴,共1

判断pet是否死亡代码

只看楼主收藏回复

Func GetMercLifeStatus()
$Pix = PixelGetColor (15 + $XDiff, 18 + $YDiff)
If $Pix == $MERC_GREEN_BAR_Color OR $Pix == $MERC_ORANGE_BAR_Color Then
Return 1
Else
Return -1
EndIf
EndFunc


1楼2009-04-02 21:48回复
    $MERC_GREEN_BAR_Color = 34304
    $MERC_ORANGE_BAR_Color = 2197206


    2楼2009-04-02 21:49
    回复
      初始化中定义
      $XDiff = 0
      $YDiff = 0
      没看懂


      3楼2009-04-02 21:51
      回复
        $Status = GetMercLifeStatus()
        ;Rescue Merc
        If $Status < 0 Then
        ;DownStairsToQual
        FromBlockClickTo (30, 200, 300, 550, 30, 110, $GREEN_BLOCKS_Color, 2)
        FromBlockClickTo (200, 100, 450, 350, - 330, 0, $GREEN_BLOCKS_Color, 2)
        FromBlockClickTo (300, 40, 480, 250, - 300, - 80, $GREEN_BLOCKS_Color, 2)
        LogEvent(0, "Try to rescue Merc")
        Sleep(3000)
        FromBlockClickTo (5, 5, 600, 300, 15, 15, $NPC_BODY_Color, 2)
        ;$No_Menu = 1
        ;While $No_Menu
        Sleep($nomenu_delay)
        $Open_Menu = PixelSearch(300, 75, 600, 300, $NPC_MENU_Color, 0, 5)
        If @error Then
        Sleep(3000)
        FromBlockClickTo (5, 5, 600, 300, 15, 15, $NPC_BODY_Color, 2)
        Sleep($nomenu_delay)
        $Open_Menu = PixelSearch(300, 75, 600, 300, $NPC_MENU_Color, 0, 5)
        If Not @error Then
        Sleep($random_delay2)
        MouseClick("left", $Open_Menu[0] + 125, $Open_Menu[1] + 40, 1, 10)
        Sleep($random_delay2)
        EndIf
        Else
        Sleep($random_delay2)
        MouseClick("left", $Open_Menu[0] + 125, $Open_Menu[1] + 40, 1, 10)
        Sleep($random_delay2)
        ;$No_Menu = 0
        EndIf
        ;WEnd
        ;QualToDownStairs
        FastClick("Left", 718, 388, 20, 2)
        CheckMove ($Char_CheckMoveDelay)
        FromBlockClickTo (100, 100, 550, 270, -50, 230, $GREEN_BLOCKS_Color, 2)
        FromBlockClickTo (300, 30, 530, 200, 220, 410, $GREEN_BLOCKS_Color, 2)
        FromBlockClickTo (430, 200, 690, 380, 50, 140, $GREEN_BLOCKS_Color, 2)
        FromBlockClickTo (180, 70, 380, 280, 270, -110, $GREEN_BLOCKS_Color, 2)
        $Status = GetMercLifeStatus()
        If $Status < 0 Then
        LogEvent(0, "Faild to rescue Merc")
        Else
        LogEvent(0, "succeed to rescue Merc")
        EndIf
        EndIf
        


        4楼2009-04-02 21:59
        回复
          以上为复活佣兵代码


          5楼2009-04-02 21:59
          回复