SRL Archive - Help and Support

Error


WhoCares357

2007-05-26 16:32:56

For my alcher, I wanted to include the SRL function, FindLamp, and add something to it. I renamed the function FindLampEx (and gave all credits ;) ). However, once I tried to run the script, I got an error:

Line 528: [Error] (14874:1): Identifier expected in script

This is the procedure:
{/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\}
{ Edited FindLamp }
{\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////}

function FindLampEx(skill: string): Boolean; //Starblaster + Pups
var
LampTime: Integer;
begin
GameTab(4);
if FindColorTolerance(x, y, 1488053, 550, 200, 745, 465, 25) then
begin
Mouse(90, 441, 15, 3, true); //Only line that I added (only thing edited)
if (FindBitmapSpiralTolerance(Lamp, x, y, 550, 200, 745, 465, 25)) then
begin
Result := True;
if (Screenshots) then
SaveScreenshot('Lamp Random - Stupid3ooo - ' + TimeRunning + '.bmp');
WriteLn('******** SOLVED LAMP RANDOM ********');
WriteFileString(TheFile, '******** SOLVED LAMP RANDOM ********' + Chr(13))
Lamps := Lamps + 1;
Players[CurrentPlayer].Rand := 'Lamp';
Mouse(x, y, 1, 1, True);
Wait(1500 + Random(500));
MarkTime(LampTime);
repeat
case (LowerCase(Skill)) of
'strength': Mouse(191, 134, 12, 12, True);
'attack': Mouse(222, 136, 12, 12, True);
'ranged': Mouse(256, 134, 12, 12, True);
'magic': Mouse(289, 135, 12, 12, True);
'defence': Mouse(319, 136, 12, 12, True);
'hitpoints', 'hp': Mouse(176, 166, 12, 12, True);
'prayer', 'pray': Mouse(208, 163, 12, 12, True);
'agility': Mouse(239, 165, 12, 12, True);
'herblore': Mouse(271, 165, 12, 12, True);
'thieving', 'thief': Mouse(303, 164, 12, 12, True);
'crafting', 'craft': Mouse(335, 164, 12, 12, True);
'runecraft', 'runecrafting': Mouse(174, 193, 12, 12, True);
'slayer', 'slay': Mouse(205, 195, 12, 12, True);
'farming', 'farm': Mouse(239, 193, 12, 12, True);
'mining', 'mine': Mouse(270, 194, 12, 12, True);
'smithing', 'smith': Mouse(302, 194, 12, 12, True);
'fishing', 'fish': Mouse(334, 192, 12, 12, True);
'cooking', 'cook': Mouse(173, 220, 12, 12, True);
'firemaking', 'fire': Mouse(206, 220, 12, 12, True);
'woodcutting', 'wc': Mouse(240, 220, 12, 12, True);
'fletching', 'fletch': Mouse(274, 220, 12, 12, True);
'construction': Mouse(303, 220, 12, 12, True);
'hunting','hunt': Mouse(335, 220, 12, 12, True);
end;
Wait(500 + Random(200) + Random(100));
if (TimeFromMark(LampTime) > 30000) then
begin
Logout;
Exit;
end;
until (FindColorTolerance(x, y, 2303647, 155, 117, 370, 250, 0));
Mouse(261, 277, 1, 1, True);
Wait(500 + Random(150) + Random(150));
end;
end;
end;

Line 528 is the line that has "var" on it. It's the line after the function name.

Bebe

2007-05-26 16:36:10

What line is 528?

Edit: nvm I saw that you posted it.

Most of the time, it isn't that line, look around and make sure your command statments are correct.
Try looking at the procedure/function above this one.

Pentti

2007-05-26 16:38:18

You know what, I think it's not line 528, I had same error and the actual error line wasn't even near the line it told me.
I was missing end; from somewhere.

check out your begins/ends repeats/untils etc.

Hey, check out the procedure/function before FindLampEx, you may have missed an end;

WhoCares357

2007-05-26 16:53:56

Thanks guys. If I find a fix I'll post.

WhoCares357

2007-05-26 16:56:03

Ok. I forgot to end the case in the procedure above. Thanks mucho guys.

JAD

2007-05-26 16:59:52

From: WhoCares357
Ok. I forgot to end the case in the procedure above. Thanks mucho guys.


Thats what my tut for fixing errors is for! lol :p

Pentti

2007-05-26 17:07:22

From: WhoCares357
Ok. I forgot to end the case in the procedure above. Thanks mucho guys.

Lol, I told you. :D

JAD

2007-05-26 17:12:26

From: Pentti
Lol, I told you. :D


So did my Tutorial if you would have read it! lol.