SRL Archive - OSR Help

Identifier Expected?


SweDam

2012-03-05 16:19:44

I'm having an problem using SetupRandomTool, it says

[Error] C:\Simba\Includes\SRL/SRL/core/antirandoms/randomtool.simba(261:31): Identifier expected at line 260

Procedure SetupRandomTool(TimeOutWait, FKeyForFinish: Integer; t_SoundPath: String);
var
I, H, ArrC: Integer;
begin
r_WaitTimeout := TimeOutWait, 60000;
If Not InRange(FKeyForFinish, 1, 12) then
begin
srl_Warn('SetupRandomTool', 'Incorrect parameter FKeyForFinish [1..12] only.', warn_AllVersions);
srl_Warn('SetupRandomTool', 'FKeyForFinish is now set to 2.', warn_AllVersions);
r_FKeyFinish := 2;
end else r_FKeyFinish := FKeyForFinish 2;
r_UseRandomTool := True;
SoundPath := AppPath + 'AlertSounds\SmallBeat.wav');

H := High(TeleRandoms);
SetArrayLength(r_SolveAble, H+1);
For I:=0 to H do
If (TeleRandoms[i].SolveRandom <> nil) then
begin
Inc(ArrC);
r_SolveAble[ArrC-1] := I;
end;
SetArrayLength(r_SolveAble, ArrC);
end;

Sex

2012-03-05 16:23:42

SoundPath := AppPath + 'AlertSounds\SmallBeat.wav');
Extra parenthesis there.
Try:
SoundPath := AppPath + 'AlertSounds\SmallBeat.wav';

SweDam

2012-03-05 16:43:44

But its on this line "r_WaitTimeout := TimeOutWait, 60000;"

Sex

2012-03-05 16:47:34

Ah, well I don't know exactly what you want to do there…

SweDam

2012-03-05 16:52:21

I want to use randomtool so the script doesn't stop all the time!

Sex

2012-03-05 16:57:50

You don't need to do any editing in that file. Delete the file and update SRL again to revert it to the original version. Then, place this after SetupSRL; in your script:
SetupRandomTool(60000, 2, AppPath + 'AlertSounds\SmallBeat.wav');

SweDam

2012-03-05 17:13:15

Big thanks to you man! As it said it had to be placed after "DeclarePlayers;" in the original thread i wouldnt think about that… ;)