SCAR Code:
{.include srl/srl.scar}
{.include srl/srl/misc/QuickChat.scar}
Const
StartPersonality='angry';
Var
Respond1, I : 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?
{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := ''; // 3-4 letters of username
Players[1].Active := True; // Is the player active?
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := ''; // 3-4 letters of username
Players[2].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 Responding;
Begin
SetupSrl;
DeclarePlayers;
Personality:=StartPersonality;
If Not FindBlackChatMessage(Players[currentplayer].name) and InChatMulti(['lvl', 'level', 'lv', 'lev', 'leve', 'hi', 'hello', 'sup', 'yo']) Then
Begin
I:=['oodcutting', 'oodcut', 'ishing', 'ish', 'ine', 'ining', 'hi', 'hello', 'sup', 'yo'];
For N:=0 To GetArrayLength(I) Do
Case InChat(I[N]) Of
True : Begin
Case I[N] Of
1, 2 : Begin
Case 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
1, 2, 3 : TypeSend(Respond1[Random(GetArrayLength(Respond1))] + IntToStr(GetSkillInfo('woodcutting', True)));
4 : QCSayLevel('woodcutting');
End;
End;
3, 4 : Begin
Case 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
1, 2, 3 : TypeSend(Respond1[Random(GetArrayLength(Respond1))] + IntToStr(GetSkillInfo('woodcutting', True)));
4 : QCSayLevel('woodcutting');
End;
End;
5,6 : Begin
Case 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:=['What''s it matter? If you must know it''s ', 'Bah. ', ''];
End;
Case Random(4) Of
1, 2, 3 : TypeSend(Respond1[Random(GetArrayLength(Respond1))] + IntToStr(GetSkillInfo('woodcutting', True)));
4 : QCSayLevel('woodcutting');
End;
End;
7, 8, 9, 10 : Begin
Case 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, 1, 2 : TypeSend(Respond1[Random(GetArrayLength(Respond1))] + IntToStr(GetSkillInfo('woodcutting', True)));
3 : TypeSend('GH' + IntToStr(Random(5)));
End;
End;
End;
End;
End;
False : WriteLn('Didn''t find anything'); //This line has the error!
End;
wait(10);
End;
End.