Results 1 to 9 of 9

Thread: npc yellow dot tracking/finding

  1. #1
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default npc yellow dot tracking/finding

    Isnt there a getnpcdots function... I feel like i saw this a while back but im not sure... I have noticed that the yellow dot can change its colors from light yellow to almost an orangy color so I was just woundering if someone knows what I can do I just want to location the npc dots and click them. And i think there is also a count npc dots aswell.. I remember it being used to find the frog rando.... but for some reason I can't seem to find the include someone want to help me out here

  2. #2
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    GetMinimapDots():TPointArray;

  3. #3
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Indeed there is, look over this as an example:
    Simba Code:
    function CountNPCs_MM: Integer;
    var
      NPCs: TPointArray;
    begin
      NPCs := GetMiniMapDots('npc');
      Result := Length(NPCs);
    end;

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  4. #4
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Indeed there is, look over this as an example:
    Simba Code:
    function CountNPCs_MM: Integer;
    var
      NPCs: TPointArray;
    begin
      NPCs := GetMiniMapDots('npc');
      Result := Length(NPCs);
    end;
    Thanks flight much more helpful than shay
    So one more question now in this:
    Simba Code:
    function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
    var
      I, Dif, Radius, Hi, C: Integer;
      TPA: TPointArray;
    begin
      case LowerCase(WhatDot) of
        'npc', 'n', 'yellow', 'y': Dif := 4369;
        'item', 'i', 'red', 'r': Dif := 23;
        'player', 'p', 'white', 'w': Dif := 1907997;
        'friend', 'f', 'green', 'g': Dif := 5376;
        'team', 't', 'blue', 'b', 'cape': Dif := 2171941;
        {'clan', 'c', 'orange', 'o': Dif := -1;}
      else
        srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
      end;
      Freeze;
      Radius := Max((x2-x1)/2, (y2-y1)/2);
      FindColorsPie(TPA, 65536, 0, 0, 360, 0, radius, x1, y1, x2, y2, (x1+x2)/2, (y1+y2)/2);
      Hi := High(TPA);
      SetLength(Result, Hi + 1);
      if (Hi < 0) then
      begin
        UnFreeze;
        Exit;
      end;
      C := 0;
      for I := 0 to Hi do
      begin
        if (GetColor(TPA[I].X-1, TPA[I].Y-1) - GetColor(TPA[I].X, TPA[I].Y-1) = Dif) then
        begin
          Result[C] := Point(TPA[I].x, TPA[i].y - 2);//it results the point as a array
          Inc(C);
        end;
      end;
      Unfreeze;
      SetLength(Result, C);
    end;

    If I am going to click the (npc) dots could I do some kind of a mmouse to a random dot
    heres the idea:
    Simba Code:
    var //This is just the idea
      i : TPA;
    begin
      i := GetMiniMapDotsIn(minimap stuff);
      Mouse(i[random(length(i))], 2, 2, true);
    end;

  5. #5
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Simba Code:
    var
       i:integer;
       NPCTPA:TPointArray;
    begin
      NPCTPA := GetMiniMapDots('y')
      i := random(length(NPCTPA))
      Mouse(NPCTPA[i].x,NPCTPA[i].y,2, 2,1);
    end;

    This may be on or off, did it off the top of my head.

  6. #6
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Quote Originally Posted by getdropped69 View Post
    Thanks flight much more helpful than shay

    If I am going to click the (npc) dots could I do some kind of a mmouse to a random dot
    heres the idea:
    Simba Code:
    var //This is just the idea
      i : TPA;
    begin
      i := GetMiniMapDotsIn(minimap stuff);
      Mouse(i[random(length(i))], 2, 2, true);
    end;
    Very close. Let's say, for example, you wanted to walk to the closest NPC to your current location. Here's what you could do:
    Simba Code:
    procedure WalkToClosestNPC_MM;
    var
      i: TPointArray;
    begin
      i := GetMiniMapDots('npc');  //Populate the 'i' point array with all the NPC dots
      SortTPAFrom(i, Point(MMCX, MMCY));  //Now sort the 'i' array starting from the center of the MM
      Mouse(i[0].X, i[0].Y, 2, 2, mouse_left);
    end;

    Because arrays always being at 0, then in this case the i[0] would be the closest NPC to our player (MMCX,MMCY). So to grab the X/Y coordinate of the closest NPC we'd first separate that NPC point then we can grab the X/Y coordinates of it, like so:
    Simba Code:
    Mouse(i[0].X, i[0].Y, 2, 2, mouse_left);

    i[0] simply means i's first point in the array, i[1] would be the second point, and so on... So if i[0] is a point you could do i[0].X to get the X value of that point, same with the Y value.

    Does that make sense?

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  7. #7
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Very close. Let's say, for example, you wanted to walk to the closest NPC to your current location. Here's what you could do:
    Simba Code:
    procedure WalkToClosestNPC_MM;
    var
      i: TPointArray;
    begin
      i := GetMiniMapDots('npc');  //Populate the 'i' point array with all the NPC dots
      SortTPAFrom(i, Point(MMCX, MMCY));  //Now sort the 'i' array starting from the center of the MM
      Mouse(i[0].X, i[0].Y, 2, 2, mouse_left);
    end;

    Because arrays always being at 0, then in this case the i[0] would be the closest NPC to our player (MMCX,MMCY). So to grab the X/Y coordinate of the closest NPC we'd first separate that NPC point then we can grab the X/Y coordinates of it, like so:
    Simba Code:
    Mouse(i[0].X, i[0].Y, 2, 2, mouse_left);

    i[0] simply means i's first point in the array, i[1] would be the second point, and so on... So if i[0] is a point you could do i[0].X to get the X value of that point, same with the Y value.

    Does that make sense?
    I really like the sorting idea would work much better oh and It was working great for a few seconds but then when it tried again I got:
    Simba Code:
    Error: Out Of Range at line 190
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]

    as an error I think it was because I moved on top of the npc dot.... Here is what is needed to be changed because the random(1) will return 0, 1 if I am correct. This works: just need to add the sort
    Simba Code:
    procedure FindMonster;
    var
      i:integer;
      NPCTPA:TPointArray;
    begin
      NPCTPA := GetMiniMapDots('npc');
      if not(length(NPCTPA) = 0) then
      begin
        i := random(length(NPCTPA));
        if (NPCTPA[i].x >= 0) then
          Mouse(NPCTPA[i].x, NPCTPA[i].y, 2, 2, true);
      end
      else
        writeln('No NPC dot found.');
    end;

    Edit: This is what I am using now thanks guys

    Simba Code:
    procedure FindMonster;
    var
      NPCTPA:TPointArray;
    begin
      NPCTPA := GetMiniMapDots('npc');
      if not(length(NPCTPA) = 0) then
      begin
        SortTPAFrom(NPCTPA, Point(MMCX, (MMCY - 20)));//wanted off center ;)
        Mouse(NPCTPA[0].x, NPCTPA[0].y, 2, 2, true);
      end
      else
        writeln('No NPC dot found.');
    end;

  8. #8
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Simba Code:
    if (length(NPCTPA) > 0) then
    That means there is actually some stuff in it, some functions return -1 or null if they find nothing.

    Also what I like to do is not only have a positive offset but also a negative one.
    Simba Code:
    Mouse(NPCTPA[0].x, NPCTPA[0].y, RandomRange(-2, 2), RandomRange(-2, 2), true);

    Anyways goodluck with the dungeoneering script

    Script source code available here: Github

  9. #9
    Join Date
    Nov 2011
    Location
    United states
    Posts
    516
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by J J View Post
    Simba Code:
    if (length(NPCTPA) > 0) then
    That means there is actually some stuff in it, some functions return -1 or null if they find nothing.

    Also what I like to do is not only have a positive offset but also a negative one.
    Simba Code:
    Mouse(NPCTPA[0].x, NPCTPA[0].y, RandomRange(-2, 2), RandomRange(-2, 2), true);

    Anyways goodluck with the dungeoneering script
    Thanks for the help

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
  •