Results 1 to 7 of 7

Thread: GetMiniMapDotsIn

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default GetMiniMapDotsIn

    Simba 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 := 61937; //60909
        'cape', 'blue': Color := 12742980;
        'item', 'red': Color := 592381; //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 (Length(Result) < 1) then Exit;
      if (WhatDot = 'player') or (WhatDot = 'white') then
      begin
        InvertTPA(Result);
        SetLength(Result, Length(Result) - 1);
        InvertTPA(Result);
      end;
    end;

    Can we make it so it can output 0 as a result? (It currently doesn't right?)
    Simba Code:
    if (Length(Result) < 1) then Exit;
    Can we make it just accept 0 as an answer and output that? Yeah?

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Its an array..just check the length.

  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Wat?
    I want to use this function to see if it DOESN'T find one npc dot on the screen.
    Oh so I can do like

    If Length(GetMiniMapDotsIn('npc')) = 0 Then
    bla

    ?

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Wat?
    I want to use this function to see if it DOESN'T find one npc dot on the screen.
    Oh so I can do like

    If Length(GetMiniMapDotsIn('npc')) = 0 Then
    bla

    ?
    if (Length(GetMiniMapDotsIn('npc', box, box, box, box)) < 1) then
    begin
    end;

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Got it all sorted out, thanks MOMOMOMOMOMOMOMO, thanks mom.

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Help -> Scripting help
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    SRL Moderator & Developer -> Permanently BannedAwesome
    Last edited by Zyt3x; 11-16-2011 at 09:16 PM. Reason: n2 edit: fix'd zy3 edit: fix'd2

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
  •