SRL Archive - RuneScape News and General

Need help with script


QAZ

2012-06-06 11:32:23

hi, looking at your tutorials and videos for about a month now and my brother has been teaching me a bit and i've managed to throw together a flax script.

i keep getting this error and i have no idea what to do and my brother is out, any help please?


[Error] (51:2): Closing square bracket (']') expected at line 50
Compiling failed.

CephaXz

2012-06-06 11:35:13

Post your full script here with simba tags.

QAZ

2012-06-06 11:36:21

From: CephaXz
Post your full script here with simba tags.


simba tags?

CephaXz

2012-06-06 11:38:22

Reply post with clicking "Go Advanced". There's a button with lion head. Post your script in between the tags.

QAZ

2012-06-06 11:45:40

program QAZsflaxFinder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i SPS/sps.simba}

// Start in seers village bank

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 := '';
end;

Var
myPath:TPointArray;
myPrath:TPointArray;

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

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
case Random(8) of
0:
begin
HoverSkill('Mining', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

Procedure RunToFlax;
begin
if not LoggedIn then Exit;
RestUntil(100);
SPS_Setup(RUNESCAPE_SURFACE,['6_6','6_7','7_7']);
myPath := [Point(2740, 2692), Point(2741, 2760), Point(2744, 2830), Point(2779, 2880), Point(2807, 2856)
SPS_WalkPath(myPath)
end;

Procedure PickFlax;
var
i: Integer;
begin
if not (LoggedIn) then
Exit;
if not (FindNormalRandoms) then
begin
SetAngle(SRL_ANGLE_HIGH);
while (InvCount < 28) do
begin
while (IsMoving) do
X:= MSCX;
Y:= MSCY+30;
Wait(RandomRange(1000, 1500));
if(FindColorSpiralTolerance(X, Y, 14407266, MSX1, MSY1, MSX2, MSY2, 41)) then
begin
Mouse(X, Y, 10, 10, true);
Wait(RandomRange(500, 1000));
AntiBan;
end else
Break;
end;
end;
end;


Procedure ToBank;
begin
if not LoggedIn then Exit;
RestUntil(100);
SPS_Setup(RUNESCAPE_SURFACE,['7_7','6_7','6_6'];
myPath := [Point(2801, 2875), Point(2766, 2879), Point(2746, 2825), Point(2730, 2763), Point(2740, 2710), Point(2736, 2675)];
SPS_WalkPath(myPath)
end;

Procedure BankFlax;
begin
FindNormalRandoms;
SetAngle(SRL_ANGLE_HIGH);
wait(2000)
OpenBankFast('clt')
if PinScreen then
InPin(Players[0].Pin);
WriteLn('Opened bank. Depositing flax...');
wait(3000);
DepositAll();
CloseBank;
Antiban;
WriteLn('finished banking. Resting...');
Antiban;
wait(1500);
RestUntil(100);
end;

begin
Smart_Server := 3;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
RunToFlax;
PickFlax;
ToBank;
BankFlax;
until(not LoggedIn)
end.

CephaXz

2012-06-06 11:53:59


program QAZsflaxFinder;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i SPS/sps.simba}

// Start in seers village bank

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 := '';
end;

Var
myPath:TPointArray;
myPrath:TPointArray; //This is not used too

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

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
case Random(8) of
0:
begin
HoverSkill('Mining', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

Procedure RunToFlax;
begin
if not LoggedIn then Exit;
RestUntil(100);
SPS_Setup(RUNESCAPE_SURFACE,['6_6','6_7','7_7']);
myPath := [Point(2740, 2692), Point(2741, 2760), Point(2744, 2830), Point(2779, 2880), Point(2807, 2856)]; //You missed a ] here
SPS_WalkPath(myPath)
end;

Procedure PickFlax;
var
i, x, y: Integer; //You did not declare the variance x and y, and your i is not used in the procedure
begin
if not (LoggedIn) then
Exit;
if not (FindNormalRandoms) then
begin
SetAngle(SRL_ANGLE_HIGH);
while (InvCount < 28) do
begin
while (IsMoving) do
X:= MSCX;
Y:= MSCY+30;
Wait(RandomRange(1000, 1500));
if(FindColorSpiralTolerance(X, Y, 14407266, MSX1, MSY1, MSX2, MSY2, 41)) then
begin
Mouse(X, Y, 10, 10, true);
Wait(RandomRange(500, 1000));
AntiBan;
end else
Break;
end;
end;
end;


Procedure ToBank;
begin
if not LoggedIn then Exit;
RestUntil(100);
SPS_Setup(RUNESCAPE_SURFACE,['7_7','6_7','6_6']); //Missed out ) here
myPath := [Point(2801, 2875), Point(2766, 2879), Point(2746, 2825), Point(2730, 2763), Point(2740, 2710), Point(2736, 2675)];
SPS_WalkPath(myPath)
end;

Procedure BankFlax;
begin
FindNormalRandoms;
SetAngle(SRL_ANGLE_HIGH);
wait(2000)
OpenBankFast('clt')
if PinScreen then
InPin(Players[0].Pin);
WriteLn('Opened bank. Depositing flax...');
wait(3000);
DepositAll();
CloseBank;
Antiban;
WriteLn('finished banking. Resting...');
Antiban;
wait(1500);
RestUntil(100);
end;

begin
Smart_Server := 3;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
RunToFlax;
PickFlax;
ToBank;
BankFlax;
until(not LoggedIn)
end.

QAZ

2012-06-06 12:32:22

thanks alot buddy :)

Rich

2012-06-06 16:44:41

If you couldn't figure out what was changed in CephaXz post, the error was caused by this procedure
Procedure RunToFlax;
begin
if not LoggedIn then Exit;
RestUntil(100);
SPS_Setup(RUNESCAPE_SURFACE,['6_6','6_7','7_7']);
myPath := [Point(2740, 2692), Point(2741, 2760), Point(2744, 2830), Point(2779, 2880), Point(2807, 2856) // THIS LINE IN PARTICULAR
SPS_WalkPath(myPath)
end;
It gave an error because myPath is an array, and arrays require square brackets, one of which you was missing at the end of myPath :)

QAZ

2012-06-06 16:45:28

From: Rich
If you couldn't figure out what was changed in CephaXz post, the error was caused by this procedure
Procedure RunToFlax;
begin
if not LoggedIn then Exit;
RestUntil(100);
SPS_Setup(RUNESCAPE_SURFACE,['6_6','6_7','7_7']);
myPath := [Point(2740, 2692), Point(2741, 2760), Point(2744, 2830), Point(2779, 2880), Point(2807, 2856) // THIS LINE IN PARTICULAR
SPS_WalkPath(myPath)
end;
It gave an error because myPath is an array, and arrays require square brackets, one of which you was missing at the end of myPath :)


ahhh, thanks for the explanation mate :)