SRL Archive - OSR Help

Counting inv Items with bank open [Help]


NoUserName

2012-04-30 06:21:40

ok so i need to count my items in my invent easy well so i thought

im using the following but cant seam to make it work..

program count;
var
objDTM : Integer;

Procedure LoadDMTZ;
begin
objDTM := DTMFromString('blabla');
end;

procedure CheckInv(Check: String);
var
y :Integer;
begin

y := CountItems('dtm', objDTM, [0]); // dtm stored in the main var

case Lowercase(Check) of
'objcount':
if (y<20) then
begin
Writeln('!FailSafe! - obj Inbalance');
Writeln('obj found :' + IntToStr(y) ); // alwase returns 0 even when there is 20 in my invent
DepositAll;
end;
else
Writeln('selection error!');
end;
end;

begin
setup;
LoadDMTZ;
CheckInv('objcount')
otherstuff;
end.

i want it to get the object from the bank count how many it has in invent of the object then if there is not any banking has faild so do it again if there is carry but it just will not count keeps returning 0 but cant see why oh and the banking screen is open but i cant see this effecting it…

thanks for help in advanced

nickrules

2012-04-30 06:27:16

If y = 0 then, your issue resides here:
y := CountItems('dtm', objDTM, [0]); // dtm stored in the main var

Try a new DTM?

NoUserName

2012-04-30 07:40:19

Well thats what i thought but it finds the dtm befor it counts it n gets items from the bank with it am in saying u can use the same dtm as many times as needed?

Thanks for reply

Abu

2012-05-01 00:51:14

Try CountItemsIn:
y := CountItemsIn('inv', 'dtm', objDTM, [0]);

NoUserName

2012-05-01 15:10:53

i have actually got this to work now the problem was nothing but a wait script the script.

it would get it from the bank then have a look but what it should have done is get it from the bank then waited a few seconds before having a look in the inv

so this problem is solved for now!

thanks for your help =]