SRL Archive - OSR Help

My first script trying to learn!


adam101

2012-03-27 17:30:33

[Error] (29:1): Semicolon (';') expected at line 28
Compiling failed.


If i put a semicolon after the begin it triggers a new error that want a period on line 0.


After looking over other peoples scripts i'v noticed only some have a ; after it, i did read its to tell you thats its the end of the line but so confused.






program New;
{$i srl/srl.simba}
Procedure DeclarePlayers;
begin


//ACCOUNT INFO FOR LOGGIN\\

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;


end;
procedure FletchLog;
var x, y: integer;
begin
if FindObj(x, y,'aft', 2638939, 35) then
begin
Mouse(x, y, 2,2, false);
ChooseOption('aft');
end
end
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end

Yago

2012-03-27 17:36:04

You need a colon after the second to last end and a period after the last end.

Ashaman88

2012-03-27 17:36:23

procedure FletchLog;
var x, y: integer;
begin
if FindObj(x, y,'aft', 2638939, 35) then
begin
Mouse(x, y, 2,2, false);
ChooseOption('aft');
end;
end;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.

adam101

2012-03-27 17:38:04

From: Yago
You need a colon after the second to last end and a period after the last end.



why the period at the last end?

Yago

2012-03-27 17:39:50

From: adam101
why the period at the last end?


It is the part of the script that is actually executed.

 Procedure DeclarePlayers;
begin


//ACCOUNT INFO FOR LOGGIN\\

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;


end;

procedure FletchLog;
var x, y: integer;
begin
if FindObj(x, y,'aft', 2638939, 35) then
begin
Mouse(x, y, 2,2, false);
ChooseOption('aft');
end
end;

begin
//Nothing Here
end.

If you had something like the above example, nothing in the script would be executed.

adam101

2012-03-27 17:40:44

[Error] (21:1): Semicolon (';') expected at line 20
Compiling failed.



procedure FletchLog;
var x,y:integer;
begin
if FindObj(x,y,'aft',2638939,35) then
begin
Mouse(x,y,2,2,false);
ChooseOption('aft');
end;
end;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end.




FIXED I was missing a ; after a end up higher in my script.

cause

2012-03-27 17:52:55

Just throwing it out there, but you wouldn't use FindObj to fletch something (assuming this is on logs in your inv [been awhile since I've fletched]), what you'd probably want is:
function FletchLog:boolean;
var x,y:integer;
begin
if FindDTM(x,y,'aft',2638939,35) then //I can't remember the exact things needed
begin
Mouse(x,y,2,2,false);
if ChooseOption('aft') then result := true
else result := false;
end;
end;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
if not FletchLog then
Bank;
until(something=false);
end.

adam101

2012-03-27 18:01:08

thanks, I was trying to use a tutorial but it was for cutting tree's that makes more sense.