TravisV10
08-28-2007, 10:51 AM
I thought the community could use this! It works. Just have it with your randoms procedures! (AutoRespond;) HAVE FUN!
Credits: Charmz for core procedures. I standardized most of it and redid everything. You must credit me and charmz!
{...><> Amazing AutoRespond Procedure <><...}
{
Credits:
- Born2Code - Cleaning up and adding procedures
- Charmz - Core Procedures
}
Function GetChatMessage(Text: String): Boolean;
Var
TX, TY: Integer;
Chat: String;
Begin
If(IsTextInAreaEx(40, 415, 130, 415, TX, TY, ':', 0, SmallChars, False, True, 0, 0, 0))then
Begin
Chat:= Lowercase(Trim(GetTextAtEx(TX + 8, 415, 0, SmallChars, False, False, 0, 1, 16711680, 40, False, TR_AllChars)));
If(Pos(Text, Chat) <> 0)then
Begin
Result:= True;
end;
end;
end;
Function GetChatName(Name: String): Boolean;
Var
I: Integer;
Begin
ChatName:= Lowercase(Trim(GetTextAtEx(21, 415, 0, SmallChars, False, False, 0, 0, 0, 50, False, TR_AllChars)));
I:= Pos(':', ChatName);
If(I <> 0)then
Begin
Delete(ChatName, I, I);
end;
If(Pos(Name, ChatName) <> 0)then
Begin
Result:= True;
end;
end;
procedure AutoRespond;
var
Responce, Level: String;
TheReply: Integer;
begin
if(GetChatMessage(Players[CurrentPlayer].Name))then
begin
AutoRespondCount := AutoRespondCount + 1;
TheReply := Random(10) + 1;
case (TheReply) of
0 : Responce := ('wat');
1 : Responce := ('what');
2 : Responce := ('yeah');
3 : Responce := ('wut');
4 : Responce := ('what do you want');
5 : Responce := ('meh?');
6 : Responce := ('yep?');
7 : Responce := ('me?');
8 : Responce := ('what?');
9 : Responce := ('?');
10 : Responce := ('??');
end;
TypeSend(Responce);
end;
if(GetChatMessage('lol'))
or (GetChatMessage('ha'))
or (GetChatMessage('haha'))
or (GetChatMessage('rofl'))
or (GetChatMessage('lmao'))
or (GetChatMessage('lmfao'))
or (GetChatMessage('tehee'))
or (GetChatMessage('funny'))
or (GetChatMessage('rotfl')) then
begin
AutoRespondCount := AutoRespondCount + 1;
TheReply := Random(10) + 1;
case (TheReply) of
0 : Responce := ('lol');
1 : Responce := ('haha');
2 : Responce := ('rofl');
3 : Responce := ('lmao');
4 : Responce := ('lolz');
5 : Responce := ('roflz');
6 : Responce := ('hehe');
7 : Responce := ('ha');
8 : Responce := ('lols');
9 : Responce := ('rofls');
10 : Responce := ('funny stuff');
end;
TypeSend(Responce);
end;
if(GetChatMessage('wc'))
or (GetChatMessage('woodcutting'))
or (GetChatMessage('wcing'))
or (GetChatMessage('cutting'))
and (GetChatMessage('lvl'))
or (GetChatMessage('level'))
or (GetChatMessage('lvls'))
or (GetChatMessage('lvlz'))
or (GetChatMessage('stats'))
or (GetChatMessage('levels'))then
begin
AutoRespondCount := AutoRespondCount + 1;
Level := IntToStr(GetSkillLevel('woodcutting'));
TheReply:= Random(6) + 1;
case (TheReply) of
0,4,5,6 : Responce:= (Level);
1 : Responce:= ('I''m level ' + Level + ' over here!');
2 : Responce:= ('Only ' + Level + '... XD');
3 : Responce:= ('My lvl is ' + Level);
end;
TypeSend(Responce);
end;
if(GetChatMessage('what'))
or (GetChatMessage('wut'))
or (GetChatMessage('wat'))
and (GetChatMessage('doing'))
or (GetChatMessage('doin'))
or (GetChatMessage('up'))
or (GetChatMessage('happening')) then
begin
AutoRespondCount := AutoRespondCount + 1;
TheReply := Random(5) + 1;
case (TheReply) of
0 : Responce := ('hello');
1 : Responce := ('watz up');
2 : Responce := ('wat up');
3 : Responce := ('whats up');
4 : Responce := ('what up');
5 : Responce := ('hola');
end;
TypeSend(Responce);
end;
end;
Credits: Charmz for core procedures. I standardized most of it and redid everything. You must credit me and charmz!
{...><> Amazing AutoRespond Procedure <><...}
{
Credits:
- Born2Code - Cleaning up and adding procedures
- Charmz - Core Procedures
}
Function GetChatMessage(Text: String): Boolean;
Var
TX, TY: Integer;
Chat: String;
Begin
If(IsTextInAreaEx(40, 415, 130, 415, TX, TY, ':', 0, SmallChars, False, True, 0, 0, 0))then
Begin
Chat:= Lowercase(Trim(GetTextAtEx(TX + 8, 415, 0, SmallChars, False, False, 0, 1, 16711680, 40, False, TR_AllChars)));
If(Pos(Text, Chat) <> 0)then
Begin
Result:= True;
end;
end;
end;
Function GetChatName(Name: String): Boolean;
Var
I: Integer;
Begin
ChatName:= Lowercase(Trim(GetTextAtEx(21, 415, 0, SmallChars, False, False, 0, 0, 0, 50, False, TR_AllChars)));
I:= Pos(':', ChatName);
If(I <> 0)then
Begin
Delete(ChatName, I, I);
end;
If(Pos(Name, ChatName) <> 0)then
Begin
Result:= True;
end;
end;
procedure AutoRespond;
var
Responce, Level: String;
TheReply: Integer;
begin
if(GetChatMessage(Players[CurrentPlayer].Name))then
begin
AutoRespondCount := AutoRespondCount + 1;
TheReply := Random(10) + 1;
case (TheReply) of
0 : Responce := ('wat');
1 : Responce := ('what');
2 : Responce := ('yeah');
3 : Responce := ('wut');
4 : Responce := ('what do you want');
5 : Responce := ('meh?');
6 : Responce := ('yep?');
7 : Responce := ('me?');
8 : Responce := ('what?');
9 : Responce := ('?');
10 : Responce := ('??');
end;
TypeSend(Responce);
end;
if(GetChatMessage('lol'))
or (GetChatMessage('ha'))
or (GetChatMessage('haha'))
or (GetChatMessage('rofl'))
or (GetChatMessage('lmao'))
or (GetChatMessage('lmfao'))
or (GetChatMessage('tehee'))
or (GetChatMessage('funny'))
or (GetChatMessage('rotfl')) then
begin
AutoRespondCount := AutoRespondCount + 1;
TheReply := Random(10) + 1;
case (TheReply) of
0 : Responce := ('lol');
1 : Responce := ('haha');
2 : Responce := ('rofl');
3 : Responce := ('lmao');
4 : Responce := ('lolz');
5 : Responce := ('roflz');
6 : Responce := ('hehe');
7 : Responce := ('ha');
8 : Responce := ('lols');
9 : Responce := ('rofls');
10 : Responce := ('funny stuff');
end;
TypeSend(Responce);
end;
if(GetChatMessage('wc'))
or (GetChatMessage('woodcutting'))
or (GetChatMessage('wcing'))
or (GetChatMessage('cutting'))
and (GetChatMessage('lvl'))
or (GetChatMessage('level'))
or (GetChatMessage('lvls'))
or (GetChatMessage('lvlz'))
or (GetChatMessage('stats'))
or (GetChatMessage('levels'))then
begin
AutoRespondCount := AutoRespondCount + 1;
Level := IntToStr(GetSkillLevel('woodcutting'));
TheReply:= Random(6) + 1;
case (TheReply) of
0,4,5,6 : Responce:= (Level);
1 : Responce:= ('I''m level ' + Level + ' over here!');
2 : Responce:= ('Only ' + Level + '... XD');
3 : Responce:= ('My lvl is ' + Level);
end;
TypeSend(Responce);
end;
if(GetChatMessage('what'))
or (GetChatMessage('wut'))
or (GetChatMessage('wat'))
and (GetChatMessage('doing'))
or (GetChatMessage('doin'))
or (GetChatMessage('up'))
or (GetChatMessage('happening')) then
begin
AutoRespondCount := AutoRespondCount + 1;
TheReply := Random(5) + 1;
case (TheReply) of
0 : Responce := ('hello');
1 : Responce := ('watz up');
2 : Responce := ('wat up');
3 : Responce := ('whats up');
4 : Responce := ('what up');
5 : Responce := ('hola');
end;
TypeSend(Responce);
end;
end;