Results 1 to 6 of 6

Thread: how to make auto responder?

  1. #1
    Join Date
    Jun 2008
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    how to make auto responder?

    How could I make an auto responder which replies to these questions?

    question1: str lvl?
    answer1: 60. (lvl of my str)

    question2: range lvl?
    answer2: 70. (lvl of my ranged)

    and also if the player says my accounts name it replies: ?,what? etc...

    could anyone post an example source or a link to tutorial?

    thanks.

  2. #2
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    begin
    if in chat('str lvl') then
    typesend('60');
    end;

    or somthing like that

  3. #3
    Join Date
    Mar 2007
    Posts
    151
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Scaper View Post
    begin
    if in chat('str lvl') then
    typesend('60');
    end;

    or somthing like that
    Sigh.. that was the most pointless thing ever.

    Here's something i made that will tell when someone has traded with you, and then reply with one of responses:

    SCAR Code:
    Procedure AutoRespond1;
        var
          x, y, TimesTraded1: Integer;
        begin
          if FindColor(x, y, 8388736, 445, 572, 610, 579) then
             TimesTraded1 := TimesTraded1 + 1;
             if TimesTraded1 > 2 then
             begin
               wait(2000 +random(500));
               WriteLn('Somebody is trying to trade with us.');
               case random(6) of
               0: TypeSend('nty');
               1: TypeSend('nty.');
               2: TypeSend('no ty');
               3: TypeSend('no ty.');
               4: TypeSend('no thanks');
               5: TypeSend('no thanks.');
               wait(500 +random(500));
             end;
        end;
    That will respond to a trade only once, which is recommended for short scripts, such as a clay miner, which would be walking to a bank and walking back to the mine more often than actually mining itself. It only responds once because if it kept on saying one of the same six responses, people could just spam trade you and realise you're a bot.

    Right now i'm trying to work out how to search for multiple words in a particular chat message, so if somebody says "I love mining" it wouldn't respond, but if it finds the word "mining" or "minin" along with "level" or "lvl" in the same chat, then it will respond. Having a bit of difficulty though, if anyone knows how to do this i'd be grateful for a reply

    edit: You should check out SRL/SRL/Core/GameTab too, it has some level finding stuff in there..

  4. #4
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol i didn't have time i was in a rush since i have more time now i will show you a good example of a auto responder brb

  5. #5
    Join Date
    Jul 2008
    Posts
    907
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    a basic template would be something like
    SCAR Code:
    begin
      if inchat('str lvl') then
      case random(3) of
      0:begin
          typesend('60 :P');
        end;
      1:begin
          typesend('60');
        end;
      2:begin
          typesend('60 u?');
        end;
      end;
    end;


  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by sandos1234 View Post
    a basic template would be something like
    SCAR Code:
    begin
      if inchat('str lvl') then
      case random(3) of
      0:begin
          typesend('60 :P');
        end;
      1:begin
          typesend('60');
        end;
      2:begin
          typesend('60 u?');
        end;
      end;
    end;
    Thats not bad, but it needs more that just one thing to respond to. Also, remember that you only need begins and ends if you are nesting more than one line.

    Here is mine:

    Put this in CAutoRespond.scar.

    Use the SetupAutoResponder procedure in your script, and you have yourself a nice autoresponder.

    Just make sure you call the setup, and the AutoRespond function in your antiban.

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               ยป AutoRespond Routines                        --//
    //-----------------------------------------------------------------//
    // * procedure SetupAutoResponder;                                           // * by Nava2
    // * function InChatArr(Text:TStringArray): Boolean;                         // * by WT-Fakawi & Nava2
    // * function AutoRespond: Boolean;                                          // * by Nava2


    var
      OldMessage : string;                                                       // Stores the old message so it doesn't respond again.
      QnR : Array of Array [0..1] of TStringArray;                               // Array of questions and answers.


    {*******************************************************************************
    procedure SetupAutoResponder;
    By: Nava2
    Description: Allows user to set up Array for auto responder. Add more lines to
                 create more questions and answers. As well, the more answers the
                 better anti-ban it is. Please note, this procedure must be copied
                 into your script, then called.
    Example:
      procedure SetupAutoResponder;

      begin
        QnR[0][0] := ['level', 'lvl'];
        QnR[0][1] := ['my level is ' + Players[CurrentPlayer].Integers[0]', 'GTFO NOOB'];
       
        QnR[1][0] := ['hi', 'hey'];
        QnR[1][1] := ['hello', 'T I T S OR G T F O'];
      end;

    *******************************************************************************}

    {procedure SetupAutoResponder;

    begin
      QnR[0][0] := [];
      QnR[0][1] := [];
    end;}



    {*******************************************************************************
    function InChatArr(Text: TStringArray): Boolean;
    By: WT-Fakawi & Nava2
    Description: Grabs Last Chat Line and performs checks on occurence of text
    *******************************************************************************}


    function InChatArr(Text: TStringArray): Boolean;

    var
      i, H: integer;
      s: string;
                                    // This should probably be in Text.scar...
    begin
      H := High(Text);
      for i := 0 to H do
      begin
        if (not (GetLastChatText(s))) then LastChatter(s);
        Result := (Pos(Lowercase(Text[i]), (Lowercase(s)) > 0);
        if Result then Break;
      end;
    end;



    {*******************************************************************************
    function AutoRespond : boolean;
    By: Nava2
    Description: Responds to assorted text. Will NOT respond to itself. Returns a
                 boolean so people can record how many responds if they would like.
    *******************************************************************************}


    function AutoRespond : boolean;

    var
      CurrentMessage, Name : string;
      I, H : integer;
     
    begin
      GetLastChatText(CurrentMessage);
      if CurrentMessage = OldMessage then exit;
      OldMessage := CurrentMessage;
      LastChatter(Name);
      if Lowercase(Name) = Lowercase(Players[CurrentPlayer].name) then exit;
      case random(4) of
        0..2: begin
                H := High(QnR);
                for I := 0 to H do
                  if InChatArr(QnR[I][0]) then
                  begin
                    TypeSend(QnR[I][1][Random(High(QnR[I][1])]);
                    Result := true;
                  end;
              end;
      end;
    end;

    Good luck.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Auto Responder Help.
    By richk1693 in forum OSR Help
    Replies: 2
    Last Post: 12-12-2007, 12:22 AM
  2. How can i make an auto responder?
    By yanix in forum OSR Help
    Replies: 4
    Last Post: 11-24-2007, 05:08 PM
  3. Auto responder
    By dritar in forum OSR Help
    Replies: 3
    Last Post: 10-04-2007, 06:13 PM
  4. Best Way To Make A Responder?
    By Buckleyindahouse in forum OSR Help
    Replies: 4
    Last Post: 05-18-2007, 09:12 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
  •