SRL Archive - Help

Unknown identifier 'NumberOfPlayers' at line 26


ForgotMyName

2010-10-03 23:52:54

I get this while compiling my script

Unknown identifier 'NumberOfPlayers' at line 26


At the top I did

{$i SRL\SRL.scar}


so I really don't understand why it can't find it.

Wanted

2010-10-03 23:55:51

It would help if you let us know more, like if you're using SCAR/simba etc. the script too.

If you're using SCAR change {$ to {.include

ForgotMyName

2010-10-03 23:57:45

Thanks for the quick reply.

Um… I'm using SIMBA. Starting a new script.

This is what I have so far, if it helps:

{*************
INTERNAL VERSION
CONTAINS ACCOUNT INFO
DO NOT LEAK
**************)

program GraniteMiner;
{$i SRL\SRL.scar}

const
NumbOfPlayers = 1;
StartPlayer = 0;
RockColor = 6458286;
RockTol = 2;
RockRadius = 5;
MouseTol = 2;

{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: SRL's Player Setup
*******************************************************************************}
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players.BoxRewards := ['ithril', 'oal', 'une', 'oins'];
with Players[0] do
begin
Name := '************'; //Player username.
Pass := '************'; //Player password.
Nick := '****'; //Player nickname - 3-4 letters of Player username.
Active := True;
end;
end;

{*******************************************************************************
procedure SetUpScript
By: ForgotMyName
Description: Initialize SRL, script data, etc
*******************************************************************************}
procedure SetUpScript;
begin

end;

{*******************************************************************************
function FindRock: Boolean
By: ForgotMyName
Description: Find a granite rock and mouse over it
Returns: True if rock found and mouse at rock, false if failed
*******************************************************************************}
function FindRock: Boolean;
var RockPoints: TPointArray;
RockSplits: T2DPointArray;
I, H, X1, Y1: Integer;
begin
SetColorToleranceSpeed(1);
if not (FindColorsSpiralTolerance(MSCX, MSCY, RockPts, RockColor, MSX1, MSY1, MSX2, MSY2, 3)) then
begin
WriteLn('Could not find rock color on mainscreen!');
Result := False;
Exit;
end;
RockSplits := TPAtoATPA(RockPoints, RockRadius);
H := High(RockSplits);
for I := 0 to H do
begin
MiddleTPAEx(RockSplits, X1, Y1);
MMouse(X1, Y1, MouseTol, MouseTol);
Wait(50 + Random(100));
if IsUpText('ine') then
begin
Result := True;
Exit;
end;
end;
Result := False;
end;

{*******************************************************************************
procedure MainLoop;
By: ForgotMyName
Description: Main script loop
*******************************************************************************}
procedure MainLoop;
begin

end;

begin
SetUpSRL;
DeclarePlayers;
SetUpScript;
MainLoop;
end.

Wanted

2010-10-04 00:02:26

Not sure how you did this lol, but your include is becoming part of your script header.

{*************
INTERNAL VERSION
CONTAINS ACCOUNT INFO
DO NOT LEAK
**************)

program GraniteMiner;
{$i SRL\SRL.scar}

won't work vs.

program GraniteMiner;

{$i SRL\SRL.scar}

ForgotMyName

2010-10-04 00:04:06

Wow, thank you! That was a very strange error. I'll remember to put my comments elsewhere.

EDIT: Oops. That was a round brace instead of a curly one. I feel stupid now.

Bad Boy JH

2010-10-04 04:17:38

I see why, you closed with a ) rather than a }

{*************
INTERNAL VERSION
CONTAINS ACCOUNT INFO
DO NOT LEAK
**************)

program GraniteMiner;
{$i SRL\SRL.scar}

See the Closing parenthisis it needs to be a }

i luffs yeww

2010-10-04 04:28:13

Four hourse and 15 minutes too late, Bad Boy. :)

Daniel

2010-10-04 05:30:16

(*
*)

Are valid multi-line comments in PASCAL…

EDIT: Never-mind, saw he use { first..