Results 1 to 2 of 2

Thread: auto respond

  1. #1
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default auto respond

    this is based off of the potato responder....actually this basically is the potato responder but it has more phrases(took them out. i just felt like it) but it seems to never find the chat or it finds its own and chats to itself. it also writes ":" after the name. any help greatly appreciated.

    SCAR Code:
    program New;
    {.include SRL/SRL.Scar}
    Var PotatoeText: array [1..59] of string;
          what,lol,Hi,lvl,how,doing,MLvl:integer;

    Const   NumberOfUsers  =    1;
            StartPlayer    =    0;

    Procedure DeclarePlayers;
      Begin
         HowManyPlayers := NumberOfUsers;
         NumberOfPlayers( HowManyPlayers );
         CurrentPlayer := StartPlayer;

         Players[0].Name :='';
         Players[0].Pass :='';
         Players[0].Nick :='';
         Players[0].Active:=False;


        Writeln( IntToStr ( HowManyPlayers ) + ' Players' );
      End;

    {*******************************************************************************
    function InChat(Text : String) : Boolean;
    By:WT-Fakawi
    Description: Returns True if Text is in last Chat Message.
    *******************************************************************************}

    function InChat1(Text : String) : Boolean;
    begin
      if (pos(Text, TheLine) <> 0) then
        Result := True
    end;

    procedure PotatoeRespond;
    var
      TheResponce,level : String;

    begin
      PotatoeText[1]  := ''; // respond to doing & what
      PotatoeText[2]  := '';
      PotatoeText[3]  := '';
      PotatoeText[4]  := '';
      PotatoeText[5]  := '';
      PotatoeText[6]  := '';
      PotatoeText[7]  := '';
      PotatoeText[8]  := '';
      PotatoeText[9]  := '';

      PotatoeText[10] := ''; // lol
      PotatoeText[11] := '';
      PotatoeText[12] := '';
      PotatoeText[13] := '';
      PotatoeText[14] := '';
      PotatoeText[15] := '';
      PotatoeText[16] := '';
      PotatoeText[17] := '';
      PotatoeText[18] := '';
      PotatoeText[19] := '';

      PotatoeText[20] := ''; // hi
      PotatoeText[21] := '';
      PotatoeText[22] := '';
      PotatoeText[23] := '';
      PotatoeText[24] := '';
      PotatoeText[25] := '';
      PotatoeText[26] := '';
      PotatoeText[27] := '';
      PotatoeText[28] := '';
      PotatoeText[29] := '';

      PotatoeText[30] := ''; // mining lvl
      PotatoeText[31] := '';
      PotatoeText[32] := '';
      PotatoeText[33] := '';
      PotatoeText[34] := '';
      PotatoeText[35] := '';
      PotatoeText[36] := '';
      PotatoeText[37] := '';
      PotatoeText[38] := '';
      PotatoeText[39] := '';

      PotatoeText[40] := ''; // good
      PotatoeText[41] := '';
      PotatoeText[42] := '';
      PotatoeText[43] := '';
      PotatoeText[44] := '';
      PotatoeText[45] := '';
      PotatoeText[46] := '';
      PotatoeText[47] := '';
      PotatoeText[48] := '';
      PotatoeText[49] := '';

      PotatoeText[50] := ''; // nothing
      PotatoeText[51] := '';
      PotatoeText[52] := '';
      PotatoeText[53] := '';
      PotatoeText[54] := '';
      PotatoeText[55] := '';
      PotatoeText[56] := '';
      PotatoeText[57] := '';
      PotatoeText[58] := '';
      PotatoeText[59] := '';

      OldLine := TheLine;
      TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
      TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
      NewLine := TheLine;

      if OldLine <> NewLine then
        if (pos('yo', TheName) <> 0) or (pos(Players[CurrentPlayer].Nick, TheName) <> 0) then
        begin
        end  // skip our own text! and "you have etc...."
        else
        begin
          if ((inChat1('what') or inChat1('wat')) and (inChat1('doi') or inChat1('oin'))) then
          begin
            TheResponce := PotatoeText[what + 1];
            Wait(1000);
            TypeSend(TheResponce + ' ' + TheName)
            what := what + 1;
            if what > 10 then
              what := 1;
          end;
          if (inChat1('hah') or inChat1('heh') or inChat1('lol') or inChat1('lmao')) then
          begin
            TheResponce := PotatoeText[10 + lol];
            TypeSend(TheResponce);
            lol := lol + 1;
            if lol > 10 then
              lol := 1;
          end;
          if (inChat1('hey') or inChat1('hi') or inChat1('allo')) then
          begin
            TheResponce := PotatoeText[20 + Hi];
            TypeSend(TheResponce + ' ' + TheName);
            Hi := Hi + 1;
            if Hi > 10 then
              Hi := 1;
          end;
          if ((inChat1('mine') or inChat1('m') or inChat1('mining')) and (inChat1('lvl') or inChat1('level'))) then
          begin
            MLvl:=GetSkillLevel('mining')
            Level:=(inttostr(Mlvl))
            TheResponce := PotatoeText[30 + lvl];
            TypeSend(TheResponce + ' ' + (level));
            lvl := lvl + 1;
            if lvl > 10 then
              lvl := 1;
          end;
         if ((inChat1('how are') or inChat1('how r ') or inChat1('hwo r ') or inChat1('hwo are'))and(inChat1('you') or inChat1('yuo') or inChat1(' u ')))then
          begin
            TheResponce := PotatoeText[40 + how];
            TypeSend(TheResponce);
            how := how + 1;
            if how > 10 then
              how := 1;
          end;
          if ((inChat1('what are') or inChat1('what r ') or inChat1('wat r ') or inChat1('wat are'))and(inChat1('you') or inChat1('yuo') or inChat1(' u '))and(inChat1('oin')))then
          begin
            TheResponce := PotatoeText[50 + doing];
            TypeSend(TheResponce);
             doing:= doing + 1;
            if doing > 10 then
              doing := 1;
          end;
        end;
    end;



    begin
    SetupSrl;
    declareplayers;
    loginplayer;
    what:=0
    lol:=0
    hi:=0
    lvl:=0
    how:=0
    repeat
      wait(2000);
      PotatoeRespond;
    until (false)
    end.

  2. #2
    Join Date
    Mar 2007
    Posts
    82
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this looks really good. I think it is such a great idea.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Respond function...?
    By meese in forum OSR Help
    Replies: 4
    Last Post: 11-10-2008, 07:08 PM
  2. auto talk and respond???
    By legendaryhero90 in forum OSR Help
    Replies: 5
    Last Post: 03-04-2007, 05:22 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
  •