Results 1 to 23 of 23

Thread: [INCLUDE] Auto Responder

  1. #1
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [INCLUDE] Auto Responder

    This is an autoresponder that I made.

    Instructions

    1. Put {.include SRL/SRL/misc/CAutoRespond.scar} at the top of your script.

    2. Make a procedure called SetupAutoResponder;

    Make it like so

    SCAR Code:
    procedure SetupAutoResponder;
    begin
      SetAutoResponderLength(0);
      RespondTo[0] := [];
      RespondWith[0] := [];
    end;

    Adding as many responses as you want as long as you make the SetAutoResponderLength(0); to the number of responses.

    Then when you want to use it you just call AutoResponder; and it is a boolean so you can do if AutoResponder then inc(AutoResponses).

    Run this script

    SCAR Code:
    program New;
     
    var
     
    FileNum : integer;
     
    begin
     
      FileNum := RewriteFile(AppPath + 'Includes\SRL\SRL\misc\CAutoRespond.scar', false);
      WriteFileString(FileNum, GetPage('http://kwscripts.freehostia.com/Da0wnerResponder.scar'));
      closefile(FileNum);
      writeln('File downloaded successfully to ' + AppPath + 'Includes\SRL\SRL\misc\CAutoRespond.scar.');
    end.

  2. #2
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

  3. #3
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    How about you EvilChicken! It works fine for me.

    SCAR Code:
    program New;

    var

    FileNum : integer;

    begin

      if FileExists(AppPath + 'Includes\SRL\SRL\misc\Da0wnerResponder.scar') then
      begin
        case  GetApplication.MessageBox('You already seem to have the autoresponder. Download anyway?', 'Download Anyway?', 4) of
        mrNo : TerminateScript;
      end;
    end;
      FileNum := RewriteFile(AppPath + 'Includes\SRL\SRL\misc\Da0wnerResponder.scar', false);
      WriteFileString(FileNum, GetPage('http://kwscripts.freehostia.com/Da0wnerResponder.scar'));
      closefile(FileNum);
      writeln('File downloaded successfully to ' + AppPath + 'Includes\SRL\SRL\misc\Da0wnerResponder.scar.');
    end.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea, use the one that hy posted .

  5. #5
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I don't see why it has to be an actual file rather than just included as a procedure/function. Anyway, it's pretty basic and it looks like it may respond to the same phrase multiple times. Other than that, it looks like it could save some time for some people, so it's good
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  6. #6
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice
    ~Hermen

  7. #7
    Join Date
    Oct 2007
    Posts
    302
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It worked for me, i like this idea actually :S

    But an entire file just for the single thing :\

    Are you planning on expanding on this :\
    Previously known as boxcrop.


  8. #8
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    You could also just use CAutoRespond.scar, just overwrite it. Would allow you to use the Respond; procedure, too.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  9. #9
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    You could also just use CAutoRespond.scar, just overwrite it. Would allow you to use the Respond; procedure, too.
    For some weird reason, people are dying to get their names into the include.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  10. #10
    Join Date
    Sep 2006
    Location
    include srl/srl.scar ( aussie)
    Posts
    2,875
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice work kyle, very nice c0de well done

  11. #11
    Join Date
    Apr 2007
    Posts
    224
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Erm its alight, but i'll edit it myself thanks.

  12. #12
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow...You don't even know how it works etc...

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

    Default

    Looks nice would this still work?

    just thinking because its couple months old..

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

    Default

    don't gravedigeven in the slightest test it yourself thats the point of it


  15. #15
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Umm, I haven't scripted for a while but it should work?

  16. #16
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    No it doesn't my friend,

    SCAR Code:
    {*******************************************************************************
    function InChatMulti(text : TStringArray) : boolean;
    By: Da 0wner
    Description: Returns true if any of the text is found in last line of chat box.
    *******************************************************************************}


    function InChatMulti(text : TStringArray) : boolean;
    var
      i : integer;
    begin
      for i := 0 to high(Text) do
      begin
        if InChat(text[i]) then
        begin
          if FindBlackChatMessage(Players[CurrentPlayer].nick) then exit; // lol?
          result := true;
          exit;
        end;
      end;
    end;

    Shouldn't it be
    SCAR Code:
    {*******************************************************************************
    function InChatMulti(text : TStringArray) : boolean;
    By: Da 0wner
    Description: Returns true if any of the text is found in last line of chat box.
    *******************************************************************************}


    function InChatMulti(text : TStringArray) : boolean;
    var
      i : integer;
    begin
      for i := 0 to high(Text) do
      begin
        if InChat(text[i]) then
        begin
          if Not FindBlackChatMessage(Players[CurrentPlayer].nick) then exit
         else
          result := true;
          exit;
        end;
      end;
    end;

    becuase it will exit if it finds the nickname rendering it useless .

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

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    No it doesn't my friend,

    SCAR Code:
    {*******************************************************************************
    function InChatMulti(text : TStringArray) : boolean;
    By: Da 0wner
    Description: Returns true if any of the text is found in last line of chat box.
    *******************************************************************************}


    function InChatMulti(text : TStringArray) : boolean;
    var
      i : integer;
    begin
      for i := 0 to high(Text) do
      begin
        if InChat(text[i]) then
        begin
          if FindBlackChatMessage(Players[CurrentPlayer].nick) then exit; // lol?
          result := true;
          exit;
        end;
      end;
    end;

    Shouldn't it be
    SCAR Code:
    {*******************************************************************************
    function InChatMulti(text : TStringArray) : boolean;
    By: Da 0wner
    Description: Returns true if any of the text is found in last line of chat box.
    *******************************************************************************}


    function InChatMulti(text : TStringArray) : boolean;
    var
      i : integer;
    begin
      for i := 0 to high(Text) do
      begin
        if InChat(text[i]) then
        begin
          if Not FindBlackChatMessage(Players[CurrentPlayer].nick) then exit
         else
          result := true;
          exit;
        end;
      end;
    end;

    becuase it will exit if it finds the nickname rendering it useless .
    To be completely honest, checking for nicks in this function is useless. The fastest way would be to do that else where.

    Here is my InChatArr(Text: TStringArray): Boolean;

    SCAR Code:
    function InChatArr(Text: TStringArray): Boolean;

    var
      I, H : integer;
      s : string;
                                 
    begin
      H := High(Text);
      if (not (GetLastChatText(s))) then LastChatter(s);
      for I := 0 to H do
        if (Pos(Lowercase(Text[I]), (Lowercase(s)) )> 0) then
        begin
          Result := true;
          Exit;
        end;
    end;
    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

  18. #18
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Umm, this is old and also, mine is right, so that it won't respond to itself. So yours would be wrong. And yours may be better than mine but I don't really care this is like 4 months old. But that is there so that it won't respond to itself.

  19. #19
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    Umm, this is old and also, mine is right, so that it won't respond to itself. So yours would be wrong. And yours may be better than mine but I don't really care this is like 4 months old. But that is there so that it won't respond to itself.
    It doesn't even respond to itself InChat checks if your nick is found in the Black Text (i think), since it's declared in Players[somerandomnumber].Nick:='';
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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

    Default

    Quote Originally Posted by Dan's The Man View Post
    It doesn't even respond to itself InChat checks if your nick is found in the Black Text (i think), since it's declared in Players[somerandomnumber].Nick:='';
    Exactly.
    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

  21. #21
    Join Date
    Dec 2007
    Posts
    108
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Would this work then?

    procedure SetupAutoResponder;
    begin
    SetAutoResponderLength(0);
    RespondTo[0] := [wc lvl?];
    RespondWith[0] := [30];
    end;

  22. #22
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh yea, sorry, I haven't scripted in a long time. And Nava if you knew that then you should have said that .

    And Dallas

    This would work
    SCAR Code:
    procedure SetupAutoResponder;
    begin
    SetAutoResponderLength(0);
    RespondTo[0] := ['wc lvl', 'wc levels', 'woodcuttin lvl'];
    RespondWith[0] := ['30'];
    end;

  23. #23
    Join Date
    Dec 2006
    Posts
    908
    Mentioned
    1 Post(s)
    Quoted
    17 Post(s)

    Default

    should be Wc lvl. because the fact rs caps the first letters.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How Do I Add A Auto Responder?
    By gamer 5 in forum OSR Help
    Replies: 6
    Last Post: 12-01-2007, 06:21 AM
  2. Auto responder
    By dritar in forum OSR Help
    Replies: 3
    Last Post: 10-04-2007, 06:13 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
  •