Results 1 to 5 of 5

Thread: Minimap Help

  1. #1
    Join Date
    Apr 2015
    Location
    FireFox
    Posts
    528
    Mentioned
    10 Post(s)
    Quoted
    227 Post(s)

    Default Minimap Help

    Hey guys, below is a procedure I thought would hop worlds if it finds more then 2 other players in the radius of box. Obviously I was wrong...
    If I could be pointed in the right direction that would be of great assistance! (:

    Simba Code:
    1. procedure playerCheck();
    2. var
    3.   box: TBox;
    4.   TPA: TPointArray;
    5. begin
    6.   box.setBounds(660, 69, 727, 117);
    7.   TPA := minimap.getDots(MM_DOT_PLAYER, box);
    8.   if (length(TPA) > 2) then
    9.   begin
    10.     print('Hopping worlds because nearby player count was above 2', TDebug.SUB);
    11.     players[currentPlayer].exitToLobby();
    12.     if lobby.isOpen then
    13.     begin
    14.       freeTheDTMs();
    15.       initDTMs();
    16.       loggingIn();
    17.       findNormalRandoms();
    18.       setup();
    19.     end;
    20.   end;
    21. end;
    Scripting with ogLib

  2. #2
    Join Date
    Oct 2013
    Location
    East Coast USA
    Posts
    770
    Mentioned
    61 Post(s)
    Quoted
    364 Post(s)

    Default

    What does the box look like when you debug it? what is tpa length when you debug it?

  3. #3
    Join Date
    Apr 2015
    Location
    FireFox
    Posts
    528
    Mentioned
    10 Post(s)
    Quoted
    227 Post(s)

    Default

    Quote Originally Posted by bonsai View Post
    What does the box look like when you debug it? what is tpa length when you debug it?
    E: It seems as though it only works when a large group of people are present but not a few. This was the code I used
    Simba Code:
    TPA := minimap.getDots(MM_DOT_PLAYER, minimap.getBounds());
      debugTPA(tpa);
    When there are only a few it shoots out
    Code:
    Error: The Points you passed to DrawATPA exceed the bitmap's bounds at line 575
    Which is
    Simba Code:
    procedure TMufasaBitmap.drawText(txt: string; pnt: TPoint; font: string; shadow: boolean; color: TColor); overload;
    var
      tpa, tpaShadow: TPointArray;
    begin
      tpa := tpaFromText(txt, font);
      offsetTPA(tpa, pnt);

      if (shadow) then
      begin
        tpaShadow := copyTPA(tpa);
        offsetTPA(tpaShadow, point(1, 1));
        self.drawTPA(tpaShadow, __SHADOW_COLOR); //<- here
      end;

      self.drawTPA(tpa, color);
    end;
    e2: Is there anyway to have it work for like 1 or 2 dots?
    Scripting with ogLib

  4. #4
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by srlMW View Post
    E: It seems as though it only works when a large group of people are present but not a few. This was the code I used
    Simba Code:
    TPA := minimap.getDots(MM_DOT_PLAYER, minimap.getBounds());
      debugTPA(tpa);
    When there are only a few it shoots out
    Code:
    Error: The Points you passed to DrawATPA exceed the bitmap's bounds at line 575
    Which is
    Simba Code:
    procedure TMufasaBitmap.drawText(txt: string; pnt: TPoint; font: string; shadow: boolean; color: TColor); overload;
    var
      tpa, tpaShadow: TPointArray;
    begin
      tpa := tpaFromText(txt, font);
      offsetTPA(tpa, pnt);

      if (shadow) then
      begin
        tpaShadow := copyTPA(tpa);
        offsetTPA(tpaShadow, point(1, 1));
        self.drawTPA(tpaShadow, __SHADOW_COLOR); //<- here
      end;

      self.drawTPA(tpa, color);
    end;
    You should add some tolerance to the MM dots. Jagex nerfed up all the colours for the MM dots about a year back so nothing is static anymore. I found this in an old script of mine:

    Simba Code:
    function isPlayerPresent(waitTime: integer = 0): boolean;
    var
      t: TTimeMarker;
    begin
      t.start();

      repeat
        result := length(minimap.getDots(MM_DOT_PLAYER, intToBox(658, 70, 720, 140), 40)) > 0;
      until t.getTime() >= waitTime;
    end;

  5. #5
    Join Date
    Apr 2015
    Location
    FireFox
    Posts
    528
    Mentioned
    10 Post(s)
    Quoted
    227 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    You should add some tolerance to the MM dots. Jagex nerfed up all the colours for the MM dots about a year back so nothing is static anymore. I found this in an old script of mine:

    Simba Code:
    function isPlayerPresent(waitTime: integer = 0): boolean;
    var
      t: TTimeMarker;
    begin
      t.start();

      repeat
        result := length(minimap.getDots(MM_DOT_PLAYER, intToBox(658, 70, 720, 140), 40)) > 0;
      until t.getTime() >= waitTime;
    end;
    You are a life saver, appreciation to the highest! (:
    Scripting with ogLib

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
  •