SRL Archive - OSR Help

Where am I missing the end;?


bishknight

2012-07-01 12:07:00

I've been following YoHoJo's scripting tutorial and I've adapted it for my own needs, yet I get the error 'Identifier expected at line 29' so I must be missing an 'end;' somewhere, right? If I am, where do I put it? If I'm not, what's my problem? Thanks for helping :P

function MineClay:Boolean;
var seX, seY: integer;
Begin
if FindObjCustom(seX, seY: ['Mine', 'Clay', 'rocks'] [8767726, 5802910, 6132391], 30) then
WriteLn ('Found the clay!');
End;

Runaway

2012-07-01 12:16:02

This is the issue:


if FindObjCustom(seX, seY, ['Mine', 'Clay', 'rocks'], [8767726, 5802910, 6132391], 30) then
WriteLn ('Found the clay!');

Every parameter has to be separated by a comma.

bishknight

2012-07-01 12:17:01

Ah right, thanks a lot :D forgot about the parameters needing a comma, but I'm still getting the error. Sorry if it's a stupid question or anything, but I know very little about scripting or pascal in general.

putonajonny

2012-07-01 12:57:54

Once it is changed to this:
function MineClay:Boolean;
var
seX, seY: integer;
Begin
if FindObjCustom(seX, seY, ['Mine', 'Clay', 'rocks'], [8767726, 5802910, 6132391], 30) then
WriteLn ('Found the clay!');
End;
You don't get the "[Error] (62:26): comma (',') expected at line" error, so which line are you getting the "Identifier expected" error on?

bishknight

2012-07-01 14:36:07

From: putonajonny
Once it is changed to this:
function MineClay:Boolean;
var
seX, seY: integer;
Begin
if FindObjCustom(seX, seY, ['Mine', 'Clay', 'rocks'], [8767726, 5802910, 6132391], 30) then
WriteLn ('Found the clay!');
End;
You don't get the "[Error] (62:26): comma (',') expected at line" error, so which line are you getting the "Identifier expected" error on?



I get the identifier expected error on the line
function MineClay:Boolean;

putonajonny

2012-07-01 14:41:51

The error is with the previous function / procedure

shstiger2009

2012-07-01 14:42:24

From: bishknight
I get the identifier expected error on the line
function MineClay:Boolean;


I'm pretty sure that means it's something above that. The line right above that has an error…what is that line? Post it please. :)

bishknight

2012-07-01 14:47:34

From: shstiger2009
I'm pretty sure that means it's something above that. The line right above that has an error…what is that line? Post it please. :)


I've probably copied some of the standard stuff wrong, here's what I've got.

program ECBanker;
{$DEFINE SMART}
{$i SRL\SRL.simba}

Const
SERVER = 0;
MEMBERS = FALSE;
SRLStats_Username = '';
SRLStats_Password = '';
NumbOfPlayers= 1;
StartPlayer= 0;

Procedure DeclarePlayers;
var i: integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i]. BoxRewards := ['mote', 'ostume', 'XP', 'Gem'];

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end;

Runaway

2012-07-01 14:51:00

You need another end:


Procedure DeclarePlayers;
var i: integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i]. BoxRewards := ['mote', 'ostume', 'XP', 'Gem'];

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end; // <-
end;

bishknight

2012-07-01 14:52:14

From: Runaway
You need another end:


Procedure DeclarePlayers;
var i: integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i]. BoxRewards := ['mote', 'ostume', 'XP', 'Gem'];

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end; // <-
end;


Thats worked, thanks a lot :D

shstiger2009

2012-07-01 14:52:23

From: Runaway
You need another end:


Procedure DeclarePlayers;
var i: integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i]. BoxRewards := ['mote', 'ostume', 'XP', 'Gem'];

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end; // <-
end;


This. There's your missing end. :)