SRL Archive - RS3 Outdated / Broken Scripts

Identifier expected error again...


Bad Boy JH

2010-08-13 23:18:28

Its been a while, and I am slightly rusty, and I am creating a computer version of a game called "Rum Rebellion". However I am running into some trouble just shuffling the cards…I am getting the most annoying error there is…."Identifier expected at line 6". I am using Simba, but I don't know how to fix this error…I have the right amount of begins and ends.
program new;

Const
//Amounts of each card type
//Vote of Support
10vot = 12;
5vot = 24;
3vot = 36;
//Win or lose
WinWOL = 6;
LoseWOL = 6;
//The Court Verdicts
FreeVerd = 4;
FineVerd = 4;
GaolVerd = 4

Vot = 1;

type
Deck = record
CardID: TIntegerArray;
end;

var
Decks: Array[1..4] of Deck;
J : Integer;

Procedure FirstShuffle;
var
I, Number: Integer;
ArrNumbers: TIntegerArray;
begin
SetLength(Deck[Vot].CardID, 72)
SetLength(ArrNumbers, 72);
I := 0
repeat
Number := RandomNumber(1, 72);
if not InIntArray(ArrNumbers, Number) then
begin
ArrNumbers[I] := Number;
Inc(I)
end;
until not InIntArray(ArrNumbers, 0);

For I := 0 to 71 do
begin
case ArrNumbers[I] of
1..12 : Deck[Vot].CardID[I] := 1;
13..36 : Deck[Vot].CardID[I] := 2;
37..72 : Deck[Vot].CardID[I] := 3;
end;
end;
end;


{Procedure Shuffle(Which: Integer);
begin
end
}


begin
FirstShuffle;
For J := 0 to 71 do
begin
case Decks[Vot].CardID[J] of
1 : Writeln('10 Votes');
2 : Writeln('5 Votes');
3 : Writeln('3 Votes');
else
Writeln('Error, Returned ' + IntToStr(Decks[Vot].CardID[J]));
end;
end;
end.

Coh3n

2010-08-14 00:02:55

First off, wrong section. ;) Should be in Scripting Help.

Also, you can't have constants start with numbers. Call it vot10, etc and it will work. You'll also notice you have other compiling issues. ;)

Bad Boy JH

2010-08-14 02:39:29

obviouisly, I am too tired to be scripting ATM, so my appologies…yes, I have noticed them, I started checking a couple of things and found them…thanks for the help…