SCAR Code:
var HowManyResponses, ChatTimer: Integer; Question, Response: Array of TStringArray;
Procedure SetResponderArr;
begin
HowManyResponses := 4;
SetLength(Question, HowManyResponses);
SetLength(Response, HowManyResponses);
Question[0] := ['Hi', 'Hello', 'Hey', 'Sup', 'Howdy', 'Hiya'];
Response[0] := ['Hi', 'Hello', 'Hey', 'Sup', 'Howdy', 'Hiya','Hi there'];
Question[1] := ['Lol', 'Rofl', 'Lawl', 'Haha', 'funny', 'Lmao', 'Lmfao'];
Response[1] := ['Lol', 'Rofl', 'Lawl', 'Haha', 'funny', 'Lmao', 'Lmfao'];
Question[2] := ['noob', 'Nub', 'N00b', 'Nooblet'];
Response[2] := ['your a noob','loser','go away','sigh...'];
Question[3] := ['macro', 'autoer', 'cheater', 'bot', 'autoing'];
Response[3] := ['lol who?','who me?','haha how?'];
{Question[4] := [];
Response[4] := [];}
end;
Function InChatAr(Text: array of string): Boolean; //Credits to EvilChicken & Nava2
var I, H: integer; s: string;
begin
H := High(Text);
if (not (GetLastChatText(s))) then
LastChatter(s);
for I := 0 to H do
begin
if (Pos(Lowercase(Text[i]), (Lowercase(s))) > 0) then
begin
Result := true;
Exit;
end;
end;
end;
Function Responder: Boolean;
var i, ii, OldMsg, NewMsg: Byte; TexttoType: String;
begin
if not Players[CurrentPlayer].Booleans[1] then Exit;
if (GetSystemTime-ChatTimer < 120000 +RandomRange(-25000, 25000)) then Exit;
for i := 0 to High(Question) do
begin
for ii := 0 to High(Question[i]) do
begin
if InChatAr([Question[i][ii]]) then
begin
NewMsg := i;
if (NewMsg = OldMsg) then Exit;
TextToType := Response[i][Random(High(Response)+1)];
if (TextToType <> '') and (TextToType <> Question[i][ii]) then
TypeSend(TextToType) else Exit;
NewMsg := OldMsg;
ChatTimer := GetSystemTime;
Result := True;
end;
end;
end;
if Result then Inc(Players[CurrentPlayer].Integers[15]);
end;