Results 1 to 10 of 10

Thread: How can I search black text in chatbox?

  1. #1
    Join Date
    Dec 2009
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How can I search black text in chatbox?

    I tried this but it apparently doesn't work anymore even though it is still in the manual:

    function IsChatBlackTextAnyLine(ChatTxt: String): Boolean;
    By: Wizzup?
    Description:
    Returns true if ChatTxt is found in any of the 8 lines in ChatBox.

    So, if this is broken/nonfunctional/whatever, can someone please tell me what a good workaround would be?

    Thanks!

  2. #2
    Join Date
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I cant find that in the SRL chat.scar,
    use this:
    SCAR Code:
    IsChatBoxTextAnyLine('String', clBlack);
    Last edited by jimmy_mac; 02-03-2010 at 07:50 AM.

  3. #3
    Join Date
    Dec 2009
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well what upsets me is there is no comprehensive and up to date reference for what is in scar or srl. I found this function in the C:\Program Files\SCAR 3.22\Help\SRL.html file and it sucks that it is out of date and there is no way to tell. I certainly would love to help update it but someone else would have to be the pointman on it as I don't have the background or expertise to do it properly. But I would certainly contribute at least 4 hours per week to getting it updated if someone wants to take the lead.

    But, enough of my ranting, thank you for the information and I will certainly try out your suggestion.

    JIM

  4. #4
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    I think the chat box functions are outdated.

  5. #5
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    FindBlackChatMessage('');
    I'm using it right now. Works fine for me. It only searches for the last line though AFAIK.
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  6. #6
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Bionicle, it is actually working for you?
    Do you put the whole line in or only a part?

  7. #7
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by bionicle1800 View Post
    SCAR Code:
    FindBlackChatMessage('');
    I'm using it right now. Works fine for me. It only searches for the last line though AFAIK.
    Is the same thing I use to detect the tunnel entrances when entering abyss... I'm pretty sure it only picks up the bottom line, and it works.

  8. #8
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    That is soo weird...
    SCAR Code:
    function WaitUntilMined(Rock: TOre): Boolean;
    var
      GetAnimationTime, T, CX, CY, IC, P: Integer;
    begin
      Status('Walking to Rock');
      MarkTime(t);
      SetColorspeed2Modifiers(Rock.Hue, Rock.Sat);
      repeat
        Wait(10);
        if (TimeFromMark(t) >= 6000) then Exit;
      until (not FlagPresent) and FindBlackChatMessage('u swi') and
        (FindColorTolerance(cx, cy, Rock.Color, MSCX-65, MSCY-65, MSCX+65, MSCY+65, Rock.Tol));
      Status('Mining Rock');
      IC := InvCount;
      MarkTime(t);
      repeat
        Wait(10);
        if (TimeFromMark(t) >= 12000) then Exit;
        Wait(750);  //was 500
        if ClickContinue(false, false) then
        begin
          Inc(Stats_CustomVars[13]);
          TakePic;
        end;
        if IC < InvCount then Break;
      until (GetAnimation <= 0);
      if FindBlackChatMessage('You manage') then
      Begin
        Inc(Mined);
        WriteLn('Success!');
        Writeln(Mined);
        Inc(Players[CurrentPlayer].Integers[10]);
        Inc(Stats_CustomVars[1]);
        case Players[CurrentPlayer].Strings[1] Of
            'copper' :  Inc(Stats_CustomVars[6]);
            'tin' :    Inc(Stats_CustomVars[7]);
            'iron' :    Inc(Stats_CustomVars[8]);
            'coal' :    Inc(Stats_CustomVars[11]);
            'mith' :    Inc(Stats_CustomVars[12]);
        End;
      End;
      Result := True;
    end;
    It only sometimes detects the last line for me... :S

  9. #9
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    use like

    SCAR Code:
    if (Pos('anage', GetBlackChatMessage) > 0) then

  10. #10
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    That is soo weird...
    SCAR Code:
    function WaitUntilMined(Rock: TOre): Boolean;
    var
      GetAnimationTime, T, CX, CY, IC, P: Integer;
    begin
      Status('Walking to Rock');
      MarkTime(t);
      SetColorspeed2Modifiers(Rock.Hue, Rock.Sat);
      repeat
        Wait(10);
        if (TimeFromMark(t) >= 6000) then Exit;
      until (not FlagPresent) and FindBlackChatMessage('u swi') and
        (FindColorTolerance(cx, cy, Rock.Color, MSCX-65, MSCY-65, MSCX+65, MSCY+65, Rock.Tol));
      Status('Mining Rock');
      IC := InvCount;
      MarkTime(t);
      repeat
        Wait(10);
        if (TimeFromMark(t) >= 12000) then Exit;
        Wait(750);  //was 500
        if ClickContinue(false, false) then
        begin
          Inc(Stats_CustomVars[13]);
          TakePic;
        end;
        if IC < InvCount then Break;
      until (GetAnimation <= 0);
      if FindBlackChatMessage('You manage') then
      Begin
        Inc(Mined);
        WriteLn('Success!');
        Writeln(Mined);
        Inc(Players[CurrentPlayer].Integers[10]);
        Inc(Stats_CustomVars[1]);
        case Players[CurrentPlayer].Strings[1] Of
            'copper' :  Inc(Stats_CustomVars[6]);
            'tin' :    Inc(Stats_CustomVars[7]);
            'iron' :    Inc(Stats_CustomVars[8]);
            'coal' :    Inc(Stats_CustomVars[11]);
            'mith' :    Inc(Stats_CustomVars[12]);
        End;
      End;
      Result := True;
    end;
    It only sometimes detects the last line for me... :S
    Try
    SCAR Code:
    if FindBlackChatMessage('mine some ore.') then
    I'm assuming this is for your T.E.M.P. script I always use the last part of the line, or the whole line...i don't know if it makes a difference though.

    Eg:
    SCAR Code:
    If FindBlackChatMessage('Your inventory is too full to hold any more logs.') Then
    SCAR Code:
    If FindBlackChatMessage('You need a Woodcutting level of 30 to chop down this tree.') Then
    SCAR Code:
    If FindBlackChatMessage('t light a fire here.') Then
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

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
  •