SCAR Code:
{.include srl/srl.scar}
{.include srl/srl/misc/QuickChat.scar}
const
StartPersonality = 'angry';
var
Respond1, I, P : array of string;
Personality : string;
N : Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; // 3-4 letters of username
Players[0].Active := True; // Is the player active?
end;
function InChatMulti(text: TStringArray): boolean;
var
i: integer;
s: string;
begin
for i := 0 to high(text) do
begin
if (not (GetLastChatText(s))) then
LastChatter(s);
Result := (Pos(Text[i], s) > 0);
end;
end;
Procedure SetupAutorespond;
Begin
Personality := StartPersonality;
End;
procedure Responding;
begin
If InChat('Off') Then
TerminateScript;
if (InChatMulti(['vl', 'evel', 'Hi', 'Hello', 'Sup', 'Yo'])) then
begin
WriteLn('Here we go!');
I := ['oodcutting', 'oodcut', 'ishing', 'ish', 'ine', 'ining', 'hi', 'hello', 'sup', 'yo', 'lol', 'lmao', 'rofl!'];
for N := 0 to GetArrayLength(I) do
case InChat(I[N]) of
True:
begin
case I[N] of
0, 1:
begin
case lowercase(Personality) of
'laid back': Respond1 := ['Tis ', 'Yo, my wc lvl is ', ''];
'polite': Respond1 := ['Thanks for asking', 'It is ', ''];
'bored': Respond1 := ['Lolz, it''s ', 'dood! My wc level is ', ''];
'angry': Respond1 := ['What''s it matter? If you must know it''s ', 'Bah. ', ''];
end;
case Random(4) of
0..2: TypeSend(Respond1[Random(GetArrayLength(Respond1))] + IntToStr(GetSkillInfo('woodcutting', True)));
3: QCSayLevel('woodcutting');
end;
end;
2, 3:
begin
case lowercase(Personality) of
'laid back': Respond1 := ['Tis ', 'Yo, my fishing lvl is ', 'It''s ', ''];
'polite': Respond1 := ['Thanks for asking', 'It is ', ''];
'bored': Respond1 := ['Lolz, it''s ', 'dood! My fishing level is ', ''];
'angry': Respond1 := ['What''s it matter? If you must know it''s ', 'Bah. ', ''];
end;
case Random(4) of
0..2: TypeSend(Respond1[Random(GetArrayLength(Respond1))] + IntToStr(GetSkillInfo('fishing', True)));
4: QCSayLevel('woodcutting');
end;
end;
4, 5:
begin
case lowercase(Personality) of
'laid back': Respond1 := ['Tis ', 'Yo, my mining lvl is ', ''];
'polite': Respond1 := ['Thanks for asking', 'It is ', ''];
'bored': Respond1 := ['Lolz, it''s ', 'dood! My mining level is ', ''];
'angry': Respond1 := ['Whats it matter? If you must know its ', 'Bah. ', ''];
end;
case Random(4) of
0..2: TypeSend(Respond1[Random(GetArrayLength(Respond1))] + IntToStr(GetSkillInfo('mining', True)));
3: QCSayLevel('woodcutting');
end;
end;
6..9:
begin
case lowercase(Personality) of
'laid back': Respond1 := ['Yo!', 'Sup?', 'Sup man?'];
'polite': Respond1 := ['Hello.', 'Good day to you.'];
'bored': Respond1 := ['Ohaider!', 'Hi.'];
'angry': Respond1 := ['What?', 'Leave me alone!', 'Go away!'];
end;
case Random(4) of
0..2: TypeSend(Respond1[Random(GetArrayLength(Respond1))]);
3: TypeSend('GH' + IntToStr(Random(5)));
end;
end;
10..12:
begin
case lowercase(Personality) of
'laid back': Respond1 := ['dood, funneh!', 'hehe', 'l0lz'];
'polite': Respond1 := ['That was funny!', 'Please tell another joke', 'Heh'];
'bored': Respond1 := ['roflc0pt3rz', 'lool', 'roflzzz', 'lmao!'];
'angry': Respond1 := ['What''s so funny, punk?', 'Stop laughing, that was horrible'];
end;
TypeSend(Respond1[Random(GetArrayLength(Respond1))]);
end;
False: WriteLn('Didn''t find anything');
end;
end;
end;
end;
end;
Begin
SetupSrl;
SetupAutorespond;
DeclarePlayers;
ClearDebug;
Repeat
Responding;
Wait(1000);
Until(IsFkeyDown(9))
End.