Results 1 to 7 of 7

Thread: What am I doing wrong - Detecting chat text

  1. #1
    Join Date
    Aug 2010
    Location
    Slovenia
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default What am I doing wrong - Detecting chat text

    I'm trying to make it check all the lines in chat, but I can't get it to work. Could someone correct this or tell me what I should change.

    Code:
    procedure ChatCheck;
    var
      i, l : Integer;
      b : Boolean;
      TSA : TStringArray;
    begin
      TSA := ['.', 'boot', 'bot', 'boots', 'bots', 'booter', 'boter', 'booters', 'boting', 'booting', 'robot', 'legit', 'noob booters'];
    for i := 0 to High(TSA) do
     begin
       //Writeln('E1  i := ' + IntToStr(i));
     for l := 1 to 8 do
      begin
        //Writeln('E2');
      if (Pos(TSA[i], Lowercase(GetChatBoxText(l, clBlue))) > 0) then  //<----- :/
       begin
         //Writeln('E3');
         b := True;
         Wait(1);
       end else
         //Writeln('Text not found...');
      end;
     end;
    
    if b then
     begin
       Writeln('Someone is being gay..');
       Writeln('Logging out.');
       Wait(1000 + Random(1500));
       Logout; //change the world..
     end
    end;
    Last edited by Im4everlast; 06-12-2011 at 12:16 PM.

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

    Default

    Do you think you could put it in code tags instead of Simba tags please? But anyway, what problems are you having? Does it give an error, or does it just not detect the text?
    <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.

  3. #3
    Join Date
    Aug 2010
    Location
    Slovenia
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's just not detecting the text :/

  4. #4
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    This is how I detect Chat Text:

    if (pos('yourtext', GetBlackChatMessage) <> 0 ) then ...
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  5. #5
    Join Date
    Aug 2010
    Location
    Slovenia
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by WT-Fakawi View Post
    This is how I detect Chat Text:

    if (pos('yourtext', GetBlackChatMessage) <> 0 ) then ...
    This will only check chat line for the black text right? What I want to do is make it check all the lines for the blue text.

    Hm..what did I do wrong...

  6. #6
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Do <> 0 rather than > 0. Also the clBlue may be wrong. Pick the color you want in the chat box and use that instead.

  7. #7
    Join Date
    Aug 2010
    Location
    Slovenia
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, that worked! :-)

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
  •