SCAR Code:
program New;
{.Include SRL/SRL.scar}
Var
Chatters : String; // These are the people who talk to you
Chatted : Integer; // How Many Times You Responded
//----------------------------------------------------------------------------//
//-- Typs a random array of words --//
//----------------------------------------------------------------------------//
Procedure TypeInRandom(Texts : Array Of String);
begin
TypeSend(Texts[Random(GetArrayLength(Texts))]);
end;
//----------------------------------------------------------------------------//
//-- Finds array of words in one string then returns true if found. --//
//----------------------------------------------------------------------------//
Function PosMulti(substr : Array Of String; S: String) : Boolean;
Var
i : Integer;
begin
For i := 0 to GetArrayLength(Substr)-1 do
begin
Result:= (Pos(SubStr[i], S) > 0)
If (Result) then exit;
end;
end;
//----------------------------------------------------------------------------//
//-- counts how many seperaters there are. --//
//----------------------------------------------------------------------------//
Function CountSep(S:String; Seperater:Char) : Integer;
var i:Integer;
begin
for i:= 1 to length(S) do
if (S[i] = Seperater) then
Result:= Result + 1;
end;
//----------------------------------------------------------------------------//
//-- Returns the string in between the seperaters --//
//----------------------------------------------------------------------------//
Function BetweenSep(S:String; Seperater:Char): Array of String;
Var i, ST, c:Integer;
begin
ST:= CountSep(S, Seperater);
If (St > 0 ) Then St:= St + 1;
setarraylength(Result, st);
For i:= 1 to length(s) do
if (S[i] = Seperater ) then C:= c + 1
else
Result[c]:= Result[c] + S[i];
end;
//----------------------------------------------------------------------------//
//-- It Responds only once to each player --//
//-- so if a player ask your mining lvl twice then it only says it once --//
//----------------------------------------------------------------------------//
Procedure SkysResponder;
Var
Chatter, ChatText : String;
Talkers : Array of string;
i : Integer;
begin
If (FindColor(x, y, 16711680, 19, 415, 477, 431)) then
If (LastChatter(Chatter)) then
begin
If (Chatter = LowerCase(Players[CurrentPlayer].Name))then Exit;
GetLastChatText(ChatText);
Talkers := BetweenSep(Chatters, ',');
for i := 0 to GetArrayLength(Talkers)-1 do
If (Trim(Talkers[i]) = Chatter) then exit;
If (PosMulti(['lol', 'lmfao', 'rofal', 'ha '], ChatText)) then
begin
TypeInRandom(['Lol', 'lmfao', ':]', '=]', 'hehe', 'haha']);
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
If (PosMulti(['m lv', 'mine lv', 'mining lv',
'm level', 'mine level', 'mining level'], ChatText)) then
begin
SayCurrentLevels('Mining');
Writeln(Chatter + ' Said : '+ Chattext);
Writeln('Said mining lvl to ' + Chatter);
Chatted := Chatted + 1;
Chatters := Chatters +','+ Chatter;
exit;
end;
If (PosMulti(['noob', 'loser',
'newbie', 'nub'], ChatText)) then
begin
TypeInRandom([':[', '=[', 'aww..', '?',
'ok...?', 'grr...']);
Writeln(Chatter + ' Said : '+ Chattext);
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
If (PosMulti(['auto'], ChatText)) then
begin
TypeInRandom(['gaw, autos make me mad..',
'dont auto..', 'autoing is wrong']);
Writeln(Chatter + ' Said : '+ Chattext);
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
If (PosMulti(['auto'], ChatText)) then
begin
TypeInRandom(['gaw, autos make me mad..',
'dont auto..', 'autoing is wrong']);
Writeln(Chatter + ' Said : '+ Chattext);
Writeln('Taked to ' + Chattext + ' about autoing');
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
If (PosMulti(['macro'], ChatText)) then
begin
TypeInRandom(['macro?',
'macro..', 'i report macros',
'grr.. macros are gay..']);
Writeln(Chatter + ' Said : '+ Chattext);
Writeln('Taked to ' + Chattext + ' about macros');
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
If (PosMulti(['bot'], ChatText)) then
begin
TypeInRandom(['no bot', 'nope',
'dont talk about that..']);
Writeln(Chatter + ' Said : '+ Chattext);
Writeln('Taked to ' + Chattext + ' about bots');
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
If (PosMulti(['sup', 'was up', 'hows it going',
'whats going on', 'how are you',
'how r u'], ChatText)) then
begin
TypeInRandom(['nothing much..', 'good..', 'bored', 'how r u doing?',
'fine', 'ok...', 'im happy']);
Writeln(Chatter + ' Said : '+ Chattext);
Writeln('Talked to ' + Chatter);
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
If (PosMulti(['hi', 'hey', 'halo',
'ello', 'yo', Players[CurrentPlayer].Name], ChatText)) then
begin
Wait(1000 + random(1000)); // Getting name ;)
TypeInRandom(['hi', 'hey', 'halo', 'ello',
'hi ' + Chatter, 'hey ' + Chatter]);
Writeln(Chatter + ' Said : '+ Chattext);
Writeln('Said hi to ' + Chatter);
Chatters := Chatters +','+ Chatter;
Chatted := Chatted + 1;
exit;
end;
end;
end;
begin
SkysResponder;
end.