Results 1 to 4 of 4

Thread: GetMiniMapDotsIn

  1. #1
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default GetMiniMapDotsIn

    GetMiniMapDotsIn would return an excess violation if no dots were found. Because it would be setting a length of '-1'.

    Added a try and except block:

    SCAR Code:
    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, 0);
      RAaSTPA(Result, 4);
      if (WhatDot = 'player') or (WhatDot = 'white') then
      try
        InvertTPA(Result);
        SetLength(Result, Length(Result) - 1);
        InvertTPA(Result);
      except srl_Warn('GetMiniMapDotsIn', 'No Dots of '+WhatDot+' Found', warn_AllVersion);  
      end;
    end;
    Last edited by Naum; 08-12-2009 at 08:44 PM.

  2. #2
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    Look's pretty good wouldn't it work if it just sets the length to 0 instead of -1
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  3. #3
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    if (Length(Result) < 1) then Exit; Added to SRL. Thanks.

  4. #4
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by ZephyrsFury View Post
    if (Length(Result) < 1) then Exit; Added to SRL. Thanks.
    Thanks <3

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
  •