Results 1 to 2 of 2

Thread: Functions for AutoResponders...

  1. #1
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Functions for AutoResponders...

    2 functions for autoresponders !:
    SCAR Code:
    Function GetChatTexts(ChatType : (Blue, Black, BlueAndBlack)): TStringArray;
    Var
      Info : TIntegerArray;
      I : Integer;
      TPA : TPointArray;
    Begin
      Case ChatType Of
        Blue: Info := [16711680];
        Black : Info := [0];
        BlueAndBlack: Info := [16711680, 0];
      Else
        srl_Warn('GetChatTexts', 'Invalid option', warn_AllVersions);
      End;
      SetLength(TPA, 9);
      For I := 1 To 8 Do
      Begin
        TPA[I] := TextCoords(I);
      End;
      SetLength(Result, 9);
      If GetArrayLength(Info) = 1 Then
      Begin
        For I := 1 To 8 Do
        Begin
          Result[I] := Trim(GetTextAtEx(TPA[I].X - 2, TPA[I].Y - 2, 0, SmallChars, False, False, 0, 1, Info[0], 60, False, tr_AllChars));
        End;
      End Else
      Begin
        For I := 1 To 8 Do
        Begin
          Result[I] := Trim(GetTextAtEx(TPA[I].X - 2, TPA[I].Y - 2, 0, SmallChars, False, False, 0, 1, Info[1], 60, False, tr_AllChars)) + Trim(GetTextAtEx(TPA[I].X - 2, TPA[I].Y - 2, 0, SmallChars, False, False, 0, 1, Info[0], 60, False, tr_AllChars));
        End;
      End;
    End;
    Get all texts(Blue, Black, Blue or Black) from the 8 text lines in the chat box.

    SCAR Code:
    Function InChatRespond(ChatType : (Blue, Black, BlueAndBlack); NeededChat,ToSay : String): Boolean;
    Var
      I : Integer;
      LastChat : TStringArray;
    Begin
      LastChat := GetChatTexts(ChatType);
      For I := 1 To 9 Do
      Begin
        If Pos(Lowercase(NeededChat), Lowercase(LastChat[I])) <> 0 Then
        Begin
          Result := True;
          TypeSend(ToSay);
          Exit;
        End;
      End;
      Result := False;
    End;
    For example:
    SCAR Code:
    If InChatRespond(Blue, 'hi', 'whatsup') Then Resonds := Responds + 1;


    For random case reponder's:
    SCAR Code:
    Procedure Responder;
    Var
      NeededChats : TStringArray;
      I : Integer;
    Begin
      NeededChats := ['hi', 'hello', 'hiya', 'hey', 'sup'];
      For I := 0 To High(NeededChats) Do
      Begin
        If InChatRespond(Blue, NeededChats[I], NeededChats[Random(Length(NeededChats))]) Then Break;
      End;
    End;
    ^You Can adapt NeededChats to your autoresponder^


  2. #2
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    oh nice
    if you could , could you make a already good responder

    im too lazy to make my own lol.

    if not np ill just make my own or use caustic and edit alot of it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Functions
    By lordsaturn in forum OSR Help
    Replies: 1
    Last Post: 08-13-2007, 10:12 PM
  2. Help with some functions
    By Pinqvin in forum OSR Help
    Replies: 6
    Last Post: 03-06-2007, 01:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •