PDA

View Full Version : Why am i getting this error? - newbie



beefman
06-14-2014, 04:47 PM
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
06-14-2014, 05:01 PM
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
06-14-2014, 05:14 PM
removed end;. Still getting same error :/

Foundry
06-14-2014, 06:43 PM
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
06-14-2014, 07:01 PM
Thanks, also one last thing. Is there anyway to make the movement of the mini map random and different each time?

The Mayor
06-14-2014, 09:51 PM
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
06-14-2014, 11:06 PM
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
06-15-2014, 12:46 AM
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
06-15-2014, 12:49 AM
Good Job Turp, Repped.

He spent too long at the bar again...

Turpinator
06-15-2014, 07:24 AM
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.