Log in

View Full Version : error [globals.scar]



Sgt Soul
12-30-2010, 11:20 PM
[Error] C:\Program Files\Simba\Includes\SRL/SRL/core/globals.scar(401:1): 'BEGIN' expected at line 400
Compiling failed.

After updating SRL to revision 671 I get this error on every script, does anyone know how to fix this?

many thanks,
Sgt Soul

Frement
12-30-2010, 11:25 PM
One extra end; line, will be fixed ASAP.

Her0n
12-31-2010, 02:42 AM
Edit: heh, whoop; changing that extra line worked. Sorry for teh spam.

KingKong
12-31-2010, 03:35 AM
Just deleting the end worked for me.

Intruder
12-31-2010, 04:14 AM
I'm getting the same error but simply deleting the line doesn't work for me. Any suggestions? Thanks!

KingKong
12-31-2010, 04:17 AM
did u delete the orange line end?

Her0n
12-31-2010, 05:09 AM
Better question, did you save it? ;)

Frement
12-31-2010, 05:16 AM
The error should be gone when you update SRL.

0UT2K1LL
12-31-2010, 05:37 AM
The error should be gone when you update SRL.

I still get the same after the update:

No SRL update / Plugins update available!
No Reflection update
[Error] C:\Simba\Includes\SRL/SRL/core/globals.scar(401:1): 'BEGIN' expected at line 400
Compiling failed.

Sgt Soul
12-31-2010, 05:37 AM
I had to use someone elses globals.scar for all my scripts to work again because the update didn't do anything for mine :/ if this is the case for anyone else maybe you should get a globals.scar from someone else which currnetly has a working one :)

Her0n
12-31-2010, 05:40 AM
Just delete the end; at line 400 and save global.scar

KingKong
12-31-2010, 05:45 AM
if anyone is still has problems then replace this with your globals.scar:

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ? Global Variables --//
//-----------------------------------------------------------------//
// * procedure LoadSRLBitMaps; // by SRL Dev Team
// * procedure FreeSRLBitMaps; // by Ron
// * procedure LoadSRLFonts; // by Markus
// * procedure FreeSRLFonts; // by Markus
// * procedure srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer); // by SRL Dev Team
// * procedure SetupBoxes; // by the SRL Dev Team & MylesMadness
// * function srl_InFight: Boolean; // by Frement

{ const SRLVersionNumber;
Description: Repository Version Number. }
const
SRLVersionNumber = 38;

{ var TalkAfterRandoms: Boolean;
Description: Talk random phrases after randoms are detected/solved. }
var
TalkAfterRandoms: Boolean;

{ var FriendChars, LoginChars: Integer;
Description: Fonts used internally and for use in scripts. }
{$IFDEF LoadExtraFonts}
var
FriendChars, LoginChars: Integer;
{$ENDIF}

{var Fontpath,includepath : string;
Description: Path to the font folder and include folder}
{$IFNDEF Simba}
var
FontPath, IncludePath : string;
{$ENDIF}

{ var bmpAdmin, bmpMod, Lamp, BoxMask: Integer;
Description: Global Bitmaps. Need to be Global because of SCAR Memory leaks. }
var
bmpAdmin, bmpMod, Lamp: Integer;

{ var RoadColor, WaterColor, BankColor: Integer;
Description: Three variables you will almost always use. :) }
var
RoadColor, WaterColor, BankColor: Integer;

{ var LampSkill: String;
Description: Set Lamp skill. }
var
LampSkill: string;

{ var NPCChars, UpChars, SmallChars, StatChars, FriendChars, BigChars, LoginChars: LongInt;
Description: All the fonts for SCAR 3.25 and newer }
{$IFDEF SCAR325_UP}
var
NPCChars, UpChars, SmallChars, StatChars, FriendChars, BigChars, LoginChars: LongInt;
{$ENDIF}
{$IFNDEF Simba}
var
XPChars: LongInt;
{$ENDIF}

{ const srl_outline_black
Description: Black Color outline}
const
srl_outline_black = 131072;
srl_outline_white = clWhite;

{ const MMX1, MMY1, MMX2, MMY2;
Description: MiniMap Edge Points. }
const
MMX1 = 550;
MMY1 = 8;
MMX2 = 703;
MMY2 = 161;

{ const MMCX, MMCY;
Description: MiniMap Centre Point. }
const
MMCX = 627;
MMCY = 85;

{ const MSX1, MSY1, MSX2, MSY2;
Description: Main Screen EdgePoints. }
const
MSX1 = 4;
MSY1 = 4;
MSX2 = 515;
MSY2 = 337;

{ const MSCX, MSCY;
Description: Main Screen Centre Points. }
const
MSCX = 259;
MSCY = 170;

{ const MIX1, MIY1, MIX2, MIY2;
Description: Inventory EdgePoints. }
const
MIX1 = 547;
MIY1 = 202;
MIX2 = 737;
MIY2 = 466;

{ const MICX, MICY;
Description: Inventory Centre Points. }
const
MICX = 642;
MICY = 334;

{ const MCX1, MCY1, MCX2, MCY2;
Description: Chat Screen EdgePoints. }
const
MCX1 = 4;
MCY1 = 342;
MCX2 = 514;
MCY2 = 475;

{ const MCCX, MCCY;
Description: Chat Screen Centre Points. }
const
MCCX = 250;
MCCY = 401;

{ const MBX1, MBY1, MBX2, MBY2;
Description: BankScreen EdgePoints (where you click the items, does not include tabs). }
const
MBX1 = 26;
MBY1 = 84;
MBX2 = 480;
MBY2 = 292;

{ const DBX1, DBY1, DBX2, DBY2;
Description: Deposit box edgepoints (only where the item appear) }
const
DBX1 = 91;
DBY1 = 57;
DBX2 = 443;
DBY2 = 262;

{ const SRL_Procs Constants;
Description: Constants for SRL_Procs. }
const
srl_AntiBan = 0; // Your AntiBan procedure to be called during various SRL functions and procedures. (Flag, FFlag)
srl_OnFindMod = 1; // After a player or Jagex mod is detected talking in the chat box.
srl_OnFindDead = 2; // After the text 'Oh dear you are dead' is detected.
srl_OnFindFight = 3; // After detecting a fighting random.
srl_OnFindTrade = 4; // After the trade has been attempted (either success or failure).
srl_OnNextPlayer = 5; // While the players are logged out and before CurrentPlayer changes.
srl_OnSendStats = 6; // After SRL Script Stats are sent to the server.
srl_OnRandomCall = 7; // Called in FindNormalRandoms, FindInventoryRandoms, FindNonInventoryRandoms. (NOT ONLY WHEN RANDOMS ARE DETECTED).
srl_OnFindRandom = 8; // After a random event is detected. (FNR, FIR, FNIR, FT)
srl_OnLogOut = 9; // Just before the player is logged out.
srl_InNextPlayerLoop = 10; // During the infinite loop in NextPlayer when all players are inactive.
srl_OnCustomRC = 11; // When custom RC trigger has been given.
srl_OnExitToLobby = 12; // On exit to lobby
srl_OnLogIn = 13; // Right after player has successfully logged in.

{ var SRL_Procs: array [0..12] of procedure();
Description: Varibles to store user-defined procs to be called in SRL. }
var
SRL_Procs: array [0..13] of procedure();
SRL_OnFindRandomCall : function(var Cont : boolean) : boolean;

{ const GameTab Constants;
Description: Constants representing gametab numbers. }
const
tab_Combat = 21;
tab_Diary = 22;
tab_Task = 22;
tab_Stats = 23;
tab_Quest = 24;
tab_Inv = 25;
tab_Equip = 26;
tab_Prayer = 27;
tab_Magic = 28;
tab_Objectives = 29;
tab_Friends = 30;
tab_Ignore = 31;
tab_Clan = 32;
tab_Options = 33;
tab_Emotes = 34;
tab_Music = 35;
tab_Notes = 36;
tab_LogOut = 37;

{ type TAutoColorInfo;
Description: Set of information that can be used in some functions. }
type
TAutoColorInfo = record
Name: string;
Color: Integer;
ColorArray: TIntegerArray;
MinCount: Integer;
MaxCount: Integer;
MaxDist: Integer;
MaxDistCenter: Integer;
UpText: string;
UpTextMulti: TStringArray;
HueMod, SatMod: Extended;
LumTol: Integer;
MinR, MaxR, MinG, MaxG, MinB, MaxB: Integer;
MinX, MaxX, MinY, MaxY, MinZ, MaxZ: Extended;
end;

{ type fnct_ActionOptions;
Description: Action options. }
type
fnct_ActionOptions = (ClickLeft,ClickRight,Move,Nothing);

var
{ var ACArr
Description: Stores the information needed for the autocolour functions }
acArr: array of TAutoColorInfo;

{ var isACLoaded
Description: Boolean array to make sure that all TAutoColorInfos are loaded
prior to calling. Optimizes AutoColors significantly }
isACLoaded: array of Boolean;

{ var Smart_Server: Integer;
Description: Smart Server to Load. }
var
Smart_Server: Integer;

{ var Smart_Members, Smart_Signed, Smart_SuperDetail: Boolean
Description: Smart Options to Load. }
var
Smart_Members, Smart_Signed, Smart_SuperDetail: Boolean;

{ var WarnSensitivity: Integer
Description: var for srl_Warn. }
var
WarnSensitivity: Integer; //-2 will show Warnings and above, -3 notices too.

{ const srl_Warn Constants;
Description: Constants for srl_Warn. }
const
warn_AllVersions = 0;
warn_Terminate = -1;
warn_Warning = -2;
warn_Notice = -3;
warn_Debug = -4;

{var SRLBitmapsLoaded : boolean;
Description: True if SRL bmps/DTMs are loaded}
var
SRLBitmapsLoaded : boolean;

//************************************************** **************************//
// * I tried to make these Bitmaps Local, but I got after a couple of hours
// * running scripts, CTB and DB handle errors. So sorry, declared them global
//************************************************** **************************//

{************************************************* ******************************
procedure LoadSRLBitMaps;
By: SRL Dev Team
Description: Loads SRL Bitmaps into memory.
************************************************** *****************************}
procedure LoadSRLBitMaps;
begin
bmpMod := BitmapFromString(9, 6, 'beNqbPn0RWeDBgwdAkgEMkBnT' +
'p0+HS6GR+KVwAgAGXFQr');
bmpAdmin := BitmapFromString(9, 6, 'beNqbp/j9PwcZ6P//FiDJAA' +
'bIjGvzFOFSaCR+KZwIALniVEk=');
Lamp := DTMFromString('78DA63946060601062400153A78832F0036 94' +
'620FE0F048C02986A181898C0242394C7280A24F808A89103 1202' +
'04D4A801096122EC12C7AF060054C60662');
SRLBitmapsLoaded := True;
{$IFDEF SIMBA}
SetBitmapName(bmpMod,'SRL - Mod bitmap');
SetBitmapName(bmpAdmin,'SRL - Admin bitmap');
SetDTMName(Lamp,'SRL - Lamp bitmap');
{$ENDIF}
end;

{************************************************* ******************************
procedure FreeSRLBitMaps;
By: Ron
Description: Frees SRL Bitmaps from memory.
************************************************** *****************************}
procedure FreeSRLBitmaps;
begin
if SRLBitmapsLoaded then
begin
FreeBitmap(bmpMod);
FreeBitmap(bmpAdmin);
FreeDTM(Lamp);
SRLBitmapsLoaded := False;
end;
end;

{************************************************* ******************************
procedure LoadSRLFonts;
By: Markus
Description: Loads SRL Fonts into memory.
************************************************** *****************************}
procedure LoadSRLFonts;
begin
{$IFDEF LoadExtraFonts}
FriendChars := LoadChars2(FontPath + 'FriendChars/');
LoginChars := LoadChars2(FontPath + 'LoginChars/');
{$ENDIF}
end;

{************************************************* ******************************
procedure FreeSRLFonts;
By: Markus
Description: Frees SRL Fonts from memory.
************************************************** *****************************}
procedure FreeSRLFonts;
begin
{$IFDEF LoadExtraFonts}
FreeChars2(FriendChars);
FreeChars2(LoginChars);
{$ENDIF}
end;

{************************************************* ******************************
procedure srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer);
by: SRL Dev Team
Description: WriteLn's a warning message.
************************************************** *****************************}
procedure srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer);
begin
if (wVersion > WarnSensitivity) then
if (wVersion <> warn_Debug) then
WriteLn('** Warning in ' + ProcName + ': ' + ErrorMessage + '**')
else
WriteLn('Debugging ' + ProcName + ': ' + ErrorMessage);
if wVersion = -1 then
TerminateScript;
end;

{ MainScreen, Minimap, Inventory, Chat, Bank boxes as TBox }
var
MSBox, MMBox, MIBox, MCBox, MBBox: TBox;

{************************************************* ******************************
Procedure SetupBoxes;
by: SRL Dev Team & MylesMadness
Description: Sets up Box variables
************************************************** *****************************}
Procedure SetupBoxes;
begin
MSBox := IntToBox(MSX1, MSY1, MSX2, MSY2);
MMBox := IntToBox(MMX1, MMY1, MMX2, MMY2);
MIBox := IntToBox(MIX1, MIY1, MIX2, MIY2);
MCBox := IntToBox(MCX1, MCY1, MCX2, MCY2);
MBBox := IntToBox(MBX1, MBY1, MBX2, MBY2);
end;


{ const HP_BAR constants;
Global contants storing width, height and tolerance for HP bars.
Used in srl_InFight. }
const
HP_BAR_TOL = 3;
HP_BAR_WIDTH = 57;
HP_BAR_HEIGHT = 7;

{************************************************* ******************************
function srl_InFight: Boolean;
By: Frement
Description: Checks whether player currently is in a fight, using mainscreen
HP bar presence detection. Returns True if Player's HP bar is detected.
************************************************** *****************************}
function srl_InFight: Boolean;
var
I, C, HP_BAR_MIN, HP_BAR_MAX: Integer;
HP_BAR_GREEN, HP_BAR_RED, HP_BAR_HITS: TIntegerArray;
Colors: T2DIntegerArray;
TPA1, TPA2: TPointArray;
ATPA: T2DPointArray;
begin
HP_BAR_GREEN := [49499, 52611, 51081, 52641, 47667];
HP_BAR_RED := [590010, 590002, 131211, 524453, 594402];
HP_BAR_HITS := [789660, 1325811, 13865994, 1320341, 16294162,
12937740, 14185741, 4297620];
HP_BAR_MIN := HP_BAR_WIDTH * HP_BAR_HEIGHT div 10 - HP_BAR_TOL;
HP_BAR_MAX := HP_BAR_WIDTH * HP_BAR_HEIGHT * 3 div 2 + HP_BAR_TOL;

Colors := [HP_BAR_GREEN, HP_BAR_RED, HP_BAR_HITS];
for I := 0 to High(Colors) do
for C := 0 to High(Colors[I]) do
begin
FindColorsTolerance(TPA1, Colors[I][C],
MSCX - 30, MSCY - 120, MSCX + 30, MSCY + 20, 30);
TPA2 := CombineTPA(TPA1, TPA2);
end;

ATPA := TPAToATPAEx(TPA2, HP_BAR_WIDTH, HP_BAR_HEIGHT);
for I := 0 to High(ATPA) do
if (InRange(GetArrayLength(ATPA[I]), HP_BAR_MIN + 100, (HP_BAR_MAX * 2) + 400)) then
begin
Result := True;
Exit;
end;
end;

EvilChicken!
12-31-2010, 02:15 PM
Guys, I'm really sorry for this stress I've caused, I didn't compile and overlooked that extra begin, really dumb of me to not compile before committing, I know.

Nevertheless, I got notified of this and fixed it in the next update, which should have been issued maximum of 15 minutes after the previous one; so as long as you update your SRL files like you normally would, everything should be fine.

Again, I'm sorry for this, just goes to show how I haven't committed anything in ages. :(

Valithor
12-31-2010, 06:33 PM
Hey guys,

So... I was trying to run some scripts like 5 minutes ago (some of them being my own creation), but I ran across this globals.scar error. I've tried all the above-stated solutions, but I get another error.


[Error] (1:1): Unexpected end of file at line 0
Compiling failed.

Being completely new to scripting... this makes no sense. Any ideas on now to fix this?

Thanks,
~Val

EvilChicken!
12-31-2010, 07:38 PM
Hey guys,

So... I was trying to run some scripts like 5 minutes ago (some of them being my own creation), but I ran across this globals.scar error. I've tried all the above-stated solutions, but I get another error.



Being completely new to scripting... this makes no sense. Any ideas on now to fix this?

Thanks,
~Val

As said, update your SRL includes again.
In the leftmost entry of Simba's main menu (entitled "SRL") click "Update SRL" and press accept on any and all dialog boxes that might pop up.

Valithor
12-31-2010, 09:02 PM
I searched for SRL updates, but it says there is nothing to update. I've also tried deleting the "end;" at line 400, but the problem still persists. It tells me that it "ends unexpectly" at line 0. Then I tried thing that kingkong suggested, but it also tells me that...


[Error] (1:1): Unexpected end of file at line 0
Compiling failed.

EvilChicken!
12-31-2010, 09:39 PM
I searched for SRL updates, but it says there is nothing to update. I've also tried deleting the "end;" at line 400, but the problem still persists. It tells me that it "ends unexpectly" at line 0. Then I tried thing that kingkong suggested, but it also tells me that...

Weird.
Delete your SRL folder and run the update again.
If the problem persists, uninstall Simba and re-install it. (from wizzup.org/simba (www.wizzup.org/simba).)

If the problem still persists, add me on MSN and I'll see what I can do.

Valithor
01-01-2011, 12:51 AM
Weird.

haha. No doubt, but anyway, I couldn't figure out how to delete JUST the SRL file while feeling completely confident in myself. So I found it easier to re-install Simba, but at least it works! :) Thanks Evilchicken!

EvilChicken!
01-01-2011, 12:59 AM
Very glad to hear it worked. :)

Frement
01-01-2011, 01:13 AM
http://www.frement.net/srl/dev.png'

wtf is that sht i nhave menver sieeen stufff like that beofre

Frement
01-01-2011, 01:16 AM
http://www.frement.net/srl/dev2.png
wtf is thatt i have never seen and i ame from bar and i see and im like wtf

Frement
01-01-2011, 01:17 AM
do ui imagine it or is this real, an u guys see it in the cpitures

EvilChicken!
01-01-2011, 01:18 AM
'wtf is that sht i nhave menver sieeen stufff like that beofre


Jens - sier (23:41):
Fre!
Jens - sier (23:42):
>:
Frement sier (02:08):
yo
sup?
im drunk
Jens - sier (02:08):
Why does everyone have to get drunk today.. What makes new year's eve such a special day to get drunk?
Frement sier (02:09):
wtf is developer console
letm ne tkae screenshot
Jens - sier (02:10):
I was just wondering, I'm making a SRL sig generator, and I was wondering, what size should I have the sigs?
Frement sier (02:10):
http://www.frement.net/srl/dev.png
Jens - sier (02:10):
Damn, nice.
Frement sier (02:10):
wtf is that
Jens - sier (02:10):
I remember some post about something similar to that.
Frement sier (02:11):
wtf uis htta
Jens - sier (02:11):
Post it on Villavu.
How did you open it?
Frement sier (02:11):
tim so drunk i cant think
i dont know
im drunkaskd
im on the computer from bar and i see tyaht and aim like wathf +
Jens - sier (02:11):
What size should I have the signatures?
Frement sier (02:11):
could u post it vevbecause im like not in the mood
ko real+y wait for that jim nklt drunk
Jens - sier (02:12):
Hahahah.
Frement sier (02:12):
im gonna gon for a smokee
Jens - sier (02:12):
GLHF. :3
Frement sier (02:12):
9 love uy jman
Jens - sier (02:12):
You probably do.
Frement sier (02:12):
what
Jens - sier (02:12):
Am I supposed to say something nice back?
Frement sier (02:13):
flor what
Jens - sier (02:13):
x) nevermind.
Frement sier (02:13):
i postefd on villavuuf
Jens - sier (02:14):
Dude, you just made me laugh out loud.
Frement sier (02:15):
http7:ww/wfrement.net/srl/dev2.png
wtwtf is that shit

Fre is drunk and on MSN.
I can't stop laughing.

Frement
01-01-2011, 01:33 AM
dontm aek fun of me

Zyt3x
01-01-2011, 01:54 AM
fre is drumk as hell :9

mburns95
02-13-2012, 03:48 AM
This is what is says when i click run :


The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]


i have no clue how to get it running i have extensions srl.sex and extension.sex and associate.sex enabled someone help me

mburns95
02-13-2012, 11:31 PM
I get this error and its pissing me off!

someone help me please.

This is error:

The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

:spongebob: