SRL Archive - Help and Support

Auto Respond


Tonekray

2006-11-02 16:55:58

Okay im making an auto responder for my Yew Cutter thats going to be sold soon. I need help with the Auto Responder, its messing up real bad. When it runs it talks to the person and then talks to me. Secondly TheName thing is messed up. It cuts out a few letters from the words. If anyone could help me make an auto responder ill be greatfull.

Code

function inChat1(Text : String) : Boolean; // Made by WT-Fakawi

begin

if (pos(Text, TheLine) <> 0) then

Result := True

else

Result := False;

end;

Function ISaid : Boolean;

Begin

If ( TheName = Username ) Then

Begin

Result := True;

End;

End;

Procedure RandomRespond;
Var
Responce : String;
Reply : Integer;
Begin
OldLine := TheLine;
TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));

if(Pos(':', TheName) > 0)then
Delete(TheName, Pos(':', TheName), Pos(':', TheName) - 2);
TheName:= Trim(TheName);

TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine := TheLine;

If OldLine <> NewLine Then

If inChat1 ( 'woodcu' ) or inChat1 ( 'wc' ) or inChat1 ( 'lvl' ) or inChat1 ( 'leve' ) Then
Begin
If Not ISaid Then
Begin
Responce := IntToStr ( GetSkillLevel ( 'woodcutting' ) );
Writeln ( 'Said ' + Responce + ' to ' + TheName )
TypeSend ( Responce )
End;
End;


If inChat1 ( 'lol' ) or inChat1 ( 'lmao' ) or inChat1 ( 'rofl' ) or inChat1 ( 'haha' ) Then
Begin
If Not ISaid Then
Begin
Reply := random ( 10 ) + 1;

Case Reply Of
1: Responce := 'wut is funny';
2: Responce := 'wut u laughin at';
3: Responce := ':)';
4: Responce := 'what';
5: Responce := 'loerz';
6: Responce := 'heh';
7: Responce := 'nice';
End;

Writeln ( 'Said ' + Responce + ' to ' + TheName )
TypeSend ( Responce )
Wait ( 5000 )
End;
End;

If inChat1 ( 'Username' ) or inChat1 ( 'Nickname' ) Then
Begin
If Not ISaid Then
Begin
Reply := Random ( 6 ) + 1;

Case Reply Of
1: Responce := 'wut';
2: Responce := 'ya';
3: Responce := 'yup';
4: Responce := 'wat u want';
5: Responce := 'im buisy';
6: Responce := 'lol what';
End;

Writeln ( 'Said ' + Responce + ' to ' + TheName )
TypeSend ( Responce )
Wait ( 5000 )
End;
End;

If inChat1 ( 'sup' ) or inChat1 ( 'hey' ) or inChat1 ( 'hello' ) or inChat1 ( 'hi' ) Then
Begin
If Not ISaid Then
Begin
Reply := Random ( 5 ) + 1;

Case Reply Of
1: Responce := 'ya';
2: Responce := 'wuts up';
3: Responce := 'welcome to boring land';
4: Responce := 'como estas';
5: Responce := 'hola';
End;

Writeln ( 'Said ' + Responce + ' to ' + TheName )
TypeSend ( Responce )
Wait ( 5000 )
End;
End;

End;