Results 1 to 1 of 1

Thread: [Fix]GetMiniMapDotsIn

  1. #1
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default [Fix]GetMiniMapDotsIn

    Code:
    {*******************************************************************************
    function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
    By: footballjds, NaumanAkhlaQ, Nava2 & Cazax
    Description: Results the dots specified by WhatDot in x1, y1, x2, y2.
    Usage : 'npc', 'yellow' : Yellow Dot;
            'cape', 'blue' : Blue Dot;
            'item', 'red' : Red Dot;
            'player', 'white' : White Dot;
            'friend', 'green' : Green Dot;
    *******************************************************************************}
    function GetMiniMapDotsIn(WhatDot: string; x1, y1, x2, y2: Integer): TPointArray;
    var
      Color: Integer;
    begin
      WhatDot := LowerCase(WhatDot);
      case WhatDot Of
        'npc', 'yellow': Color := 60909;
        'cape', 'blue': Color := 12742980;
        'item', 'red': Color := 789758;
        'player', 'white': Color := 16711422;
        'friend', 'green': Color := 61440;
      else
        srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
      end;
      FindColorsSpiralTolerance(MMCX, MMCY, Result, Color, x1, y1, x2, y2, 20);
      RAaSTPA(Result, 4);
      if (Length(Result) < 1) then Exit;
      if (WhatDot = 'player') or (WhatDot = 'white') then
      begin
        InvertTPA(Result);
        SetLength(Result, Length(Result) - 1);
        InvertTPA(Result);
      end;
    end;
    Added tolerance, the colors aren't static.

    And bump for my other fixes:
    Code:
    {*******************************************************************************
    function RuneAmount(area, runetype: String): Integer;
    By: masquerader and modified by Ron and ZephyrsFury
    Description: Returns the amount of a certain rune in the specified area.
    *******************************************************************************}
    function RuneAmount(Area, RuneType: string): Integer;
    var
      II: Integer;
      RuneNames: TStringArray;
    begin
      RuneNames := ['air', 'mind', 'water', 'fire', 'earth', 'law', 'nature', 'chaos', 'death', 'body', 'cosmic', 'soul', 'blood'];
      if (InStrArrEx(Lowercase(RuneType), RuneNames, II)) then
      begin
        srl_GetBitmap(18 + II);
        Result := ItemAmount(Area, 'bmp', srl_Bitmaps[18+II], [20]);
        srl_FreeBitmapEx(18+II);
      end else
        srl_Warn('RuneAmount', 'Invalid RuneType: ''' + RuneType + '''', warn_AllVersions);
    end;
    ^Gave vital error

    And added a new version of bitmaps.scar(updated(even better as the previous thread))
    Last edited by masterBB; 06-13-2011 at 05:22 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •