SRL Archive - OSR Help

Getting mixed up with my ends ..


randy marsh

2013-04-27 12:24:59

This is my very basic oak chopper,

Im getting this error


[Error] (72:4): Identifier expected at line 71
Compiling failed.

(line 71 is the very last end in the main loop)




program Oakbank;




{$define SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Misc/SmartGraphics.Simba}




//------------------------------------------------------------------\\
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username goes here
Players[0].Pass := ''; //Password goes here
Players[0].Nick := ''; //Character name (excluding first letter)
Players[0].Active := True;
end;
//--------------------------------------------------------------------\\




Procedure ChopTree;
var
X, Y: Integer;

begin
SetAngle(SRL_ANGLE_HIGH);
writeln('setting angle')

if ((FindBlackChatMessage('nt damages')) or (FindBlackChatMessage('ou do not have an axe'))) then // checks for axe and ent
begin
writeln('Oh shoot... Your axe broke!');
Logout;//wll log you out of script
TerminateScript;
end;

Begin

X:=MSCX;
Y:=MSCY;

If FindobjTPA(X, Y, 3840, 5, 1, 15, 60, 20, ['Oak']) Then //TREE COLOUR

Begin
GetMousePos(X, Y);


Case Random(2) Of //EITHER CLICK LEFT MOUSE OR RIGHT
0:Mouse(X, Y, 5, 5, True);
1:Begin
Mouse(X, Y, 5, 5, False);
WaitOption('Chop', 500);
End;
End;



begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopTree;
end.
This end is causing me problems…….

Sjoe

2013-04-27 12:26:19

I think u forgot to give your If FindObjTPA thingy a procedure name.

The procedure containing X:=MSCX, Y := MSCY

randy marsh

2013-04-27 12:28:52

My standards are bit of a mess ;0

Nebula

2013-04-27 12:31:03

you forgot an end; at the end of your choptree procedure. ( you might need to actually add 1-3 ends because of your bad standards)

randy marsh

2013-04-27 12:34:33

Thanks was missing 3 ends somehow….

randy marsh

2013-04-27 12:49:56

Nvr mind im starting again script was in a mess

Sk1nyNerd

2013-04-27 12:56:59

just remember for each begin you need an end! when you mouse a begin/end it will highlight red and you can search through your code find the pairing begin/end

Sawyer

2013-04-27 17:31:55

From: randy marsh
Nvr mind im starting again script was in a mess


Just put your script through the parser, a tool that is included that can format your script.

Sjoe

2013-04-27 17:34:16

From: Sawyer
Just put your script through the parser, a tool that is included that can format your script.


Learn to standard yourself lol :p

Sawyer

2013-04-27 17:36:05

From: Sjoe
Learn to standard yourself lol :p

Yeah, I guess :p I standard my scripts by hand as I write them normally.

Sjoe

2013-04-27 17:37:41

From: Sawyer
Yeah, I guess :p I standard my scripts by hand as I write them normally.


That's a good boy ;)

randy marsh

2013-04-27 17:51:17

Yer its something im learning to do know, makes troubleshooting a hell of alot easier!

Chris!

2013-04-27 17:55:48

From: randy marsh
Yer its something im learning to do know, makes troubleshooting a hell of alot easier!


And makes it readable ;).