SRL Archive - OSR Help

Identifier expected?


Mahatna

2012-04-27 12:13:39

Hi guys getting the error stated in the title in my script, Tryed a few different things am new to this language and havent got any books on it or anything :cartman: Problem is on line 27 pointed out below.

program Mahatnasproject;
{$DEFINE SMART}
{$i srl/srl.simba}
Procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'eko';
Players[0].Pass := 'nigger';
Players[0].Nick := 'ger'; // E.G griff721 would be riff.
Players[0].Active:=True; // If you want current user to use this script
end;

procedure ChopTree;
var x, y: integer;
begin
if FindObj(x, y, 'hop', 5481339, 35)then // X, Y = where the mouse should be
begin
Mouse(x, y, 2,2, false); // the 2,2 are random movements the mouse makes
ChooseOption('hop');
repeat
wait(1200+random(250)); //Wait 1000milsecons.
Until not IsUpText('ew') or (InvFull); // do untill 'txt' comes on screen
until(InvFull); <---- Line 27
end;
end;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopTree;
end.

Abu

2012-04-27 12:23:53

You're missing a repeat for the last until.


EDIT:
     repeat //First repeat
wait(1200+random(250));
Until not IsUpText('ew') or (InvFull); //First Until
until(InvFull); // There is no repeat for this until

masterBB

2012-04-27 12:57:55

Fix'd that standards a bit, not all. If you space your script right these problem are easier to spot:

program Mahatnasproject;
{$DEFINE SMART}
{$i srl/srl.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'username';
Players[0].Pass := 'pass';
Players[0].Nick := 'erna'; // E.G griff721 would be riff.
Players[0].Active := True; // If you want current user to use this script
end;

procedure ChopTree;
var
x, y: integer;
begin
if FindObj(x, y, 'hop', 5481339, 35)then // X, Y = where the mouse should be
begin
Mouse(x, y, 2,2, false); // the 2,2 are random movements the mouse makes
ChooseOption('hop');
repeat //added
repeat
wait(1200+random(250)); //Wait 1000milsecons.
until not IsUpText('ew') or (InvFull); // do untill 'txt' comes on screen
until(InvFull); <---- Line 27
end;
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopTree;
end.