Results 1 to 9 of 9

Thread: Auto Responder Function

  1. #1
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Auto Responder Help

    I Have This As A AutoResponder:
    SCAR Code:
    program AutoTalker;
    {.include SRL/SRL.scar}
    var
      XDump, YDump, LoopInteger: Integer;

    const
      UseAutoResponder = True;

    function IsChatTextUp(TheText: String): Boolean;
    begin
      Result := FindText(XDump, YDump, TheText, 3, 518, 478, 6, 344);
    end;

    procedure ChangeTab(TheTab: Integer);
    begin
      GameTab(TheTab);
      LoopInteger := 0;
      repeat
        Wait(1000 + Random(1000));
        LoopInteger := LoopInteger + 1;
        if(LoopInteger >= 20)then
        begin
          Logout;
          Break;
        end;
      until((GetCurrentTab = TheTab)or(not(LoggedIn)))
    end;

    function CombatSkills: String;
    begin
      case Random(15) of
        0, 1, 2: Result := 'att';
        3, 4, 5, 6: Result := 'str';
        7, 8: Result := 'def';
        9, 10: Result := 'attack';
        11, 12: Result := 'strength';
        13, 14: Result := 'defence';
      end;
    end;

    function LevelText: String;
    begin
      case Random(6) of
        0, 1, 2: Result := 'lvl';
        3, 4: Result := 'lv';
        5: Result := 'level';
      end;
    end;

    function PunChance(PunText: String; Chance: Integer): String;
    var
      RandomNum: Integer;
    begin
      RandomNum := Random(Chance);
      if((RandomNum <> 0)or(RandomNum <> 1)or(RandomNum <> 4)or(RandomNum <> 5))then
        Result := '';
      case RandomNum of
        0, 1, 4, 5: Result := PunText;
      end;
    end;

    function ToText: String;
    begin
      case Random(4) of
        0, 1, 2: Result := 'to';
        3: Result := '2';
      end;
    end;

    function NoobCall: String;
    begin
      case Random(26) of
        0, 1, 2, 3: Result := 'noob';
        4, 5, 6: Result := 'n00b';
        7: Result := 'noobster';
        8, 9: Result := 'newbie';
        10, 11, 12: Result := 'newb';
        13, 14: Result := 'froob';
        15, 16: Result := 'fr00b';
        17: Result := 'choob';
        18: Result := 'ch00b';
        19, 20: Result := 'nooblet';
        21, 22: Result := 'n00blet';
        23, 24, 25: Result := 'nub';
      end;
    end;

    function LaughText(UseHaHa: Boolean): String;
    begin
      case Random(17) of
        0, 1, 2: Result := 'lol';
        3, 4, 5: Result := 'lmao';
        6: Result := 'roflmao';
        7, 8, 9: Result := 'rofl';
        10: Result := 'pmsl'
        11, 12: Result := 'l0l';
        13: if UseHaHa then Result := 'haha';
        14: if UseHaHa then Result := 'hehe';
        15, 16: if UseHaHa then Result := '^^';
      end;
    end;

    procedure LevelAskRoutine(CombatSkill: String);
    var
      CombatSkillLevel: Integer;
    begin
      Wait(1000 + Random(1000));
      ChangeTab(2);
      CombatSkillLevel := GetSkillLevel(CombatSkill);
      case Random(13) of
        0, 1: TypeSend(IntToStr(CombatSkillLevel));
        2, 3, 4: TypeSend(IntToStr(CombatSkillLevel)+'here'+ PunChance('.', 17));
        5, 6: TypeSend(LevelText+' '+IntToStr(CombatSkillLevel)+ PunChance(',', 14)+' '+'you'+ PunChance('?', 8));
        7, 8, 9: TypeSend(IntToStr(CombatSkillLevel)+ PunChance(',', 14)+' '+'you'+ PunChance('?', 8));
        10, 11, 12: TypeSend(LevelText+' '+IntToStr(CombatSkillLevel)+PunChance('.', 17));
      end;
    end;

    procedure AutoRespond;
    begin
      if not UseAutoResponder then
        Exit;

      //GREETINGS
      if((IsChatTextUp('hello'))or(IsChatTextUp('hi'))or(IsChatTextUp('ello'))
      or(IsChatTextUp('hey'))or(IsChatTextUp('yo'))or(IsChatTextUp('sup'))
      or(IsChatTextUp('Hello'))or(IsChatTextUp('Hi'))or(IsChatTextUp('Ello'))
      or(IsChatTextUp('Hey'))or(IsChatTextUp('Yo'))or(IsChatTextUp('Sup')))then
        case Random(35) of
          0, 1: TypeSend('sup'+ PunChance('.', 17));
          2: TypeSend('yo'+ PunChance('.', 17));
          3, 4, 5: TypeSend('hey'+ PunChance('.', 17));
          6, 7: TypeSend('hello'+ PunChance('.', 17));
          8, 9, 10, 11: TypeSend('hi'+ PunChance('.', 17));
          12, 13: TypeSend('ello'+ PunChance('.', 17));
          14: TypeSend('wats up'+ PunChance('?', 17));
          15, 16:
          begin
            case Random(14) of
              0, 1: TypeSend('sup'+ PunChance(',', 14) +' '+CombatSkills+' '+LevelText + PunChance('?', 8));
              2: TypeSend('yo'+ PunChance(',', 14) +' '+CombatSkills+' '+LevelText + PunChance('?', 8));
              3, 4, 5: TypeSend('hey'+ PunChance(',', 14) +' '+CombatSkills+' '+LevelText + PunChance('?', 8));
              6, 7: TypeSend('hello'+ PunChance(',', 14) +' '+CombatSkills+' '+LevelText + PunChance('?', 8));
              8, 9, 10, 11: TypeSend('hi'+ PunChance(',', 14) +' '+CombatSkills+' '+LevelText + PunChance('?', 8));
              12, 13: TypeSend('ello'+ PunChance(',', 14) +' '+CombatSkills+' '+LevelText + PunChance('?', 8));
            end;
          end;
        end;
       
      Wait(1000 + Random(1000));
       
      //NOOB CALLING/COMEBACKS
      if((IsChatTextUp('noob'))or(IsChatTextUp('newbie'))or(IsChatTextUp('n00b'))or
      (IsChatTextUp('newb'))or(IsChatTextUp('froob'))or(IsChatTextUp('choob'))or
      (IsChatTextUp('fr00b'))or(IsChatTextUp('ch00b'))or(IsChatTextUp('nooblet'))or
      (IsChatTextUp('n00blet'))or(IsChatTextUp('nub'))or(IsChatTextUp('Noob'))or
      (IsChatTextUp('Newbie'))or(IsChatTextUp('N00b'))or(IsChatTextUp('Newb'))or
      (IsChatTextUp('Froob'))or(IsChatTextUp('Choob'))or(IsChatTextUp('Fr00b'))or
      (IsChatTextUp('Ch00b'))or(IsChatTextUp('Nooblet'))or(IsChatTextUp('N00blet'))or
      (IsChatTextUp('Nub')))then
        case Random(61) of
          0, 1, 2: TypeSend(LaughText(False) + PunChance('?', 8));
          3, 4: TypeSend('sozs'+ PunChance(',', 14) +' i dont talk '+ToText+' '+NoobCall+'s'+ PunChance('.', 17));
          5, 6, 7: TypeSend('watever'+ PunChance(',', 14) +' '+NoobCall+ PunChance('.', 17));
          8, 9, 10, 11: TypeSend('pathetic'+ PunChance('.', 17));
          11, 12, 13, 14: TypeSend('...');
          15, 16, 17: TypeSend(LaughText(False) +' '+NoobCall+ PunChance('.', 17));
          18, 19: TypeSend('watch that mouth '+NoobCall+ PunChance('.', 17));
          20, 21, 23: TypeSend('wot a '+NoobCall+ PunChance('.', 17));
          24, 25, 26: TypeSend('-.-');
          27, 28: TypeSend('>.>');
          29: TypeSend('^^');
        end;

      Wait(1000 + Random(1000));

      //Laughing
      if((IsChatTextUp('hehe'))or(IsChatTextUp('^^'))or(IsChatTextUp('lol'))
      or(IsChatTextUp('haha'))or(IsChatTextUp('lawl'))or(IsChatTextUp('lmao'))
      or(IsChatTextUp('pmsl'))or(IsChatTextUp('rofl'))or(IsChatTextUp('l0l'))
      or(IsChatTextUp('roflmao'))or(IsChatTextUp('Haha'))or(IsChatTextUp('Hehe'))
      or(IsChatTextUp('Roflmao'))or(IsChatTextUp('Lol'))or(IsChatTextUp('L0l'))
      or(IsChatTextUp('Lawl'))or(IsChatTextUp('Lmao'))or(IsChatTextUp('Pmsl'))
      or(IsChatTextUp('Rofl')))then
        case Random(25) of
          1, 5, 16, 21: TypeSend(LaughText(True) + PunChance('.', 17));
        end;

      Wait(1000 + Random(1000));

      //Level Asking (Attack)
      if((IsChatTextUp('attack lv'))or(IsChatTextUp('attack level'))or(IsChatTextUp('attack lvl'))
      or(IsChatTextUp('att lv'))or(IsChatTextUp('att lvl'))or(IsChatTextUp('att level'))
      or(IsChatTextUp('Attack lv'))or(IsChatTextUp('Attack level'))or(IsChatTextUp('Attack lvl'))
      or(IsChatTextUp('Att lv'))or(IsChatTextUp('Att lvl'))or(IsChatTextUp('Att level')))then
        case Random(5) of
          0: LevelAskRoutine('Attack');
        end;

      Wait(1000 + Random(1000));

      //Level Asking (Strength)
      if((IsChatTextUp('strength lv'))or(IsChatTextUp('strength level'))or(IsChatTextUp('strength lvl'))
      or(IsChatTextUp('str lv'))or(IsChatTextUp('str lvl'))or(IsChatTextUp('str level'))
      or(IsChatTextUp('Strength lv'))or(IsChatTextUp('Strength level'))or(IsChatTextUp('Strength lvl'))
      or(IsChatTextUp('Str lv'))or(IsChatTextUp('Str lvl'))or(IsChatTextUp('Str level')))then
        case Random(5) of
          0: LevelAskRoutine('Strength');
        end;

      Wait(1000 + Random(1000));
       
      //Level Asking (Defence)
      if((IsChatTextUp('defence lv'))or(IsChatTextUp('defence level'))or(IsChatTextUp('defence lvl'))
      or(IsChatTextUp('def lv'))or(IsChatTextUp('def lvl'))or(IsChatTextUp('def level'))
      or(IsChatTextUp('Defence lv'))or(IsChatTextUp('Defence level'))or(IsChatTextUp('Defence lvl'))
      or(IsChatTextUp('Def lv'))or(IsChatTextUp('Def lvl'))or(IsChatTextUp('Def level')))then
        case Random(5) of
          0: LevelAskRoutine('Defence');
        end;
    end;

    begin
    SetUpSRL;
    repeat
    Wait(2000);
    AutoRespond;
    until(False);
    end.

    But the Function Used To Detect What Is Being Said dose Not Work Properly (IsChatTextUp) What Else could I use That Scans the hole of the chat box?

  2. #2
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Masterkill made a very nice one ask him, or look for yourself at his script :P

    [22:20] <[-jesus-]> freddy, go uninstall yourself

  3. #3
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Yeh, If it comes to the point to were I need to ask someone, I'll do it, but not unless it is totally nessary, as I like to make my own functions/procedures (Not saying anyones a bad scripter or anything.)

    Lol, and I like your sig its quite funny.

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

    Default

    Try this If(GetChatMessage).It works good

    ->{Nauman}<-

  5. #5
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Think your talking about someone elses function, its not in Text.scar (SRL Core)

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

    Default

    Might want to use this. It's not mine! All credit goes to CHaRmz_. Remember to credit him if it works.

    //----------------------------------------------------------------------------//
    //---> GetChatMessage Function //
    //----------------------------------------------------------------------------//

    Function GetChatMessage(Text: String): Boolean;
    Var
    TX, TY: Integer;
    Chat: String;
    Begin

    If(IsTextInAreaEx(40, 415, 130, 415, TX, TY, ':', 0, SmallChars, False, True, 0, 0, 0))then
    Begin
    Chat:= Lowercase(Trim(GetTextAtEx(TX + 8, 415, 0, SmallChars, False, False, 0, 1, 16711680, 40, False, TR_AllChars)));

    If(Pos(Text, Chat) <> 0)then
    Begin
    Result:= True;
    End

    End

    End;


    ->{Nauman}<-

  7. #7
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Sorry, before I end up getting flamed or something. Im not going to use the Function without Permission unless it say on any of his threads that people can freely use his functions/procedures

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

    Default

    Ok fine but i think if you credit him and say you love him and all this other stuff. I dont see a problem why you cant use it if your desperate.

    ->{Nauman}<-

  9. #9
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cathering_ View Post
    Yeh, If it comes to the point to were I need to ask someone, I'll do it, but not unless it is totally nessary, as I like to make my own functions/procedures (Not saying anyones a bad scripter or anything.)

    Lol, and I like your sig its quite funny.
    thanks well I can't help you im sorry

    [22:20] <[-jesus-]> freddy, go uninstall yourself

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 Do I Add A Auto Responder?
    By gamer 5 in forum OSR Help
    Replies: 6
    Last Post: 12-01-2007, 06:21 AM

Posting Permissions

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