SRL Archive - SRL Suggestions

InvCoins


rogeruk

2009-10-23 12:17:56

function InvCoins: Integer;
begin
Result := ItemAmount('inv', 'bmp', LoadCoinBmp, [80]);
FreeBitmap(LoadCoinBmp);
end;

function InvCoins: Integer;
Var
ICoinBMP:Integer;
begin
ICoinBMP := LoadCoinBmp;
Result := ItemAmount('inv', 'bmp', ICoinBMP, [80]);
FreeBitmap(ICoinBMP);
end;

Pretty simple. I dont think CoinAmount is working atm.

Nava2

2009-10-23 12:40:23

That wouldn't free the bitmap?

rogeruk

2009-10-23 14:12:48

function InvCoins: Integer;
Var
ICoinBMP:Integer;
begin
ICoinBMP := LoadCoinBmp;
Result := ItemAmount('inv', 'bmp', ICoinBMP, [80]);
FreeBitmap(ICoinBMP);
end;

Nava2

2009-10-23 15:09:49

:D

That seems like a high tol though.

YoHoJo

2009-10-23 15:30:18

Make bitmap MASK, also make sure you have one for each stack of coins. :D

Narcle

2009-10-23 16:45:49

From: YoHoJo
Make bitmap MASK, also make sure you have one for each stack of coins. :D


Ya that's what I was thinking, there's a couple different stacks so you would need multiple bitmaps. (idk how many stacks there are)

Nava2

2009-10-23 18:32:36

From: Narcle
Ya that's what I was thinking, there's a couple different stacks so you would need multiple bitmaps. (idk how many stacks there are)


A lot.. a simple colour would be suffice I'd think.

YoHoJo

2009-10-23 18:36:07

Lel.
Not sure if color will work Nava, there HAVE to be other items same color as coins, we need DTM/Bitmap masks. And afaik countcoins or w/e is working for me, but hell ill go check again. :D

rogeruk

2009-10-23 19:23:44

From: YoHoJo
Make bitmap MASK, also make sure you have one for each stack of coins. :D


Why?

function InvCoins: Integer;
begin
Result := ItemAmount('inv', 'bmp', LoadCoinBmp, [50]);
FreeBitmap(LoadCoinBmp);
end;

Works for all stacks for me.

1 to 9266000 for me (max i got on this account)

With strength potions, gold and some other similar color items it still returns correct amount.

Narcle

2009-10-23 19:26:16

From: rogeruk
Why?

function InvCoins: Integer;
begin
Result := ItemAmount('inv', 'bmp', LoadCoinBmp, [50]);
FreeBitmap(LoadCoinBmp);
end;

Works for all stacks for me.

1 to 9266000 for me (max i got on this account)

With strength potions, gold and some other similar color items it still returns correct amount.


Yellow sliver of the bitmap? Can you post the bmp?

rogeruk

2009-10-23 19:28:15

From: Narcle
Yellow sliver of the bitmap? Can you post the bmp?


Its the standard SRL Bitmap. Found in Amount.scar

{*******************************************************************************
function LoadCoinBmp: Integer;
By: masquerader
Description: Returns a bitmap to use for coins.
*******************************************************************************}

function LoadCoinBmp: Integer;
begin
Result := BitmapFromString(2, 2, '0000019D7709000001F6BB0E');
end;

Wierd why FindCoins doesnt use it at all? And i cant find anything else that uses it?

function RuneAmount(area, runetype: String): Integer;


Uses the ItemAmount too.

Narcle

2009-10-23 20:21:49

AH, yeah I was looking to see if that was in the include… so its in amount bah.

Its a 2x2 bitmap only problem is with a High tolerance like that if any other item with yellow in it it might try counting that.

rogeruk

2009-10-24 07:37:44

From: Narcle
AH, yeah I was looking to see if that was in the include… so its in amount bah.

Its a 2x2 bitmap only problem is with a High tolerance like that if any other item with yellow in it it might try counting that.


Closest i got in bank was a strength potion and gold ore. With tol of 80 it picked it up, but with 50 it didnt.