Log in

View Full Version : syntax error



gerauchert
06-16-2007, 09:06 PM
Line 107: [Error] (17774:1): Syntax error in script C:\Program Files\SCAR 2.03\Scripts\gerauchertWcer.scar

Yep no clue what that means ffs....

Can some1 explain to me what it is and how to fix it in my script please?

thanks


procedure Chop;

var WaitTime: Integer;

begin
SetRun(True);
GameTab(4);
Wait(500 + random(250));
if(FindColorTolerance(x,y,TreeColor,MSX1,MSY1,MSX2 ,MSY2,3))then
begin
repeat
MMouse(x,y,3,3);
if IsUpText('illow') then
Mouse(x,y,3,3,False)
ChooseOption(x,y,'hop');
MarkTime(WaitTime);
while (TimeFromMark(WaitTime) < 5000) do
begin
If(FindFastRandoms) or (InvFull) then break;
case Random(12) of
2: MouseBox(MSX1, MSY1,MSX2, MSY2, 3);
4: PickUpMouse;
6: BoredHuman;
8: HoverSkill('Random', False);
10: RandomRClick;
12: AlmostLogOut;
until(InvFull); // <<<<<-----LINE 107
end;
end;
end;

Pentti
06-16-2007, 09:09 PM
Cases need an end after it.
If(FindFastRandoms) or (InvFull) then break;
case Random(12) of
2: MouseBox(MSX1, MSY1,MSX2, MSY2, 3);
4: PickUpMouse;
6: BoredHuman;
8: HoverSkill('Random', False);
10: RandomRClick;
12: AlmostLogOut;
end; //End here
until(InvFull); // <<<<<-----LINE 107

also Case random(12) will return random number between 0-11, so replace 12: with 11: at the end of case.

gerauchert
06-17-2007, 07:10 PM
hey man thanks for the help =p

ok now i got another problem tho....I decided before i had read this that i was gonna change the script for more extensive antiban but now im getting another SYNTAX ERROR! wow this time its in the antirandom area....weird cuz i havent touched it at all...can you see what u can make of it?

thanks

Line 144: [Error] (18191:1): Syntax error in script C:\Program Files\SCAR 2.03\Scripts\gerauchertWcer.scar

program Powerchopper;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/WoodCutting.scar}

var Loads: Integer;

//SETUP HERE//
const

TreeColor= 2121808; //set tree color here
ChopTime= 5000; //Milliseconds

procedure DeclarePlayers;
begin
HowManyPlayers := 1;//Dont touch (just state whether active or not)
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'Usernamehere';
Players[0].Pass := 'Passwordhere';
Players[0].Nick := 'Nicknamehere'; //3 - 4 letters of YOUR username
Players[0].Active :=True; //Auto with this account?
end;

//STARTING UP//
procedure Setup;
begin
ActivateClient;
SetupSRL;
Wait(500);
end;

//ANTIBAN//

procedure DontGetBanned;
begin
if(not(LoggedIn))then
Exit;
case Random(11) of
0: PickUPMouse;
1: begin
HoverSkill('Random', False);
Wait(500+ random (250));
HoverSkill('Woodcutting', False);
end;
2: begin
GameTab(5);
Wait(2000 + random(1200));
GameTab(4);
end;
3:RandomRClick;
4:MouseBox(MSX1,MSY1,MSX2,MSY2,3);
5:MouseBox(MMX1,MMY1,MMX2,MMY2,3);
6:begin
case random(4) of
0: begin
GameTab(5);
MMouse(x,y,590,304);
Wait(500 + random(300));
Mouse(x,y,590,304,False);
ChooseOption(x,y,'xamine');
Wait(1500 + random(1300));
MMouse(x,y,610,261);
Mouse(x,y,610,261,False);
ChooseOption(x,y,'xamine');
Wait(700 + random(200));
GameTab(4);
end;
1: begin
GameTab(6);
Wait(400 + random(200));
MouseBox(566,209,734,455,3);
Sleep(2000 + random(500));
HoverSkill('random',False);
Wait(350 + random(200));
GameTab(4);
end;
2: begin
GameTab(7);
Wait(500 + random(100));
MouseBox(566,209,734,455,3);
Sleep(3000 + random(1000));
Wait(300 + random(125));
GameTab(4);
end;
3: begin
GameTab(8);
MouseBox(566,209,734,455,3);
Sleep(2000 + random(700));
Wait(500 + random(230));
GameTab(9);
Wait(1000 + random(800));
GameTab(1);
Wait(3000 + random(1200));
GameTab(3);
Wait(2500 + random(1200));
GameTab(11);
Wait(500 + random(100));
GameTab(4);
end;

7: begin
case random(4) of
0: begin
TypeSend('sooooo bored omg');
Wait(2000 + random(575));
TypeSend('muahahhahahha chop dem treeeeez');
Wait(1000 + random(300));
TypeSend('ok im done...need 2 focus...');
end;
1: begin
TypeSend('wow these autoers r swarming');
Wait(500 + random(400));
TypeSend('i want to murder them idiot lvl 3 defaults');
TypeSend('Die die die noooobs rawr');
Wait(2000 + random(300));
TypeSend('*sigh*');
end;
2: begin
TypeSend('wc lvls?');
Wait(2000 + random(750));
TypeSend('=p');
TypeSend('*yawn* boring');
Wait(500 + random(300));
end;
8: BoredEvery(2 + random(1));
9: SleepAndMoveMouse(5000 + random(1500));
10:RotateEvery(2 + random(1));
end;
end;



//ANTIRANDOMZ//

Function FindFastRandoms: Boolean; // <<<<<<<<<LINE 144

Var
i: Integer;

Begin
For I := 1 To 11 Do
Begin
Case I Of
1: If FindDead Then
Result := True;

2: If FindMod Then
Result := True;

3: If FindMime Then
Result := True;

4: If FindMaze Then
Result := True;

5: If FindQuiz Then
Result := True;

6: If FindDemon Then
Result := True;

7: Begin
If NoGameTab Then
Begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
End;
End;

8 : If RC Then
Result := True;

9 : If FindFight Then
Begin
Result := True;
RunTo('S', True);
End;

10: If FindTalk Then
Result := True;

11: If FindTrade Then
Result := True;
End;
Wait(1);
End;
End;

//CHOPING PROCEDURE//
procedure Chop;

var WaitTime: Integer;

begin
SetRun(True);
GameTab(4);
Wait(500 + random(250));
if(FindColorTolerance(x,y,TreeColor,MSX1,MSY1,MSX2 ,MSY2,3))then
begin
repeat
GetMousePos(x,y);
MMouse(x,y,3,3);
if IsUpText('illow') then
Mouse(x,y,3,3,False)
ChooseOption(x,y,'hop');
MarkTime(WaitTime);
while (TimeFromMark(WaitTime) < (ChopTime)) do
begin
If(FindFastRandoms) or (FindNormalRandoms) or (InvFull) then break;
DontGetBanned;
end;
end;
end;
//DROPPING PROCEDURE//
procedure Drop;
begin
GameTab(4);
if(InvFull)then
begin
DropTo(2,28)
Loads:=Loads+1;
TimeRunning;
end;
end;
//PROGRESS REPORT//
procedure Proggy;
begin
ClearDebug;
Writeln('*************************************');
Writeln('=========== PROGRESS REPORT =========');
Writeln('did: ' + IntToStr(Loads) + ' Loads');
Writeln('ran for: ' + TimeRunning + ' minutes');
Writeln('*************************************');
end;
//MAIN LOOP//
begin
Setup;
DeclarePlayers;
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
FindNormalRandoms;
repeat
Chop;
Drop;
Proggy;
DontGetBanned;
until(False);
end.

Pentti
06-17-2007, 07:13 PM
You are probably missing ends from the cases inside cases, lol. :D
One hint: Do not try to make your code too complicated.

gerauchert
06-18-2007, 03:13 AM
ok thanks im just trying to make my script more human like doing things that i do and i didnt want a wimpy antiban lol i may tone it down a bit tho...

didnt realize that even tho the error was saying it was line 144 it was talking bout the lines above =(

hmm ill look through the cases area and find where the missing 'end' is lol

and just for future reference...is a syntax error directly related to something with cases or can it be other things?

Pentti
06-18-2007, 07:50 AM
and just for future reference...is a syntax error directly related to something with cases or can it be other things?
It can be something else, like this:
program New;
begin
writeln('yay syntax error)
end.