Log in

View Full Version : Line 17738?



Jason2gs
02-19-2007, 05:36 PM
I'm trying to get my script to work, but I keep getting this error:


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

One thing...

My script is only 72 lines long :p

Some help, please?

Pentti
02-19-2007, 05:38 PM
Can you post your script?

Jason2gs
02-19-2007, 05:42 PM
program AutoResponder;
{.include SRL/SRL.scar}
var
wclevel, minelevel : integer;
procedure AutoRespond;
begin
SetupSRL;

OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;

if OldLine <> NewLine then
if (pos('yo', TheName) <> 0) or (pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
begin
end
else
begin

/////////// AutoRespond Start //////////

"AutoResponder Start" begins the rest of my script is, it's private.

Pentti
02-19-2007, 05:45 PM
program AutoResponder;
{.include SRL/SRL.scar}
var
wclevel, minelevel : integer;
procedure AutoRespond;
begin
SetupSRL;

OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;

if OldLine <> NewLine then
if (pos('yo', TheName) <> 0) or (pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
begin
end
else
begin
end
end;

/////////// AutoRespond Start //////////
begin

end.
Here you go, you were missing one end; . :)
if thats not the place where your procedure ends, then add that end; there, where is the end of your procedure.

Smartzkid
02-19-2007, 05:47 PM
EDIT: nvm

Jason2gs
02-19-2007, 05:50 PM
Thanks Pentti :)

If you don't mind me asking... What sort of script did you turn in to get SRL membership?

Pentti
02-19-2007, 05:52 PM
Umm. my autofighter (http://www.villavu.com/forum/showthread.php?t=4766) version 1 and essence miner (http://www.villavu.com/forum/showthread.php?t=3589) version 1. and some of my antiban stuff...
these were pretty simple. :D

Jason2gs
02-19-2007, 05:54 PM
Cool =)

I'm planning on making a Rune Mysteries Quester to get in. Won't be happing any time soon, though. I still need to learn how to get it to walk the long distances (not very good with RW yet).

Pentti
02-19-2007, 05:58 PM
Rune Mysteries Quester!!! Sound good man! But... I think it's is very very very hard to make... But good luck with it man!

Jason2gs
02-19-2007, 06:04 PM
GRRRR...

I can turn the script on, but whenever I try to say something to check if it will respond to my cyber-voice, it gets a runtime error.


[Runtime Error] : Out Of Range in line 15 in script C:\Program Files\SCAR 2.03\Scripts\AutoResponderAll.scar

Pentti
02-19-2007, 06:15 PM
You must have this in your script procedure DeclarePlayers;

begin
HowManyPlayers:=1;
NumberOfPlayers(0);
CurrentPlayer:=StartPlayer;

Players[0].Name :='Player Name';
Players[0].Pass :='Pass';
Players[0].Nick :='Nick';
Players[0].Active:=True;

NickNameBMP:=CreateBitMapmaskfromtext(Players[CurrentPlayer].Nick,UpChars)
end;
Put DeclarePlayers; after SetUpSRL;

Jason2gs
02-19-2007, 06:26 PM
Kk, lemme try that.

Smartzkid
02-19-2007, 06:29 PM
Hey Pentti, do you think a SRL powercutter would get me accepted? It's not perfect... but it works pretty well...


Jason, if you post the whole script, I wouldn't mind testing it some...

Jason2gs
02-19-2007, 06:35 PM
program AutoResponder;
{.include SRL/SRL.scar}
var
wclevel, minelevel, StartPlayer : integer;
procedure AutoRespond;
begin
SetupSRL;

procedure DeclarePlayers;

begin
HowManyPlayers:=1;
NumberOfPlayers(0);
CurrentPlayer:=StartPlayer;

Players[0].Name :='Nubypkerdude';
Players[0].Pass :='**hidden**';
Players[0].Nick :='ubypker';
Players[0].Active:=True;

NickNameBMP:=CreateBitMapmaskfromtext(Players[CurrentPlayer].Nick,UpChars)
end;

begin

OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;

if OldLine <> NewLine then
if (pos('yo', TheName) <> 0) or (pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
begin
end
else
begin
end

/////////// AutoRespond Start //////////

Getting yet another error =/

Identifier expected.

Pentti
02-19-2007, 06:36 PM
Hey Pentti, do you think a SRL powercutter would get me accepted? It's not perfect... but it works pretty well...

If it includes SRL and it works then you may be lucky and get SRL member status :D. And you should have multiplayers in it.

Pentti
02-19-2007, 06:40 PM
program AutoResponder;
{.include SRL/SRL.scar}
var
wclevel, minelevel, StartPlayer : integer;

procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer:=0;

Players[0].Name :='Nubypkerdude';
Players[0].Pass :='**hidden**';
Players[0].Nick :='ubypker';
Players[0].Active:=True;

NickNameBMP:=CreateBitMapmaskfromtext(Players[CurrentPlayer].Nick,UpChars)
end;
procedure AutoRespond;
begin
begin
OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;

if OldLine <> NewLine then
if (pos('yo', TheName) <> 0) or (pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
begin
end
else
begin
end

end;
end; //Again you forget one end;

/////////// AutoRespond Start //////////

begin //Put mainloop down here between begin and end.
SetUpSRL;
DeclarePlayers;
AutoRespond;
end.

Jason2gs
02-19-2007, 06:46 PM
Alright. I got it to start and everything, but it still doesn't ignore my chat =/

omgh4x0rz
02-20-2007, 12:12 AM
This is what I did for part of mine

There is a probably a better way to do this, but this works for me.

1) I start by searching for the word.
2) If greeting=true then it will respond (i'll explain)
3) If it responded, greeting gets set to False
4) Now, lets say it senses your own response 'hey' right away
5) It then goes to step 2, but greeting=false, so now it doesn't respond to your own statement! Greeting gets set back to true, so then it will start responding again.

Maybe I'm just rambling, but I hope that gives you an idea about how to fix it. Here is the example from how I respond to 'hey' and 'hi'

if (GetChatMessage('hello')) or (GetChatMessage('hey')) or (GetChatMessage('hi')) or //Responds to Greetings
(GetChatMessage('sup')) then
begin
if (Greeting=True) and
(TimeFromMark(ShutUp)>10000)then
begin
writeln('initiating anti-ban responses');
case random(17) of
0: typesend('hey');
1: typesend('sup');
2: typesend('yo');
3: typesend('ey');
4: typesend('hi');
5: typesend('heeelllo');
6: typesend('hello');
6 : typesend('allo allo');
7 : typesend('wat up');
8 : typesend('y0o');
9 : typesend('=P');
10 : typesend('what is up');
11 : typesend('heya');
12 : typesend('howdy');
13 : typesend('bonjour');
14 : typesend('yo yo yo');
15 : typesend('wassuup!');
16 : typesend('im busy');
17 : typesend('cant talk');
end;
MarkTime(ShutUp);
Greeting:=False; //Puts you in shutup mode so you will stop responding (see end of proc)
end;
end else
Greeting:=True;