SRL Archive - OSR Help

Questions about scripting


catlover444

2012-04-29 14:36:27

One step is to set your inventory constants and then I'm trying to write a procedure that logs you out if you have set more than 25 items(3 standard and 25 user defined).



procedure VerifyBankInv;
begin
var i: integer;
i:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food)
if (i >25) then
begin writeln('Verify your bank settings.');
logout;
end else
begin
exit;
end;
end;

where



const
OVL = 0; //# of OVL to withdraw
Pray_Restore = 0; //# of Pray Restore to withdraw
Pray_Pot = 0; //# of Pray Pot to withdraw
Pouch = 0; //# of Pouch to withdraw
Food = 0; //# of Fish to withdraw

is declared earlier.

The error I'm getting is:

[Error] (97:3): Identifier expected at line 96

What I think is wrong: I have a feeling my syntax to add constants is incorrect but not sure where to find information on basic operators/ operations.

What I've tried to do: I checked through a few scripts to view how constants are added and was unable to locate any good examples, I also searched the forums for :"operators" , "adding constants" and searched google for "operators in scar/ simba."


Thank you for any help.

masterBB

2012-04-29 14:37:59

procedure VerifyBankInv;
var
i: integer; //moved
begin
i:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food); //added ;
if (i >25) then
begin writeln('Verify your bank settings.');
logout;
end else
begin
exit;
end;
end;

Joe

2012-04-29 14:38:37

what is line 96, 97, 95
EDIT: ninjad

catlover444

2012-05-06 22:41:02

Moved this to first scripts.

Rich

2012-05-07 06:00:46

From: masterBB
procedure VerifyBankInv;
var
i: integer; //moved
begin
i:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food); //added ;
if (i >25) then
begin writeln('Verify your bank settings.');
logout;
end else
begin
exit;
end;
end;

procedure VerifyBankInv;
var
I : Integer;

begin
I:= (OVL + Pray_Restore + Pray_Pot + Pouch + Food);
if (I > 25) then
begin
WriteLn('Verify your bank settings.');
Logout;
end else
Exit;
end;
Standards :)