Log in

View Full Version : BEGIN expected error, help please



ummmmm0k
06-21-2007, 07:07 AM
well im trying to make my second script which is a power chopper, i scripted most of it, and i got this error, but i dont know how to fix it, i looked ath that tut about errors but i couldnt find where a begin was missing, so can someone take a look at my script and either tell me what to do or make a correction for me and repost it thanks a lot.


program WoodCutter;
{.include SRL\SRL.Scar}
var
i,o: integer;
DBanMe: Integer;
const
TreeColor=2904136;
Procedure AntiBan;
begin
DBanMe:= Random(10);
case DBanMe of

0: RandomRClickEvery(2 + Random(13));
1: HoverSkill('Mining', False);
2: RandomChatEvery(10 + Random(5));
3: RotateEvery(20 + Random(10));
4: LeaveScreenEvery(5 + Random(5));
5: HoverEvery(15 + Random(5), 'Attack');
6: PickUpMouse;
7: BoredEvery(9 + Random(24));
8: DragItem(1, 1 + Random(18));
9: GameTab(1 + Random(12));
10: RotateEvery(7 + random(4));
end;
end;

procedure AntiRandom;
begin
FindTalk; //looks for a few letters from characters name (Nick) for randoms
FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
FindLamp('mining'); //if finds the lamp, picks the skill
if FindFight then //if finds that you're in a fight
begin
RunAwayDirection('n'); //runs north (n, s, w, e)
Wait(10000+random(2000)); //waits
RunBack;//Runs back
end;
end;
procedure FindTree;
begin
repeat;
wait(1000+random(500));
AntiBan;
FindColorSpiral(i, o, TreeColor, 3, 3, 514, 338) then
MMouse(i,o,1,1);
wait(200+random(100));
Mouse(i, o, 1, 1, true);
AntiRandom;
until(FullInv);
end;

Procedure DropLogs;
begin
wait(100+random(50));
AntiBan;
wait(2000+random(1000));
dropto(2,28);
wait(100+random(50));
AntiRandom;
end;

begin
SetupSRL;
repeat
FindTree;
DropLogs;
until(false)
end.

WhiteShadow
06-21-2007, 07:20 AM
program WoodCutter;
{.include SRL\SRL.Scar}

var
i, o: integer;
DBanMe: Integer;

const
TreeColor=2904136;

Procedure AntiBan;
begin
DBanMe:= Random(10);
case DBanMe of
0: Wait(1); // RandomRClickEvery
1: HoverSkill('Mining', False);
2: Wait(1); // RandomChatEvery(10 + Random(5));
3: Wait(1); // RotateEvery(20 + Random(10));
4: Wait(1); // LeaveScreenEvery(5 + Random(5));
5: Wait(1); // HoverEvery(15 + Random(5), 'Attack');
6: PickUpMouse;
7: Wait(1); // BoredEvery(9 + Random(24));
8: DragItem(1, 1 + Random(18));
9: GameTab(1 + Random(12));
10:Wait(1); // RotateEvery(7 + random(4));
end;
end;

procedure AntiRandom;
begin
FindTalk; //looks for a few letters from characters name (Nick) for randoms
FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
FindLamp('mining'); //if finds the lamp, picks the skill
if FindFight then //if finds that you're in a fight
begin
RunAwayDirection('n'); //runs north (n, s, w, e)
Wait(10000+random(2000)); //waits
RunBack;//Runs back
end;
end;

procedure FindTree;
begin
repeat;
wait(1000+random(500));
AntiBan;
if FindColorSpiral(i, o, TreeColor, 3, 3, 514, 338) then
if (IsUpText('hop'))then // Check up text.
begin
MMouse(i, o, 3, 3); // more random, coord.
wait(200+random(100));
Mouse(i, o, 1, 1, true);
end;
AntiRandom;
Wait(3000 + random(500)); // So it won't endlessly click.
until(InvFull);
end;

Procedure DropLogs;
begin
wait(100+random(50));
AntiBan;
wait(2000+random(1000));
dropto(2,28);
wait(100+random(50));
AntiRandom;
end;

begin
SetupSRL;
repeat
FindTree;
DropLogs;
until(false)
end.

This compiles for me. I added some basic notes. I suspect your using an older version of SRL, the current SRL no longer has those antiban procedures, it's in xextended.

gl with your script. "P

ummmmm0k
06-21-2007, 07:27 AM
kk it compiles for me now, thanks, do i need to declare players?

Markus
06-21-2007, 07:27 AM
Ok, there were a few more errors in your script then that begin error.
First, I made it compatible with the newest SRL, but I had to comment some of the antiban stuff, so it compiles with SRL 3.8.
I made comments at the places with errors I fixed, here is a version that at least compiles:

program WoodCutter;
{.include SRL\SRL.Scar}
var
i,o: integer;
DBanMe: Integer;
const
TreeColor=2904136;
Procedure AntiBan;
begin
DBanMe:= Random(10);
case DBanMe of
//0: RandomRClickEvery(2 + Random(13));
1: HoverSkill('Mining', False);
//2: RandomChatEvery(10 + Random(5)); //comented out most antiban stuff to make it 3.8 compatible
//3: RotateEvery(20 + Random(10));
//4: LeaveScreenEvery(5 + Random(5));
//5: HoverEvery(15 + Random(5), 'Attack');
6: PickUpMouse;
//7: BoredEvery(9 + Random(24));
//8: DragItem(1, 1 + Random(18));
9: GameTab(1 + Random(12));
//10: RotateEvery(7 + random(4));
end;
end;

procedure AntiRandom;
begin
FindTalk; //looks for a few letters from characters name (Nick) for randoms
FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
FindLamp('mining'); //if finds the lamp, picks the skill
if FindFight then //if finds that you're in a fight
begin
RunAwayDirection('n'); //runs north (n, s, w, e)
Wait(10000+random(2000)); //waits
RunBack;//Runs back
end;
end;
procedure FindTree;
begin
repeat;
wait(1000+random(500));
AntiBan;
if FindColorSpiral(i, o, TreeColor, 3, 3, 514, 338) then //Forgot an if
MMouse(i,o,1,1);
wait(200+random(100));
Mouse(i, o, 1, 1, true);
AntiRandom;
until(Invfull); //it is InvFull not FullInv
end;

Procedure DropLogs;
begin
wait(100+random(50));
AntiBan;
wait(2000+random(1000));
dropto(2,28);
wait(100+random(50));
AntiRandom;
end;

begin
SetupSRL;
repeat
FindTree;
DropLogs;
until(false)
end.

Oh, and I recommend you to read a tutorial on scripting standards.
Good luck with your script :)
Markus

edit: Damn, beaten by WhiteShadow

ummmmm0k
06-21-2007, 07:32 AM
can u tell me where to get the new srl antibans please

also is this decent for only 2 days scripting from reading beginner tuts to now?

Ramage
06-21-2007, 07:50 AM
RandomRClickEvery etc.: {.include SRL\SRL\Extended\xAntiBan.scar}
PolyGlotTalk: {.include SRL\SRL\Extended\xAutoTalk.scar}