Log in

View Full Version : Procedure Problem



Supertrent1
01-28-2012, 04:47 AM
IDK what is wrong but my procedure stopped working.

The Whole Script:

Program SuperPowerChopper;

//{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}

const
Version = '1.0 Alpha';
NumbOfPlayers = 1;
StartPlayer = 0;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;

Function ChopDown: Boolean;
Var
x, y , PlusOne, TreeCounter, Toolong: Integer;

Begin;
PlusOne:= InvCount + 1
x:= MSCX;
y:= MSCY;
If FindObjTPA(x, y, 2964292, 3, 1, 15, 60, 600, ['Chop']) Then
Begin
StatsGuise('Horay, We found a tree');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
Wait(100+Random(100));
WaitOption('Chop', 500);
End;

End;

Flag;
MarkTime(TreeCounter);
If (TimeFromMark(TooLong) > 30000) Then
WriteLn('Could Not Find Tree');
Begin
Logout;

Repeat;
FindNormalRandoms;
StatsGuise('Antiban, Please wait!');
Antiban;
wait(1000);
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 3500)


End;

End;
Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19, 23,27,4,8,12,16,20,24,28];
StatsGuise('Dropping All Your Logs!');
For I:=0 To 27 Do
Begin
FindNormalRandoms;
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern[I], MOUSE_RIGHT);
ChooseOption('Drop');
End;
End;

FreeDTM(LogDTM);


End;





Begin
SetupSRL;
DeclarePlayers;
repeat
ChopDown;
if InvFull Then
DropLogs;
Until (false);

end.




The Procedure I'm having a problem with.


Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19, 23,27,4,8,12,16,20,24,28];
StatsGuise('Dropping All Your Logs!');
For I:=0 To 27 Do
Begin
FindNormalRandoms;
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern[I], MOUSE_RIGHT);
ChooseOption('Drop');
End;
End;

FreeDTM(LogDTM);


End;


The error:

[Error] (84:1): Identifier expected at line 83
Compiling failed.

Any help is appreciated!

kevin33
01-28-2012, 04:53 AM
You needed another end; (or 2 lol dont remember but you can look and see) in the function to properly end the last and start the new one.


Program SuperPowerChopper;

//{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}

const
Version = '1.0 Alpha';
NumbOfPlayers = 1;
StartPlayer = 0;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;

Function ChopDown: Boolean;
Var
x, y , PlusOne, TreeCounter, Toolong: Integer;

Begin;
PlusOne:= InvCount + 1
x:= MSCX;
y:= MSCY;
If FindObjTPA(x, y, 2964292, 3, 1, 15, 60, 600, ['Chop']) Then
Begin
StatsGuise('Horay, We found a tree');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
Wait(100+Random(100));
WaitOption('Chop', 500);
End;

End;

Flag;
MarkTime(TreeCounter);
If (TimeFromMark(TooLong) > 30000) Then
WriteLn('Could Not Find Tree');
Begin
Logout;
end;
Repeat;
FindNormalRandoms;
StatsGuise('Antiban, Please wait!');
Antiban;
wait(1000);
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 3500)


End;

End;
Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19, 23,27,4,8,12,16,20,24,28];
StatsGuise('Dropping All Your Logs!');
For I:=0 To 27 Do
Begin
FindNormalRandoms;
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern[I], MOUSE_RIGHT);
ChooseOption('Drop');
End;
End;

FreeDTM(LogDTM);


End;





Begin
SetupSRL;
DeclarePlayers;
repeat
ChopDown;
if InvFull Then
DropLogs;
Until (false);

end.