Log in

View Full Version : Need help on a script!



Supertrent1
01-28-2012, 04:36 PM
Well guys, I'm having a problem with this 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 TreeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.97);

FindColorsSpiralTolerance(MMCX, MMCY, arP, 3162959, MMX1, MMY1, MMX2, MMY2, 5);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 3.81) and (X <= 7.65) and (Y >= 3.94) and (Y <= 7.91) and (Z >= 2.55) and (Z <= 5.28) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

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

Begin;
PlusOne:= InvCount + 1
x:= MSCX;
y:= MSCY;
If FindObjTPA(x, y, TreeColor, 3, 1, 15, 80, 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);

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.

I am having a problem with this section

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

Begin;
PlusOne:= InvCount + 1
x:= MSCX;
y:= MSCY;
If FindObjTPA(x, y, TreeColor, 3, 1, 15, 80, 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);

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


End;

End;

and I'm getting this error:

[Error] (80:1): Identifier expected at line 79
Compiling failed.

Any help is appreciated. This is my first script EVER. so detailed explanation or an example is helpful of what I am doing wrong and what I should do to fix it is wanted.
I will +rep!
:p
Thanks,
Super

Chris
01-28-2012, 05:29 PM
When you try to compile it, it highlights a line. You have to add "end;" before that line :)

Supertrent1
01-28-2012, 06:09 PM
When you try to compile it, it highlights a line. You have to add "end;" before that line :)

Fixed it, thanks a lot. +rep :)