Results 1 to 11 of 11

Thread: Bmp Counter!

  1. #1
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bmp Counter!

    my second function:
    SCAR Code:
    function HowManyBmps(bmpname,MaxTol,x1,y1,x2,y2 : Integer) : Integer;
    var
      x,y,BmpColor :Integer;
      BMPs : TPointArray;
    begin
      BmpColor := AutoColorThis(bmpname,MaxTol,x1,y1,x2,y2);
      FindColorsSpiralTolerance(x,y,BMPs,BmpColor,x1,y1,x2,y2,0);
      Result := GetArrayLength(BMPs);
    end;

    The result will be the number of bmps found.


  2. #2
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    why/how would you use this???
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

  3. #3
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tootoot222 View Post
    why/how would you use this???
    e.g:
    you want to count how many logs did you chopped. Make a bmp and use my function


  4. #4
    Join Date
    Jun 2007
    Location
    #SRL
    Posts
    200
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    ah, i see, it returns how many BMPs there are on screen, ok

    you didn't say anything about what it did on the first post though
    Quote Originally Posted by IRC
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 43
    <Wizzup> shit
    <Wizzup> 5
    <Wizzup> 4
    <Wizzup> 3
    <Wizzup> 1
    <Wizzup> offblast

  5. #5
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tootoot222 View Post
    ah, i see, it returns how many BMPs there are on screen, ok

    you didn't say anything about what it did on the first post though
    K i forgot.


  6. #6
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This wouldn't work, you will find total amount of matching pixels. not amount of items.
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  7. #7
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Negaal View Post
    This wouldn't work, you will find total amount of matching pixels. not amount of items.
    hmm... how can i do that then?


  8. #8
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    As far as I know without knowing where to look impossible. Maybe look at some of the amount functions in srl

  9. #9
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Mylesmadness View Post
    As far as I know without knowing where to look impossible. Maybe look at some of the amount functions in srl
    I looked at amount.scar:
    SCAR Code:
    {*******************************************************************************
    function CountItemsDtm(area: String; dtm: Integer): Integer;
    By: masquerader
    Description: Counts items in a specified area found with a dtm. (Doesn't count stacks)
    *******************************************************************************}


    function CountItemsDtm(area: string; dtm: Integer): Integer;
    var
      coords: TPointArray;
    begin
      coords := ItemCoordsDtm(area, dtm);
      Result := GetArrayLength(coords);
    end;


  10. #10
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cazax View Post
    hmm... how can i do that then?
    SCAR Code:
    function CountInvColor(Color, tolerance : integer) : integer;
    var
      i, x, y : integer;
      B : TBox;
    begin
      for i := 1 to 28 do
      begin
        B := InvBox(I);
        if FindColorTolerance(x, y, color, B.X1, B.Y1, B.X2, B.Y2, tolerance) then
          Result := Result + 1;
      end;
    end;
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  11. #11
    Join Date
    Mar 2007
    Posts
    3,116
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I was thinking itemcoordsbmp:
    SCAR Code:
    function ItemCoordsBmp(area: string; bmp, tol: Integer): TPointArray;
    var
      startx, starty, rowsize, colsize, colnumber, rownumber, col, row: Integer;
      x1, y1, x2, y2: Integer;
      itemx, itemy: Integer;
      i: Integer;
    begin
      SetArrayLength(Result, 0);
      if (CheckArea(area)) then
      begin
        AreaInfo(area, startx, starty, rowsize, colsize, colnumber, rownumber);
        for row := 0 to rownumber - 1 do
          for col := 0 to colnumber - 1 do
          begin
            x1 := startx + col * colsize;
            y1 := starty + row * rowsize;
            x2 := x1 + colsize;
            y2 := y1 + rowsize;
            if (FindBitmapToleranceIn(bmp, itemx, itemy, x1, y1, x2, y2, tol)) then
            begin
              i := GetArrayLength(Result);
              SetArrayLength(Result, i + 1);
              Result[i].x := x1;
              Result[i].y := y1;
         //     writeln(inttostr(x1)+','+inttostr(y1));
            end;
          end;
      end;
    end;
    Anyway basicly what that does is makes a box around each inv slot so searchs for it in that box and repeats until all the slots are searched

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Crystal bow counter?
    By lemonfuzz in forum OSR Help
    Replies: 3
    Last Post: 02-27-2009, 12:59 AM
  2. Crystal bow counter?
    By lemonfuzz in forum OSR Help
    Replies: 2
    Last Post: 02-26-2009, 10:21 PM
  3. counter strike 1.6
    By josh81193 in forum Gaming
    Replies: 21
    Last Post: 01-24-2008, 05:20 PM
  4. Death Counter
    By yanix in forum RS3 Outdated / Broken Scripts
    Replies: 0
    Last Post: 01-16-2008, 10:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •