Results 1 to 11 of 11

Thread: Auto Responder Help

  1. #1
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Auto Responder Help

    Well im going to start work on a auto responder. It will be imported into scripts as a include to keep from the mess in each script. I want to know how i would go about doing this?
    I know how to check if text is in the chatbox and respond, but how would i make a array of this with questions and responces.
    It will be released to free for all and for jr members im going to make a GUI Editor for it (like a generator).
    So please help
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  2. #2
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Procedure yadda;
    begin
    if(findchat('yadda')then //dont know the function that you use to find blue text
     begin
      case random(30) of
      0: typesend('pookesmack');
      1: typesend('yedee');
      2: typesend('wooko');
     end;
    end;

    Cases is what your trying to say? Picks a random of those 3 or how many you want and does what it picks. Used in antiban.

  3. #3
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Haven't done an auto responder but...

    Use:

    SCAR Code:
    {*******************************************************************************
    function GetLastChatText(var chat: String): Boolean;
    By: masquerader / Wizzup?
    Description: Returns true if blue chat text was found
    *******************************************************************************}


    function GetLastChatText(var chat: string): Boolean;
    begin
      Chat := GetChatBoxText(8, clChat);
      Result := (Chat <> '');
    end;

    or depending on the line..:

    SCAR Code:
    {*******************************************************************************
    function GetChatBoxText(Line, TextCol: Integer): string;
    By: ZephyrsFury
    Description: Gets text on the line Line with colour TextCol. (Line 1 is the top,
      Line 8 is the bottom line).
    Colours:
      clMessage/clBlack - Black text messages ("Oh Dear you are dead", etc).
      clChat/clBlue     - Chat messages from you and other players.
      clTrade/clPurple  - Colour of trade request text.
      clFriend          - Colour of friend and clan chat.
      Works with other colours too.
    *******************************************************************************}

    function GetChatBoxText(Line, TextCol: Integer): string;
    var
      P: TPoint;
      cArr: TPointArray;
      B: TBox;
    begin
      P := TextCoords(Line);
      if (FindColorsTolerance(cArr, TextCol, MCX1, P.y, MCX2, P.y + 13, 0)) then
      begin
        B := GetTPABounds(cArr);
        Result := Trim(GetTextAtEx(B.x1 - 1, B.y1 - 2, 0, SmallChars, False, False,
          0, 1, TextCol, 80, False, tr_AllChars));
      end;
    end;

    I think that is quite straight forward, so you could do something like:

    SCAR Code:
    program New;
    {.include SRL\SRL.Scar}
    var
      LvlText: TStringArray;
    begin
      LvlText := ['lvls', 'lvl', 'level?', 'lvlz?'];
      if GetChatBoxText(8, clChat)then
      for i := 0 to 3 do  //or High(Lvltext);
      begin
        case Random(5) of
          0: TypeSend('Im level' + IntToStr(WClevel)); //etc, that would be determined using gametab/ref or whatever
    end.

    It doesn't compile but you get the idea right?

    E: Also make the case number slightly higher than the amount of typesends you have, so its random in away by not talking sometimes.

    PM me for more help...Don't just just <3 me jk lol
    Last edited by Smarter Child; 09-06-2009 at 05:22 AM.

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    A better, and working, example (no offense Smarter Child):

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    var
      LvlText: TStringArray;
      I : Integer;
     
    begin
      SetupSRL;
      LvlText:= ['lvls', 'lvl', 'level?', 'lvlz?'];
      for i := 0 to 3 do
      begin
        if GetChatBoxText(8, clChat) = LvlText[I] then
          if Random(5) = 2 then
            TypeSend('Im level' + IntToStr(WClevel));
      end;
    end.

    Richard.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R1ch View Post
    A better, and working, example (no offense Smarter Child):

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    var
      LvlText: TStringArray;
      I : Integer;
     
    begin
      SetupSRL;
      LvlText:= ['lvls', 'lvl', 'level?', 'lvlz?'];
      for i := 0 to 3 do
      begin
        if GetChatBoxText(8, clChat) = LvlText[I] then
          if Random(5) = 2 then
            TypeSend('Im level' + IntToStr(WClevel));
      end;
    end.

    Richard.


    You win this time R1ch.

    Yeah, yours does look better.

    But i still prefer cases...

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Smarter Child View Post
    But i still prefer cases...
    Same here, but it is more efficient to use an if..then..else statement when there's only one or two options.

  7. #7
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Heres an example of something I made. it dosnt respond, but just plays a sound and make a popup come up saying "Flagged text found" so you can respond yourself.

    SCAR Code:
    function CheckChat : Boolean;
    var
      i, j, H : Integer;
    begin
      H := High(FlaggedText);
      for i := 0 to H do
      begin
        for j := 8 downto 1 do
        begin
          if Pos(FlaggedText[i], Lowercase(GetChatBoxText(j, clChat))) > 0 then
          begin
            PlaySound('Sound.wav');
            Alert('Found Flagged Text: ' + FlaggedText[i]);
            Writeln('Found Flagged Text: ' + FlaggedText[i]);
            Wait(7000);
            Exit;
          end;
        end;
      end;
      if Lowercase(LastChatMessage('trade')) = 'wishes' then
      begin
        PlaySound('Sound.wav');
        Alert('Someone is trying to trade with you');
        Writeln('Someone is trying to trade with you');
      end;
    end;

    var
      Flagged Text : TStringArray;

    begin
      FlaggedText := ['Your Name Here / first 4 letters', 'bot', 'macro', 'report', 'ban'];
      CheckChat;
    end;

    If your names something like "Lolzormonster" oviously dont put 'lol' as your name in the flagged text, or it will beep every time someone says "lol". So yeah you just need to use abit of common sence. If your names Jack12443542, most people are only going to refer to you as 'Jack' and not type all the numbers so again just try to put in a name you think people will use to talk to you :P
    Lance. Da. Pants.

  8. #8
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Lance View Post
    Heres an example of something I made. it dosnt respond, but just plays a sound and make a popup come up saying "Flagged text found" so you can respond yourself.

    SCAR Code:
    function CheckChat : Boolean;
    var
      i, j, H : Integer;
    begin
      H := High(FlaggedText);
      for i := 0 to H do
      begin
        for j := 8 downto 1 do
        begin
          if Pos(FlaggedText[i], Lowercase(GetChatBoxText(j, clChat))) > 0 then
          begin
            PlaySound('Sound.wav');
            Alert('Found Flagged Text: ' + FlaggedText[i]);
            Writeln('Found Flagged Text: ' + FlaggedText[i]);
            Wait(7000);
            Exit;
          end;
        end;
      end;
      if Lowercase(LastChatMessage('trade')) = 'wishes' then
      begin
        PlaySound('Sound.wav');
        Alert('Someone is trying to trade with you');
        Writeln('Someone is trying to trade with you');
      end;
    end;

    var
      Flagged Text : TStringArray;

    begin
      FlaggedText := ['Your Name Here / first 4 letters', 'bot', 'macro', 'report', 'ban'];
      CheckChat;
    end;

    If your names something like "Lolzormonster" oviously dont put 'lol' as your name in the flagged text, or it will beep every time someone says "lol". So yeah you just need to use abit of common sence. If your names Jack12443542, most people are only going to refer to you as 'Jack' and not type all the numbers so again just try to put in a name you think people will use to talk to you :P
    yay mind if i use this in my auto talker and modify it to make a sound when someone says something unkown to the auto talker/flagged text/trade?
    you are

    Quote Originally Posted by Smarter Child View Post
    Haven't done an auto responder but...

    Use:


    It doesn't compile but you get the idea right?

    E: Also make the case number slightly higher than the amount of typesends you have, so its random in away by not talking sometimes.

    PM me for more help...Don't just just <3 me jk lol
    you are my thank you

    Quote Originally Posted by R1ch View Post
    A better, and working, example (no offense Smarter Child):

    SCAR Code:
    program New;
    {.include SRL\SRL.scar}

    var
      LvlText: TStringArray;
      I : Integer;
     
    begin
      SetupSRL;
      LvlText:= ['lvls', 'lvl', 'level?', 'lvlz?'];
      for i := 0 to 3 do
      begin
        if GetChatBoxText(8, clChat) = LvlText[I] then
          if Random(5) = 2 then
            TypeSend('Im level' + IntToStr(WClevel));
      end;
    end.

    Richard.
    you are also
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  9. #9
    Join Date
    Dec 2006
    Location
    Canada, BC
    Posts
    728
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no worries haha. You might want to test the trading part, i havent tested that yet and idk if it works :P
    Lance. Da. Pants.

  10. #10
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Lance View Post
    no worries haha. You might want to test the trading part, i havent tested that yet and idk if it works :P
    thanks. You are and ill test the trading and if it doesnt work ill pm you a fix. You know why my anit ban is getting Unknown identifier 'AlmostLogOut'?
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  11. #11
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    AlmostLogout was in PH.scar, and that has since been removed from the includes. The only remaining include in SRL, and AlmostLogout is not in SRL.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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