SRL Archive - Help and Support

Identifier Expected! (>.<)


Brad

2006-04-30 22:13:26

I am extremely agrivated, I have tried everything to my knowledge, which is small in SCAR, to fix this! Gah someone please tell me why this occours(sp?):

Failed when compiling
[Error] (10904:4): Identifier expected

Program SRL;
{.include SRL/SRL.scar}

Const
AlreadyLoggedIn = True;// If your already logged into SRL.

Var Opera, NewPage, Tab, SRL, YellowLogin : integer;

Function OperaIsOpen : Boolean;
Begin
If(findcolor(x, y, 2960573, 0, 2, 19, 20))Then
Begin
Result := True
End
Else
Result := False;
End;


Procedure OpenOpera;
Begin
Opera := DTMFromString('78DA632C60606058C9800236884B826946289' +
'F3117486C4255734B5F1F554D1E90D881AA661D9F008A1A007EE5' +
'0649');
If(FindDTM(Opera, x, y, 96, 161, 133, 199))Then
begin
Writeln('<---------->');
Writeln('Found Opera!');
Writeln('<---------->');
Mouse(x, y, 1, 1, True);// This mouse
Wait(100); // v
Mouse(x, y, 1, 1, True)// and this mouse double clicks Opera.
end
Else
MarkTime(Mark)
Repeat
Wait(1000);
Until(TimeFromMark(Mark) > 10000)
If(OperaIsOpen = False)Then
Begin
Writeln('Opera still doesnt work after waiting, sorry bud :|')
Writeln('Terminating script :(')
TerminateScript;
End
End;

Procedure OpenPage;
Begin
NewPage := DTMFromString('78DA63E4656060B06240019FDE5D06D38C503' +
'EA33090304355F3FDF315543520734C51D57CFEFC19450D00DBDD' +
'0923');
Repeat
Wait(500);
Until(OperaIsopen = True);
If(FindDTM(NewPage, x, y, 10, 50, 27, 68))Then
begin
Writeln('<---------------------->');
Writeln('Found "New page" button!')
Writeln('<---------------------->');
Mouse(x, y, 1, 1, True)
Wait(100)
end
Else
Wait(1000);
If(not(Findcolor(x, y, 12550987, 91, 51, 263, 72)))Then
Begin
Writeln('New page did not open :(');
Writeln('Terminating script :(');
TerminateScript;
End;
End;

Procedure GetToSRL;
Begin
Tab := DTMFromString('78DA63BCCCC0C010CF80022E5C3C0CA619A17' +
'CC64B40220255CDB31BEB51D59C0512B1A86A5EDE5E87AAE63C90' +
'884455F3E9E5311435003DF90E9B');
If(FindDTM(Tab, x, y, 199, 81, 215, 99))Then
Begin
TypeSend('82.92.130.193/forums/')
Writeln('Woot, :)')
End
Else
Writeln('DTM Not found :(')
Writeln('Terminating...')
TerminateScript;
End;

Procedure Welcome;
Begin
SRL := DTMFromString('78DA637461646058C08002F6DD5A0AA619A17' +
'C465F206B2DAA9AC7CF9EA2AA7106B236A0AAB9FBE406AA1A4F20' +
'6B23AA9A67AF9FA0AAF107B266A1AA597DB905558D1590359B801' +
'A37206B06AA9A2517CB50D40000C89A16A5');
If(FindDTM(SRL, x, y, 282, 140, 346, 203))Then
Begin
Writeln('<-------------------->');
Writeln('Welcome to SRL Forums!');
Writeln('<-------------------->')
End
Else
Writeln('Didnt make it to SRL...');
Writeln('...Terminating.');
TerminateScript;
End;

Procedure Login;
Begin
YellowLogin := DTMFromString('78DA63DCC9C4C060CAC8800CBEFDF805A661A' +
'28CFB816A2C51D5FCFFFF1F55CD6EA01A6754356FDEBC41557306' +
'A8C6828039BF816ADC50D56CDE7918450D00FC921318');
If(FindDTM(YellowLogin, x, y, 694, 306, 765, 329))Then
MouseBox(708, 313, 755, 321, 1);





Begin
OpenOpera;
OpenPage;
GetToSRL;
If(AlreadyLoggedIn = False)Then
Welcome
Else
If(AlreadyLoggedIn = True)Then
Login;
End.

Pwnd

2006-04-30 22:15:21

I can tell that right off you're missing an end; on your login procedure.

driger1592

2006-04-30 22:19:40

I read the rest of the script and there's nothing else wrong. I copied your script into SCAR and put the end in at the end of the login procedure and it fixes it right up ;)

Brad

2006-04-30 22:36:49

I love you :) … Jk, Thanks a lot, I might script for RS soon.

phantombmx

2006-04-30 22:48:47

heres the standardized version as well.. cuz i got a few more errors.. it compiles but i dont have opera.. :p try not to capitalize bolded words except variable types (like String).. capitalize all variable types..

umm besides that, very good script.. as in level of thought put to it!

i added some commentary where i thought you should know the things

program SRL;
{.include SRL/SRL.scar}

const
AlreadyLoggedIn = True;// If your already logged into SRL.

//Don't use global variables if the variable is only used in one function or procedure.
//I have moved them to their respective functions.

function OperaIsOpen : Boolean;
begin
if(findcolor(x, y, 2960573, 0, 2, 19, 20))then
Result := True //I deleted the else thing because a variable is automatically False or 0, depending on the type.
end;


procedure OpenOpera;
var Opera : integer;
begin
Opera := DTMFromString('78DA632C60606058C9800236884B826946289' +
'F3117486C4255734B5F1F554D1E90D881AA661D9F008A1A007EE5' +
'0649');
if(FindDTM(Opera, x, y, 96, 161, 133, 199))then
begin
Writeln('<---------->');
Writeln('Found Opera!');
Writeln('<---------->');
Mouse(x, y, 1, 1, True);// This mouse
Wait(100); // v
Mouse(x, y, 1, 1, True) // and this mouse double clicks Opera.
end else //Use end else if the else part is more than one thing to do
begin
MarkTime(Mark)
repeat
Wait(1000);
until(TimeFromMark(Mark) >= 10000)
if(not(OperaIsOpen))then
begin
Writeln('Opera still doesnt work after waiting, sorry bud :|')
Writeln('Terminating script :(')
TerminateScript;
end;
end;
end;

procedure OpenPage;
var NewPage : integer;
begin
NewPage := DTMFromString('78DA63E4656060B06240019FDE5D06D38C503' +
'EA33090304355F3FDF315543520734C51D57CFEFC19450D00DBDD' +
'0923');
repeat
Wait(500);
until(OperaIsopen);
if(FindDTM(NewPage, x, y, 10, 50, 27, 68))then
begin
Writeln('<---------------------->');
Writeln('Found "New page" button!');
Writeln('<---------------------->');
Mouse(x, y, 1, 1, True);
Wait(100);
end else
begin
Wait(1000);
if(not(Findcolor(x, y, 12550987, 91, 51, 263, 72)))then
begin
Writeln('New page did not open :(');
Writeln('Terminating script :(');
TerminateScript;
end;
end;
end;

procedure GetToSRL;
var Tab : integer;
begin
Tab := DTMFromString('78DA63BCCCC0C010CF80022E5C3C0CA619A17' +
'CC64B40220255CDB31BEB51D59C0512B1A86A5EDE5E87AAE63C90' +
'884455F3E9E5311435003DF90E9B');
if(FindDTM(Tab, x, y, 199, 81, 215, 99))then
begin
TypeSend('82.92.130.193/forums/');
Writeln('Woot, :)');
end else
begin
Writeln('DTM Not found :(');
Writeln('Terminating...');
TerminateScript;
end;
end;

procedure Welcome;
var SRL : integer;
begin
SRL := DTMFromString('78DA637461646058C08002F6DD5A0AA619A17' +
'C465F206B2DAA9AC7CF9EA2AA7106B236A0AAB9FBE406AA1A4F20' +
'6B23AA9A67AF9FA0AAF107B266A1AA597DB905558D1590359B801' +
'A37206B06AA9A2517CB50D40000C89A16A5');
if(FindDTM(SRL, x, y, 282, 140, 346, 203))then
begin
Writeln('<-------------------->');
Writeln('Welcome to SRL Forums!');
Writeln('<-------------------->');
end else
begin
Writeln('Didnt make it to SRL...');
Writeln('...Terminating.');
TerminateScript;
end;
end;

procedure Login;
var YellowLogin : integer;
begin
YellowLogin := DTMFromString('78DA63DCC9C4C060CAC8800CBEFDF805A661A' +
'28CFB816A2C51D5FCFFFF1F55CD6EA01A6754356FDEBC41557306' +
'A8C6828039BF816ADC50D56CDE7918450D00FC921318');
if(FindDTM(YellowLogin, x, y, 694, 306, 765, 329))then
MouseBox(708, 313, 755, 321, 1);
end;

begin
SetupSRL; //Make sure this is in every script using SRL.
ActivateClient; //Makes the client "focused".
OpenOpera;
OpenPage;
GetToSRL;
if(AlreadyLoggedIn)then Login else Welcome; //Make sure it is if(condition)then procedure/function else procedure/function;
end.