PDA

View Full Version : CountItemDTM(DTM:Integer):Integer



rotflmfwao
08-23-2007, 03:34 AM
Yeah, I looked for this in srl and all I found was one for bitmaps so I switched some stuff around a bit and got this:function CountItemDTM(DTM: Integer): Integer;//Based off of the
var //one in srl for bmps
i, x, y: Integer;
TB: Tbox;
begin
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
if FindDTM(DTM, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then// Thanks 4 the input
Inc(Result);
end;
end;

mat_de_b
08-23-2007, 07:48 AM
This used to be in xInventory.scar but that isnt in SRL4, this is a very handy procedure

XcanadamanX
08-23-2007, 01:22 PM
lmfao i made the EXACT same thing yesterday. it was for private use but...wow...lol

JuKKa
08-23-2007, 01:24 PM
I made a little different one, it uses TPoints and Color instead of DTM, A bit faster i guess.

Markus
08-23-2007, 01:45 PM
Looks nice, but why the DTMRotated?
As items never rotate, FindDTM would be sufficient and way faster.

itSchRis917
08-23-2007, 02:28 PM
Yea, i made one for my fisher also.. Just like mine, i just switched a few things and.. presto. worked.

R0b0t1
08-23-2007, 07:13 PM
Lol. I made the exact same thing and posted it somewhere, but I think in the members.


Are you ROFLMAOing me?

Lalaji
08-23-2007, 07:42 PM
Nice, I alwaus used the find bmp one...

Kik
08-23-2007, 09:28 PM
whoa. I also made the same exact thing a few days ago for private/member app use. This is getting a little bit creepy...

btw, this is a very good function for counting a certain number of items in your inventory. Very useful.

Santa_Clause
08-24-2007, 09:51 AM
I thought there was one already in SRL...?

mat_de_b
08-24-2007, 06:39 PM
Its in xinventory

rotflmfwao
08-24-2007, 08:17 PM
But not anymore XD I'll use FindDTM instead of rotated... It works faster, you're right!

rogeruk
08-28-2007, 04:23 PM
I'm getting bad errors while trying to use it..

[Runtime Error] : Exception: Access violation at address 006FFBEA in module 'scar.exe'.

aoaklogs:=CountItemDTM(oaklogdtm);