SRL Archive - SRL Bugs

CountBitmap?


Coh3n

2009-06-28 22:41:10

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.

Shuttleu

2009-06-28 22:46:08

its obviously supposed to be like that… duh…

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

~shut

Coh3n

2009-06-28 22:47:10

From: Shuttleu
its obviously supposed to be like that… duh…

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

~shut


Lol, :p I didn't think so, but you never know. :p

Sabzi

2009-06-28 23:04:24

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.

Da 0wner

2009-06-28 23:10:13

You can use
{*******************************************************************************
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].
*******************************************************************************}
{*******************************************************************************
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].
*******************************************************************************}

Coh3n

2009-06-29 03:04:50

From: Sabzi
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. :p

@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.