SRL Archive - Help and Support

counting stacks


king vash

2008-08-07 02:22:16

I have ItemAmount working for stacks in my inventory but not in my bank.

  a := DTMFromString('78DA63EC616060F06740015121210C5C409A1188FF0301E3649020031A6084AB01F36603092F026A5A80442401350D40C21DBF1A00CD7D0990');
b := DTMFromString('78DA630C61626068656440064F1F3E64E002D220D1FF40C0E80654D380AA0624CB045503E67902793D04D4C40079FD04D4240279F5F8D50000B6250B12');
repeat
repeat
wait(100);
until(IsFKeyDown(1));
writeln(IntToStr(ItemAmount('bank', 'dtm', a, [20])) + ' ess in bank: airs in bank ' + IntToStr(ItemAmount('bank', 'dtm', b, [40])));
writeln(IntToStr(ItemAmount('inv', 'dtm', a, [20])) + ' ess in inv: airs in inv ' + IntToStr(ItemAmount('inv', 'dtm', b, [40])));
until false
this correctly returns number of airs (stacked) in my inventory and the number of ess (not stacked) in inventory but it returns 0 or 1 from anything in my bank. does any one know why or what to you instead?

Nava2

2008-08-07 11:59:49

Ugh, there was a function, but now all the new ones seem too complicated to be useful haha.

I will take a look into the old revs for you.

{*******************************************************************************
function RuneAmount(area, runetype: String): Integer;
By: masquerader and modified by Ron
Description: Returns the ammount of a certain rune in the specified area.
*******************************************************************************}
^Try that function, its in rev 20 :)

Nava2

king vash

2008-08-07 16:53:47

RuneAmount counts Airs but not Ess. if you go into Amounts.scar you see that it uses bmp (ugh) and ItemAmount. It fairs the same, if not worse because it takes 2-3 times as long.

Waddo

2008-08-07 18:48:01

yes use countitems(dtmname,'dtm',[0],[0]);
or if your using a bmp countitems(bmpname.'bmp',[a],);
where a and b are tolerance for colour and outline but im not sure which is which

king vash

2008-08-07 22:18:12

as far as I can tell countitems is for inventory only (I want to search the bank) and counts the number of objects (not stacked items)

Scaper

2008-08-11 19:55:59

here i dont know if this is any good for ya but seems canny good???

http://www.villavu.com/forum/showthread.php?t=23305