Results 1 to 6 of 6

Thread: CountBitmap?

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

    Default CountBitmap?

    Okay, I'm not sure if this is in the right forum or not. If it isn't, please move it to the appropriate one.

    Anyway, recently Sabzi, pointed out to me that in the SRL Manual CountBitmap returns an Integer, which makes sense, right?

    Well in SCAR, it comes up and returns a Boolean. If you don't know what I mean, here:



    And in the SRL Manual:

    function CountBitmap(Bitmap: Integer; xs, ys, xe, ye: Integer): Integer;
    Counts the number of instances of the entered Bitmap found in the search area.
    Now, I don't think it's suppose to be like that, but if it is, then I would love an explanation.

    Also, if there is any credit given for this, it goes to Sabzi, not me, I just posted it, he found it.

    Thanks.

  2. #2
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

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

    Default

    Quote Originally Posted by Shuttleu View Post
    its obviously supposed to be like that... duh...

    @Freddy - what has happened here then huh?
    definition gone wrong?????
    fix it!

    ~shut
    Lol, I didn't think so, but you never know.

  4. #4
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't want any credit(I like it tho) I am just happy that this is pointed out. And tbh I am not brave enough to post something like this :P, so Coh3n is the hero here.

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can use
    SCAR Code:
    {*******************************************************************************
    function ItemAmount(Area, ItemType: string; Item: Integer; Tol: TIntegerArray): Integer;
    By: masquerader modified by ZephyrsFury
    Description: Counts the number of items found with a color in a certain area. (Counts stacks)
    Parameters:
      Area - 'inv', 'shop', 'bank', 'trade', 'your trade'.
      ItemType - 'dtm', 'bmp', 'color', 'bmpmask'.
      Item - name/value of your dtm/bmp/color/bmpmask.
      Tol - 'dtm' - [] (dtm's can't have tolerance).
            'bmp' - [BMPTol].
            'color' - [COLOUR Tol, Min Colour Count].
            'bmpmask' - [BMPTol, ContourTol].
    *******************************************************************************}
    SCAR Code:
    {*******************************************************************************
    function CountItemsIn(Area, ItemType: string; Item: Integer; Tol: TIntegerArray): Integer;
    By: masquerader modified by ZephyrsFury
    Description: Counts the number of items found within the Area. (Does not count stacks)
    Parameters:
      Area - 'inv', 'shop', 'bank', 'trade', 'your trade'.
      ItemType - SRL_DTM, SRL_Bitmap, SRL_BitmapMask, SRL_Color
      Item - name/value of your dtm/bmp/color/bmpmask.
      Tol - 'dtm' - [] (dtm's can't have tolerance).
            'bmp' - [BMPTol].
            'color' - [COLOUR Tol, Min Colour Count].
            'bmpmask' - [BMPTol, ContourTol].
    *******************************************************************************}

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

    Default

    Quote Originally Posted by Sabzi View Post
    I don't want any credit(I like it tho) I am just happy that this is pointed out. And tbh I am not brave enough to post something like this :P, so Coh3n is the hero here.
    Never be shy to point something like this out. AFAIK there is no one that's going to make fun of you if you say something wrong, and if they do, they'll get flamed by other members.

    @Da 0wner: I know you can use those, but I was just point this out, as Sabzi noticed it when he was working with bitmaps.

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
  •