Results 1 to 6 of 6

Thread: isblacktext help

  1. #1
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default isblacktext help

    How do I make a wait procedure

    wait(until(isblacktest 'blah'))); ?
    "SRL is the best SCAR community in the World, with the most talented programmers: adjust your volume."
    -Wizzup?

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Explain it better. For rs? (if so, when is text even black)?
    If its not for rs, then your going to have to create bitmap masks for every letter :/

  3. #3
    Join Date
    Sep 2006
    Posts
    322
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    for rs(you have mined rock)
    "SRL is the best SCAR community in the World, with the most talented programmers: adjust your volume."
    -Wizzup?

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Ohh ok.
    // * function GetChatBoxText(Line, TextCol: Integer): string;
    // * function FindChatBoxText(Line: Integer; Text: string; TextCol: Integer): Boolean;
    // * Function FindBlackChatMessage(ChatMsg: String): Boolean;
    // * function LastChatter(var name: String): Boolean;
    // * function GetLastChatText(var chat: String): Boolean; // * by masquerader
    // * function InChat(Text: String): Boolean;

    All from Chat.scar would be useful.

  5. #5
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function FindBlackChatMessageArr(Text: TStringArray) : Boolean;

    var
      i, o: Integer;

    begin
      o := High(Text);
      for i := 0 to o do
      if FindBlackChatMessage(Text[i]) then
      begin
        Result := True;
        Exit;
      end;
    end;

    function WaitBlackText(Text: TStringArray; MaxTime: Integer) : Boolean;

    var
      fs: Integer;

    begin
      MarkTime(fs);
      repeat
        Result := FindBlackChatMessageArr(Text);
        Wait(RandomRange(50, 100));
      until Result or (TimeFromMark(fs) >= MaxTime);
    end;
    from my AirCrafter.

    Usage: if WaitBlackText(['mined the rock', 'we have mined the rock', 'whatever string here'], 3000) then we-can-go-on

    MaxTime in ms.

    EDIT: Oh, and please credit if you decide to use this.

  6. #6
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    This could also be done with a while..do loop
    SCAR Code:
    var
      T : Integer;

    begin
      T := GetSystemTime + 2000
      while Condition or (GetSystemTime > T) do
        Wait(100);
    end.

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
  •