Log in

View Full Version : Wierd Syntax Error



7Jam
11-10-2007, 05:20 PM
Failed when compiling
Line 455: [Error] (6250:1): Syntax error in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/Bank.scar

A new tab in Scar opens called 'Bank.Scar" and this pops up. Doesn't matter what script i try to use this always pops up. I redownloaded scar but i still get this error. Any ideas?

King of Knives
11-10-2007, 05:35 PM
I'll just post the complete Bank.scar.

Here:
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป Bank Routines --//
//-----------------------------------------------------------------//

// * function BankScreen:Boolean; // * by RSN
// * function PinScreen:Boolean; // * by Starblaster100
// * function InPin(pin: string): Boolean; // * by RSN / Starblaster100
// * Procedure Fixbank // * WT-Fakawi/RsN
// * procedure Deposit(slot, toslot, thetype:integer); // * by PPLSUQBAWLZ / Stupid3ooo
// * procedure Withdraw(Col,Row,Amount:integer); // * by Odie3355/Stupid3ooo/Starblaster100 fixed by Town
// * procedure DepositAll; // * by Mutant Squirrle
// * Function OpenBankQuiet(WhichBank:string):Boolean; // * by WT-Fakawi
// * Function FindBank(TheBank:string): Boolean; // * by WT-Fakawi
// * Procedure CloseBank; // * by Starblaster100
// * Function OpenBankGlass(WhichBank:String; ChangeCompass:Boolean): Boolean; // * By Wizzup?
// * function OpenBankFast(Location: String): Boolean; // * by Wizzup? and Nielsie95
// * function OpenBank; // * by SRL

{************************************************* ******************************
function BankScreen: Boolean;
by: SRL Dev Team
Description: Finds Bankscreen. Returns true if Found.
************************************************** *****************************}

function BankScreen: Boolean;
var
x, y: Integer;
begin
if FindColor(x, y, 2070783, 22, 31, 473, 52) then
Result := IsTextAtEx(x, y - 2, 'The Bank of', 0, upchars, True, False, 0, 0,
2070783)
else if FindColorTolerance(x, y, 2070783, 22, 31, 473, 52, 30) then
Result := IsTextAtEx(x, y - 2, 'The Bank of', 30, upchars, True, False, 0, 0,
GetColor(x, y));
end;

{************************************************* ******************************
function PinScreen: Boolean;
by: Starblaster100
Description: Finds Pin Screen. Returns true if Found.
************************************************** *****************************}

function PinScreen: Boolean;
Var
x, y: Integer;
begin
Result := FindText(x, y, 'First', upchars, 175, 80, 212, 100);
end;

{************************************************* ******************************
function InPin(pin: String): Boolean;
by: RSN / Starblaster100
Description: Puts in bank pin. Results True if XXX
************************************************** *****************************}

function InPin(pin: string): Boolean;
var
iNumber: Integer;
begin
if (PinScreen) then
begin
Result := True;
for iNumber := 1 to Length(pin) do
begin
MMouse(395, 175, 10, 10);
Wait(200 + Random(200));
ClickText(pin[iNumber], upchars, 1, 1, 512, 336, True);
Wait(500 + Random(500));
end;
repeat
Wait(100);
until BankScreen or not LoggedIn;
end;
end;

{************************************************* ******************************
procedure FixBank;
by: WT-Fakawi/RsN
Description: Scrolls the bank screen up.
************************************************** *****************************}

procedure FixBank;
var
x, y: Integer;
begin
if (GetColor(475, 75) = 1777699) and (BankScreen) then
begin
MMouse(475, 65, 3, 3)
GetMousePos(x, y);
HoldMouse(x + Random(1), y + Random(1), True);
while (GetColor(475, 75) = 1777699) do
Wait(100);
Wait(300 + Random(300));
GetMousePos(x, y);
ReleaseMouse(x, y, True);
end;
end;

{************************************************* ******************************
procedure Deposit(slot, toslot, thetype: Integer);
by: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
Description: Deposits from Slot to ToSlot.
Type 2 = All, Type 1 = one-by-one.
************************************************** *****************************}

procedure Deposit(Slot, ToSlot, TheType: Integer);
var
i,n: Integer;
TB: Tbox;
begin
if (BankScreen) then
begin
for i:= Slot to ToSlot do
begin
if ExistsItem(i) then
begin
TB:= InvBox(i);
if (TheType = 1) then
begin
Mouse((TB.x1 - 4) + ((TB.x2 - TB.x1)/2), (TB.y1 - 4) + ((TB.y2 - TB.y1)/2), 8, 8, True);
Wait(50+random(50));
end else
if (TheType = 2) then
begin
n:=0;
Mouse((TB.x1 - 4) + ((TB.x2 - TB.x1)/2), (TB.y1 - 4) + ((TB.y2 - TB.y1)/2), 8, 8, False);
if (ChooseOption('All')) then
begin
Wait(100+random(100));
repeat
n:=n+1;
Wait(40);
if not(ExistsItem(i)) then break;
until n>50;
end;
end;
end;
end;
end;
end;

{************************************************* ******************************
procedure Withdraw(Col, Row, Amount: Integer);
by: Odie5533/Stupid3ooo/Starblaster100 fix by Town
Description: Withdraws Amount at Column/Row.
************************************************** *****************************}

procedure Withdraw(col, row, Amount: Integer);
var
rx, ry: Integer;
begin
rx := 35 + (col * 49);
ry := 27 + (row * 38);
if (BankScreen) then
begin
if (Amount = 1) then
Mouse(rx, ry, 0, 0, True)
else
begin
Mouse(rx, ry, 0, 0, False);
if (Amount = 5) or (Amount = 10) then
ChooseOption('Withdraw ' +IntToStr(Amount))
else if (Amount = 0) then
ChooseOption('Withdraw All')
else
begin
ChooseOption('Withdraw X');
Wait(1000 + Random(100));
TypeSend(IntToStr(Amount) + Chr(13));
end;
end;
end;
end;


{************************************************* ******************************
procedure DepositAll;
by:
Description: Deposits all items in your inventory
************************************************** *****************************}

procedure DepositAll;
begin
if (BankScreen) then
Deposit(1, 28, 2);
end;

{************************************************* ******************************
function OpenBankQuiet(WhichBank: string): Boolean;
By: WT-Fakawi and modified by Ron
Description: Opens any given bank in the free world using
FindDeformedBitmapToleranceIn. Avoids strange mouse movements. Will cause
significant lag (approx. 1 second), but finds the bank with one click.

Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'eb' (Edgeville Bank)
'akb' (Al-Kharid Bank)
************************************************** *****************************}

function OpenBankQuiet(WhichBank: string): Boolean;
var
TheCounter, dx, dy, tol, Mark2, Mark3: Integer;
acc, accthres: Extended;
begin
case WhichBank of
'feb', 'fwb': TheCounter := BitmapFromString(1, 10, '6C583296897A948779948779736' +
'C63A59E968C7F6F9686749B8A7685663E');
// varrock west
'vwb': TheCounter:= BitmapFromString(10, 1, 'A0997F504A49504A49504A495E4' +
'F215E4F215E4F215E4F212C250EA0997F');
// varrock east
'veb': TheCounter := BitmapFromString(1, 10, '5E4D1589826D88806D88806D867' +
'F6C9996907C7664847D648C836891876B');
// draynor and this works too for alkharid
'akb', 'db', 'eb': TheCounter:= BitmapFromString(12, 1, '584209735C29735C29735C29605' +
'85558504D60504D58504D58504D58504D58504D605855');
end;

MarkTime(Mark3);
tol := 1;
accthres := 0.6;
repeat
if IsUpTextMulti('ank', 'Bo', 'ot') then
begin
GetMousePos(dx, dy);
Mouse(dx, dy, 0, 0, False);
if ChooseOption('uickly') then
begin
MarkTime(Mark2);
repeat
Wait(10);
if TimeFromMark(Mark2) > 20000 then
begin
WriteLn('couldnt find the bank. Exiting');
FreeBitmap(TheCounter);
Exit;
end;
until BankScreen or PinScreen;
Result := True;
FreeBitmap(TheCounter);
Exit;
end;
end;

FindDeformedBitmapToleranceIn(TheCounter, dx, dy, MSX1 + 50, MSY1 + 50, MSX2
- 50, MSY2 - 50, tol, 4, True, acc);
if (acc >= accthres) then
begin
MMouse(dx, dy, 0, 0);
if IsUpTextMulti('ank', 'Bo', 'ot') then
begin
GetMousePos(dx, dy);
Mouse(dx, dy, 0, 0, False);
if ChooseOption('uickly') then
begin
MarkTime(Mark2);
repeat
Wait(10);
if TimeFromMark(Mark2) > 20000 then
begin
WriteLn('couldnt find the bank. Exiting');
FreeBitmap(TheCounter);
Exit;
end;
until BankScreen or PinScreen;
end;
Result := True;
FreeBitmap(TheCounter);
Exit;
end;
end;
Wait(100);
tol := tol + 4;
if tol >= 20 then
begin
tol := 1;
accthres := accthres - 0.1;
if accthres < 0.2 then
begin
WriteLn('couldnt find the bank. Exiting');
FreeBitmap(TheCounter);
Exit;
end;
end;
until TimeFromMark(Mark3) > 60000;
FreeBitmap(TheCounter);
end;

{************************************************* ******************************
function FindBank(TheBank: String): Boolean;
By: WT-Fakawi and modified by Ron
Description: Finds and opens any given bank in the free world. If symbolcolor
is in minimap it will walk to the bank and open it!
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
************************************************** *****************************}

function FindBank(TheBank: string): Boolean;
var
bx, by, TheDTM: Integer;
WhichAngle: Extended;
begin
case TheBank of
'feb': TheDTM := DTMFromString('78DA63AC67626088634001FFFFFD63F80FA 41' +
'9416C2060AC01AA4987C83141D5FCF9C3C4C0055503028CAD 44A8' +
'E924AC0600131E11B5');
'fwb': TheDTM := DTMFromString('78DA636C676260086540038C0CFFC12403C 37' +
'F206004A98986C8304155FCF9C3C4C0055503D6D14C849A6E C26A' +
'009F5A0EA1');
'db': TheDTM := DTMFromString('78DA636C67626008644001FFFFFD63F80FA 41' +
'9416C2060AC01AAF182C8B140D5FCF9C304A619A17CB09A20 4C35' +
'22E86AC2F09B0300F8811153');
'veb': TheDTM := DTMFromString('78DA63EC61626008624001FFFFFD63F80FA 41' +
'9416C2060EC00AA8982C83141D5FCF9C3C4C0055503028C13 8850' +
'D343580D00122211A9');
'vwb': TheDTM := DTMFromString('78DA63EC606260B066C000FF81981144030 1E' +
'354A01A3B88381354FECF1F260611A81A1000AB3125428D2E 7E35' +
'0087F80E5E');
'akb': TheDTM := DTMFromString('78DA636C606260F06140019D9D710CFF813 42' +
'310FF0702C652A01A37881C1354CD9F3F4C0C5C5035200056 E345' +
'841A3FFC6A002A3B0F97');
end;

if FindDtmRotated(TheDTM, bx, by, MMX1, MMY1, MMX2, MMY2, Radians(-30), Radians(30), 0.05,
WhichAngle) then
begin
Mouse(bx, by, 0, 0, True);
// FTWait(8);
FFlag(0);
if OpenBankQuiet(TheBank) then
begin
FixBank;
Result := True;
FreeDTM(TheDTM);
Exit;
end
else Result := False;
end
else Result := False;
FreeDTM(TheDTM);
end;

{************************************************* ******************************
function CloseBank: Boolean;
By: Starblaster100
Description: Closes the bank window - Tries twice before exiting
************************************************** *****************************}

function CloseBank: Boolean;
var
i, Timer, Points: Integer;
begin
if(BankScreen)then
begin
MarkTime(Timer);
repeat
Mouse(485, 41, 4, 4, True);
for i := 0 to 30 do
begin
Wait(100);
Points := CountColorTolerance(2070783, 177, 30, 337, 52, 5);
if(Points < 170)then
begin
Result := True;
Break;
end;
end;
until(Points < 170)or(TimeFromMark(Timer) > 8000)
end;
end;

{************************************************* ******************************
function OpenBankGlass(WhichBank: String; ChangeCompass, ChangeAngle: Boolean): Boolean;
By: Wizzup? and modified by Ron
Description: Opens the bank.
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
************************************************** *****************************}

function OpenBankGlass(WhichBank: string; ChangeCompass, ChangeAngle: Boolean): Boolean;
var
OBC: TPoint;
c, Speed: Integer;
begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
if ChangeAngle then HighestAngle;
if ChangeCompass then
begin
c := Random(2);
case WhichBank of
'feb', 'fwb', 'veb': if c = 0 then MakeCompass('N') else MakeCompass('S');
'akb', 'db', 'eb', 'vwb': if c = 0 then MakeCompass('E') else MakeCompass('W');
end;
end;
if FindColorTolerance(OBC.x, OBC.y, 10594993, MSX1, MSY1, MSX2, MSY2, 4) then
begin
MMouse(OBC.x, OBC.y, 4, 4);
if IsUpTextMulti('nk', 'bo', 'ot') then
begin
Mouse(OBC.x, OBC.y, 0, 0, False);
Wait(100);
ChooseOption('uickly');
FFlag(0);
Wait(2000 + Random(500));
if BankScreen or PinScreen then Result := True;
end;
end else
if FindObj(OBC.x, OBC.y, 'ank', 10594993, 19) then
begin
Mouse(OBC.x, OBC.y, 0, 0, False);
Wait(50);
ChooseOption('uickly');
FFlag(0);
Wait(2000 + Random(500));
if BankScreen or PinScreen then Result := True;
end;
ColorToleranceSpeed(Speed);
end;

{************************************************* ******************************
function OpenBankFast(Location: String): Boolean;
By: Wizzup? and Nielsie95
Description: Opens the bank.
Valid arguments are:
'akb', 'al kharid', 'lb', 'lumbridge', 'veb', 'varrock east', 'vwb',
'varrock west', 'feb', 'falador east', 'fwb', 'falador west', 'db', 'draynor',
'eb', 'edgeville bank'
************************************************** *****************************}

function OpenBankFast(Location: String): Boolean;
var
x, y, i, l, c, z: Integer;
Info: TIntegerArray;
Booths, t: TPointArray;
begin
Wait(400);
case LowerCase(Location) of
'akb', 'al kharid': Info := [130, 180, 606291, 4, 1];
'lb', 'lumbridge': Info := [270, 100, 6196388, 9, 1];
'veb', 'varrock east': Info := [200, 290, 2971236, 10, 1];
'vwb', 'varrock west': Info := [270, 270, 5689318, 25, 1];
'feb', 'falador east': Info := [220, 260, 4612728, 14, 1];
'fwb', 'falador west': Info := [300, 300, 4612728, 14, 1];
'db', 'draynor': Info := [175, 145, 605006, 4, 1];
'eb', 'edgeville bank': Info := [302, 161, 3032917, 9, 2];
else
begin
WriteLn('Unknown bank: '+Location);
Exit;
end;
end;

MakeCompass('n');
If Info[4] <> GetColorToleranceSpeed Then
Begin
z := GetColorToleranceSpeed;
ColorToleranceSpeed(Info[4]);
End;
FindColorsSpiralTolerance(Info[0], Info[1], Booths, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3])
SetArrayLength(t, 0);
t := Booths;
SetArrayLength(Booths, 0);
Booths := ReArrangeAndShortenArray(t, 14);
l := GetArrayLength(Booths) -1;
for i := 0 to l do
begin
If not LoggedIn then
Begin
Result := False;
ColorToleranceSpeed(z);
Exit;
End;
Wait(100);
if (LowerCase(Location) = 'vwb') or (LowerCase(Location) = 'varrock west') then
begin
Booths[i].X := Booths[i].X + 5;
Booths[i].Y := Booths[i].Y - 20;
end;
MMouse(Booths[i].X, Booths[i].Y, 0, 0);
Wait(150);
if IsUpText('ooth') Then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(100);
if ChooseOption('uickly') then
begin
FFLag(0);
MarkTime(c);
repeat
Wait(100);
until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 3000);
Result := BankScreen or PinScreen;
if Result then
Begin
ColorToleranceSpeed(z);
Exit;
End;
end;
end;
end;
end;

{************************************************* ******************************
function OpenBank(WhichBank: String, ChangeCompass, ChangeAngle: Boolean): Boolean;
by: SRL Development Team
Description: Opens the bank if possible.
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
'lb' (Lumbridge Bank)
************************************************** *****************************}

function OpenBank(WhichBank: String; ChangeCompass, ChangeAngle: Boolean): Boolean;
begin
if not BankScreen then
begin
Result := True;
if LowerCase(WhichBank) <> 'eb' then
if OpenBankFast(WhichBank) then Exit;
if LowerCase(WhichBank) <> 'lb' then
begin
if (Random(11) > 5) then
begin
if not OpenBankGlass(WhichBank, ChangeCompass, ChangeAngle) then
if not OpenBankQuiet(WhichBank) then
Result := False;
end else
begin
if not OpenBankQuiet(WhichBank) then
if not OpenBankGlass(WhichBank, ChangeCompass, ChangeAngle) then
Result := False;
end;
if not Result then
if FindBank(WhichBank) then
Result := True;
end;
end else
Result := True;
end;

Just copy this into your Bank.scar.

If it still doesn't work, Redownload SCAR Divi 3.12c and get Subversion repository and get SRL from there.

-Knives