Results 1 to 4 of 4

Thread: New procedure getMMSize;

  1. #1
    Join Date
    Aug 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default New procedure getMMSize;

    Can someone please test this for me? It's a quick proc to scan for Minimap Dimensions, I've made it prefer the left-side of the border to avoid confusion when used in a script. The top, bottom, and right border co-ords are the inner-most pixel of the border.
    I was having issues using normal math to find the left border (it would probs work for everyone else) so I left it working for my weird setup.. I want to see how universal this proc is, so please test.
    Set-up: OSR preset, interfaces non-transparent, slim headers, MM snapped to the top-right corner, log in, target the SMART window and press play.
    Code:
    program new;
    {$DEFINE SMART}
    {$i srl-6/srl.simba}
    
    procedure getMMSize;
    var MM_Border_Right, MM_Border_Left, MM_Border_Top, MM_Border_Bottom, ySearch, counter, x, y, w, e : Integer; didFind : Boolean;
    begin
      if findcolor(x,y,4405803,IntToBox(955, 39, 957, 41)) then
      begin
        MM_Border_Right:= x;
        writeln('Detected MM right border at '+inttostr(MM_Border_Right)+'');
        if findcolor(x,y,3879459,IntToBox(954, 14, 955, 16)) then
        begin
          MM_Border_Top:= y;
          writeln('Detected MM top border at '+inttostr(MM_Border_Top)+'');
        end;
        counter:= 15;
        if (MM_Border_Top > 0) then
        begin
          counter:= MM_Border_Top + 1;
        end else
          writeln('Couldn''t find MM top border');
        repeat
          counter:= counter + 1;
          if findcolor(x,y,5458491,IntToBox(954, MM_Border_Top+1, 955, counter)) then
          begin
            MM_Border_Bottom:= y;
            writeln('Detected MM bottom border at '+inttostr(MM_Border_Bottom)+'');
            counter:= 545;
          end;
        until(counter >= 545);
        if (MM_Border_Bottom > 0) then
        begin
          ySearch:= round((MM_Border_Bottom - MM_Border_Top) / 2);
        end else
          writeln('Couldn''t find MM bottom border');
        counter:= MM_Border_Right;
        didFind:= false;
        repeat
          //if (counter > 10)then
            counter:= counter - 10;
          if findcolor(x,y,4405803,IntToBox(counter, ySearch-2, MM_Border_Right-1, ySearch+2)) then
          begin
          if findcolor(w,e,4405803,IntToBox(counter-5, ySearch-2, MM_Border_Right-1, ySearch+2)) then
            begin
              MM_Border_Left:= w;
              didFind:= true;
            end else
              begin
                MM_Border_Left:= x;
                didFind:= true;
              end;
          end;
        until(counter <= 1 or didFind);
        if didFind then
        begin
          writeln('Detected MM left border at '+inttostr(MM_Border_Left)+'');
        end else
          writeln('Couldn''t find MM left border');
      end else
        writeln('Couldn''t find MM right border');
    end;
    
    begin
      clearDebug();
      setupSRL();
      getMMSize;
    end.
    Last edited by KM_01; 11-23-2013 at 05:22 AM.

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

    Default

    Results from a basic login using std (to date) srl6....

    Code:
    ---- initSmart()
    ---- Waiting up to 5 minutes for RS to load...
    ------ minimap.__createMask(): Creating the bitmap mask
    ---- Succesfully found and set the minimap bounds @ {X1 = 735, Y1 = 13, X2 = 959, Y2 = 224}
    ---- TRSActionBar.__find()
    ------ ERROR: Failed to find action bar minimize button
    ---- TRSActionBar.__find(): False
    ---- TRSChatbox.__find()
    ------ Looking for chat text border...
    -------- TRSChatbox._findTextBorder(): No chat tab is open
    ------ Looking for the emote tab...
    -------- TRSChatbox._findEmoteBorder(): Didn't find text background color
    ------ Looking for the quick chat interface...
    -------- Didn't find quick chat border
    ---- TRSChatbox.__find(): False
    ------ TRSMainscreen.__find(): Set mainscreen bounds based on the other visible interfaces
    ---- Client is ready.
    ---- Setup SRL in 188ms.
    -- setupSRL(): True
    Detected MM right border at 956
    Couldn't find MM top border
    Detected MM bottom border at 12
    Couldn't find MM left border
    -- Freeing gametabs bitmaps...
    -- Succesfully freed SMART[3364]
    -- Freeing the minimap mask
    Successfully executed.

  3. #3
    Join Date
    Jun 2008
    Location
    United States
    Posts
    818
    Mentioned
    60 Post(s)
    Quoted
    90 Post(s)

    Default

    As far as I know, SRL-6 has dynamic minimap finding, and I think I wrote it? Is it not working?
    [10/14/13:19:03] <BenLand100> this is special relatively, just cleverly disguised with yachts

  4. #4
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by euphemism View Post
    As far as I know, SRL-6 has dynamic minimap finding, and I think I wrote it? Is it not working?
    It worked fine, but unfortunately has been removed now that we've moved to fixed screen.

    @OP, I'm going to move this to snippets.

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
  •