SRL Archive - General Botting Help

newbie Question #2 : Compiled Error : 'BEGIN' expected


ikbennietniels

2014-02-06 10:30:39

Dear people i have another question when i want to start this script :

[PHP]program Mouse_Deluge;


procedure FindStartBattle;

var
X, Y: Integer;
function FindStartBattle(var X, Y: Integer): Boolean;
Var
StartBattle: Integer;
begin
StartBattle := TSCARBitmap.Create('deNqVUk1PwkAQZacHf4//yI8mypGDJ' +
'B4wgoYQ4T9sOZl4RQI0mooxKh5qY1r2wM0Djca4RUVUSNbpVmgDheBk8jL75u2' +
'b6aariZWEUmJQYvMQ0mWSLENS4p61QPl/bIXOf1glsqsctZViPELmzvgUYTx1I' +
'GPJbgu2mlBcdDeCt7B9CbP8eY+LqRgaJ1JZaEMhFu+pK8QLHzPuxUAI18UjnKF' +
'bnxYW3I2gFGvL8A844N1n8o6Sj0XOxLdRMUNG/+DiS8ubcOxy4WnqKQn4bBNUj' +
'ajUx91AfwOpJkkhoyekmKoVmPLX5XdFmazLxMjQHTh04CAWXQO37nbIBiWblKT' +
'NMY+rBjEyGsiY5MoL3777SFDT6PG+xwa+xouKo/6owVXROfBHRJ9n7ndztpKbh' +
'5Ppcrd1Cjumz9flm0c0zJK1hUv8GHUH6h73Senj13066y81U8GZTXI27C+Tr2z' +
'yCHisySlh95qsUZkdhivVAsHQL2LE45zla28cf5Wq/Qv8kkx+');
Result :=FindBitMapToleranceIn(StartBattle, X, Y, MIX1, MIY1, MIX2, MIY2, 20);
FreeBitMap(StartBattle)
end;

Begin
SetUpSRL;
ClearDeBug;
Wait(2000);
if (FindStartBattle (X, Y)) then
MMouse(X, Y, 3, 3)
else
WriteLn('Did Not Find StartBattle')
end.[/PHP]

It tells me in the messagebox : Compiler error line 8 'BEGIN' expected
Anyone has an idea of what it could be ? already thanks ! helps me out alot..

Brotein

2014-02-06 10:53:07

You have a procedure named FindStartBattle that has only variables with no structure.

procedure FindStartBattle; 
var
X, Y: Integer;

It should have:
procedure FindStartBattle; 
var
X, Y: Integer;
begin
end;

But since you already created a function, FindStartBattle(), you should just delete lines 4-7 since it does nothing anyways.

slacky

2014-02-06 11:02:28

Just remove "procedure FindStartBattle; ", like the following:


program Mouse_Deluge;

var X,Y: Integer;

function FindStartBattle(var X, Y: Integer): Boolean;
Var
StartBattle: Integer;
begin
StartBattle := TSCARBitmap.Create('deNqVUk1PwkAQZacHf4//yI8mypGDJ' +
'B4wgoYQ4T9sOZl4RQI0mooxKh5qY1r2wM0Djca4RUVUSNbpVmgDheBk8jL75u2' +
'b6aariZWEUmJQYvMQ0mWSLENS4p61QPl/bIXOf1glsqsctZViPELmzvgUYTx1I' +
'GPJbgu2mlBcdDeCt7B9CbP8eY+LqRgaJ1JZaEMhFu+pK8QLHzPuxUAI18UjnKF' +
'bnxYW3I2gFGvL8A844N1n8o6Sj0XOxLdRMUNG/+DiS8ubcOxy4WnqKQn4bBNUj' +
'ajUx91AfwOpJkkhoyekmKoVmPLX5XdFmazLxMjQHTh04CAWXQO37nbIBiWblKT' +
'NMY+rBjEyGsiY5MoL3777SFDT6PG+xwa+xouKo/6owVXROfBHRJ9n7ndztpKbh' +
'5Ppcrd1Cjumz9flm0c0zJK1hUv8GHUH6h73Senj13066y81U8GZTXI27C+Tr2z' +
'yCHisySlh95qsUZkdhivVAsHQL2LE45zla28cf5Wq/Qv8kkx+');
Result := FindBitMapToleranceIn(StartBattle, X, Y, MIX1, MIY1, MIX2, MIY2, 20);
FreeBitMap(StartBattle);
end;

Begin
SetUpSRL;
ClearDebug;
Wait(2000);
if (FindStartBattle(X, Y)) then
MMouse(X, Y, 3, 3)
else
WriteLn('Did Not Find StartBattle');
end.

The post above me is wrong as X,Y are globally used, and an empty procedure should just be removed.

ikbennietniels

2014-02-06 11:16:25

thanks for the help