SRL Archive - RS3 Help

Why am i getting this error? - newbie


beefman

2014-06-14 12:47:36

Hey guys,
I've just started to create my own woodcutting script and i keep getting this error. I'm trying to get the minimap to move when isMouserovertext = False. I'll post code It's probably a VERY basic error. Could someone please correct it for me.. an unexpected until but i don't understand why it's incorrect

Here's the error: Exception in Script: Found unexpected token "until", expected "End" at line 70, column 5




begin
repeat
if isMouseOverText = False then
begin
case random(10) of
0: minimap.setAngle(MM_DIRECTION_NORTH);
1: minimap.setAngle(MM_DIRECTION_EAST);
2: minimap.setAngle(MM_DIRECTION_SOUTH);
3: minimap.setAngle(MM_DIRECTION_WEST);
end;
chopTree();
until tabBackpack.isFull();

end;

end.

Turpinator

2014-06-14 13:01:05

begin
repeat
if isMouseOverText = False then
begin
case random(10) of
0: minimap.setAngle(MM_DIRECTION_NORTH);
1: minimap.setAngle(MM_DIRECTION_EAST);
2: minimap.setAngle(MM_DIRECTION_SOUTH);
3: minimap.setAngle(MM_DIRECTION_WEST);
end;
end;
chopTree();
until tabBackpack.isFull();
end.

It helps when everything is tabbed properly. you have an extra end;

edit:there. i fixed it.

beefman

2014-06-14 13:14:19

removed end;. Still getting same error :/

Foundry

2014-06-14 14:43:38

From: beefman
removed end;. Still getting same error :/


You need to add an end; to your case statement like so:

procedure whatever();
begin
repeat
if isMouseOverText = False then
begin
case random(10) of
0: minimap.setAngle(MM_DIRECTION_NORTH);
1: minimap.setAngle(MM_DIRECTION_EAST);
2: minimap.setAngle(MM_DIRECTION_SOUTH);
3: minimap.setAngle(MM_DIRECTION_WEST);
end; // This is one is for the switch
end; // this one is for the if
chopTree();
until tabBackpack.isFull();

end;

beefman

2014-06-14 15:01:09

Thanks, also one last thing. Is there anyway to make the movement of the mini map random and different each time?

The Mayor

2014-06-14 17:51:28

From: beefman
Thanks, also one last thing. Is there anyway to make the movement of the mini map random and different each time?



if whatever = false then
randomCompass(0, 360, false);

beefman

2014-06-14 19:06:55

From: The Mayor

if whatever = false then
randomCompass(0, 360, false);


Thanks mayor, again.. I lost that part of that code yesterday because one of the old scripts overwritten

Kasi

2014-06-14 20:46:12

From: Turpinator
begin
repeat
if isMouseOverText = False then
begin
case random(10) of
0: minimap.setAngle(MM_DIRECTION_NORTH);
1: minimap.setAngle(MM_DIRECTION_EAST);
2: minimap.setAngle(MM_DIRECTION_SOUTH);
3: minimap.setAngle(MM_DIRECTION_WEST);
end;
chopTree();
until tabBackpack.isFull();

end;

end.

It helps when everything is tabbed properly. you have an extra end;


Good Job Turp, Repped.

The Mayor

2014-06-14 20:49:34

From: Kasi
Good Job Turp, Repped.


He spent too long at the bar again…

Turpinator

2014-06-15 03:24:44

From: The Mayor
He spent too long at the bar again…


SO WHAT IF I DID?!? we actually just lit a flaming bag of dogshit on fire really… and then spent a tit bit at the bar.