SRL Archive - OSR Help

Unknown Identifier error at failsafe procedure


Synikk

2011-12-19 01:11:46

hey guys this is the error that has been output
[Error] (59:3): Unknown identifier 'Player' at line 58
Compiling failed.

And here is the script
program ArdongueIronPowerMiner;

//{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\Debug.SCAR}
{$i SRL\SRL\Misc\Stats.simba}


Const
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120; // How many minutes you want to break after
BreakFor = 5; // How long to break for
Version= '1.00'; // Dont need to change
NumbOfPlayers= 1; // How many players you are botting
StartPlayer= 0; //Player to start autoing with (0 means 1st player)



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

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 4; //Seconds to try mining rock before clicking another.
end;

end;


Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;


Procedure Antiban;
Begin
Case Random (140) of
0: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); End;
1: Begin StatsGuise('Antiban') GameTab(Tab_Stats) HoverSkill('Mining', False) GameTab(28); End;
End;
End;


Procedure FailSafe(Reason:String);
Begin
Player(CurrentPlayer).Loc=Reason;
Logout;
Stats_Commit;
//ProgressReport;
Terminate Script;
End;



Function MineIronOre:Boolean
Var
X, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x, y, ['ine', 'ocks', ['e R'] [2569562, 3029076, 2766945, 15) Then
WriteLn ('Found ore')
End;



Begin
SetupSRL;
DeclarePlayers;
Repeat
MineIronOre;
Until(false);
End


Help is appreciated

RISK

2011-12-19 01:14:33

Try this:
Players[CurrentPlayer].Loc := Reason:

Synikk

2011-12-19 01:19:35

i still get compiling failed and this error [Error] (59:39): Identifier expected at line 58
Compiling failed.

RISK

2011-12-19 01:20:53

What line is it exactly?

Synikk

2011-12-19 01:21:27

Player(CurrentPlayer).Loc=Reason; is the line which the error is referring to
its also highlighting the word 'reason' in that line, i cant see anything that would conflict with the code though /:

RISK

2011-12-19 01:23:33

Change it to: Players[CurrentPlayer].Loc := Reason;

Synikk

2011-12-19 01:26:54

tyvm that solved the first error but now ive got another one at 'Terminate Script;'

[Error] (63:3): Unknown identifier 'Terminate' at line 62
Compiling failed.

RISK

2011-12-19 01:28:16

Change it to: TerminateScript;

Synikk

2011-12-19 01:31:30

/facepalm thanks
got another error but ill try and work it out

edit: have no idea what this one means

[Hint] (68:10): Variable 'Result' never used at line 67
[Error] (1:1): period ('.') expected at line 0
Compiling failed.

this is the function from lines 67-74
Function MineIronOre:Boolean
;Var
X, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x, y, ['ine', 'ocks', 'e R'], [2569562, 3029076, 2766945], 15) Then
WriteLn ('Found ore')
End;

RISK

2011-12-19 01:34:04

Feel free to request help, we are more than happy to help! :)

Synikk

2011-12-19 01:47:57

if you could help me with the error i added in the previous post that would be great :D

RISK

2011-12-19 01:53:57

Post the whole script in Simba tags please.

E:
Function MineIronOre:Boolean
;Var

To:

Function MineIronOre: Boolean;
Var

Synikk

2011-12-19 02:04:04

program ArdongueIronPowerMiner;

//{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\Debug.SCAR}
{$i SRL\SRL\Misc\Stats.simba}


Const
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120; // How many minutes you want to break after
BreakFor = 5; // How long to break for
Version= '1.00'; // Dont need to change
NumbOfPlayers= 1; // How many players you are botting
StartPlayer= 0; //Player to start autoing with (0 means 1st player)



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

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
Integers[1] := 4; //Seconds to try mining rock before clicking another.
end;

end;


Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;


Procedure Antiban;
Begin
Case Random (140) of
0: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); End;
1: Begin StatsGuise('Antiban') GameTab(Tab_Stats) HoverSkill('Mining', False) GameTab(28); End;
End;
End;


Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc := Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;



Function MineIronOre:Boolean
;Var
X, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x, y, ['ine', 'ocks', 'e R'], [2569562, 3029076, 2766945], 15) Then
WriteLn ('Found ore')
End;



Begin
SetupSRL;
DeclarePlayers;
Repeat
MineIronOre;
Until(false);
End





still get this error even after changing the position of the colon after the boolean
[Hint] (68:10): Variable 'Result' never used at line 67
[Error] (1:1): period ('.') expected at line 0
Compiling failed.

RISK

2011-12-19 02:05:00

Look at my edit on my previous post. :)

Synikk

2011-12-19 02:06:10

look at my edit on my previous post :P haha

RISK

2011-12-19 02:06:57

xD

"End" at the bottom of your script to "End.". Without the quotation marks, of course.

Synikk

2011-12-19 02:12:04

thanks so much thats the whole thing sorted (: one more thing, do you know the hotkey to stop the bot? cause i cant control the computer that the script is running on :S

RISK

2011-12-19 02:13:53

"F2" on your keyboard. :)