SRL Archive - Research & Development Lounge

Inventory Counter


live4evil

2010-08-17 14:36:15

Need help trying to count raw beef in the inventory
code i got so far
I can't get it to count the next raw beef or any idea how to make it so it doesn't keep counting the first raw beef multiple times

Function RawBeefCount: Integer;
var
RawBeef, c, x, y, r, d : Integer;
Begin
x:=MIX1;
y:=MIY1;
c:=0;
RawBeef := BitmapFromString(7, 7, 'beNpbtLBDVgSCVi5aCEdwQWR' +
'xZEH8CKviLWvXrFq8GM2oQ7t27du2FSi1ZukSqCwA/oA7DQ==');
GameTab(tab_Inv);
for r:=0 to 4 do
if FindBitmapIn(RawBeef, x, y, x-50, MIY1, MIX2, MIY2) then/
begin
Writeln('Found Raw beef!');
MMouse(x, y, 4, 4);
if IsUpText('aw beef') then/
begin
Wait(500 + Random(100));
c:=c+1;
end;
end;
Result := c;
FreeBitmap(RawBeef);
End;
I know im horrible at coding

Frement

2010-08-17 14:38:48

There is InvBox and CoordsToInvBox functions I think, check SRL's Inventory.scar

live4evil

2010-08-17 15:35:45

God dangit! why does SRL do everything but not tell me what it does!

Sabzi

2010-08-17 15:59:57

From: live4evil
God dangit! why does SRL do everything but not tell me what it does!


It does tell you. You just have to read it from the include :).