Forgot "Of" on line 14 of your procedure.
Case..Of needs to be ended, just like a begin..end;.
You also put some unneeded begin..end;s in there.
Fixed & Cleaned up:
SCAR Code:
procedure Talk;
begin
if (InChat('Hey') or
InChat('What''s up') or
InChat('What up') or
InChat('Sup') or
InChat('Yo')) then
begin
TypeSend('Trying to read');
Case Random(10) of
0: TypeSend('Attack lvls?');
1: TypeSend('Str lvls?');
2: TypeSend('Defence levels?');
end;
end;
end;
I see your making an AutoResponder, and I also see you're making the same mistake I did when I tried doing that. Lemme explain.
InChat first makes a bitmap mask of the text you request to be checked for. Bitmaps tend to lag, especially if you're searching for that many, in such a small amount of time. It would cut down on lag a lot if you do something like this:
SCAR Code:
procedure Talk;
var
LastMessage: String;
begin
GetLastChatText(LastMessage);
if ((Pos('Hey', LastMessage) <> 0) or
(Pos('What''s up', LastMessage) <> 0) or
(Pos('What up', LastMessage) <> 0) or
(Pos('Sup', LastMessage) <> 0) or
(Pos('Yo', LastMessage) <> 0)) then
begin
TypeSend('Trying to read'); // Btw, What's this?
Case Random(10) of
0: TypeSend('Attack lvls?');
1: TypeSend('Str lvls?');
2: TypeSend('Defence levels?');
end;
end;
end;
That saves the last chat message, into a variable, and checks the string like that. It's a lot faster than searching for so many bitmaps like you had before.