Results 1 to 10 of 10

Thread: On Screen text HELP!

  1. #1
    Join Date
    Jan 2013
    Posts
    167
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default On Screen text HELP!

    Okay so ive made this thieving bot but i need to know if theres a way to detect if something is said by a npc e.g 'Get your hands off there' so the script can stop thieving and kill the guard if anyone knows how to do that please tell me it would be greatly helpful
    Thanks

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Hexless View Post
    Okay so ive made this thieving bot but i need to know if theres a way to detect if something is said by a npc e.g 'Get your hands off there' so the script can stop thieving and kill the guard if anyone knows how to do that please tell me it would be greatly helpful
    Thanks
    If it shows on the chat, u can use function GetBlackChatMessage: string;

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Jan 2013
    Posts
    167
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    If it shows on the chat, u can use function GetBlackChatMessage: string;
    Ahhhhhhh..... so if some like 'You cannot steal during combat' appears in the chatbox will that work?

  4. #4
    Join Date
    May 2008
    Location
    Mental Hospital
    Posts
    414
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Detecting the overhead text wouldn't work too well since you wouldn't be able to distinguish who the guard is talking too. If that is what you are asking about that is.

  5. #5
    Join Date
    Jan 2013
    Posts
    167
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by Noob King View Post
    Detecting the overhead text wouldn't work too well since you wouldn't be able to distinguish who the guard is talking too. If that is what you are asking about that is.
    oh okay :\

  6. #6
    Join Date
    Jan 2013
    Posts
    167
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    If it shows on the chat, u can use function GetBlackChatMessage: string;
    also will this work with 07scape/oldscape?

  7. #7
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Hexless View Post
    also will this work with 07scape/oldscape?
    Probably got to edit the coords?

    Creds to DannyRS for this wonderful sig!

  8. #8
    Join Date
    Jan 2013
    Posts
    167
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Probably got to edit the coords?
    how do i do tht im new to this :\

  9. #9
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Hexless View Post
    how do i do tht im new to this :\
    I think this is the base function. (I used function list to search)
    So edit this: (I hope the fonts don't need changing )

    Simba Code:
    function GetChatBoxText(Line, TextCol: Integer): string;
    var
      P: TPoint;
      cArr: TPointArray;
      B: TBox;
    begin
      Result := '';
      P := TextCoords(Line);
      if (FindColorsTolerance(cArr, TextCol, MCX1, P.y, MCX2, P.y + 13, 0)) then
      begin
        B := GetTPABounds(cArr);
        result := Trim(GetTextAtExWrap(b.x1-1,p.y,B.x2+1,p.y+13,0,5,2,TextCol,0,SmallChars));
      end;
    end;

    Or simply use GetTextAtExWrap()

    Creds to DannyRS for this wonderful sig!

  10. #10
    Join Date
    Jan 2013
    Posts
    167
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    I think this is the base function. (I used function list to search)
    So edit this: (I hope the fonts don't need changing )

    Simba Code:
    function GetChatBoxText(Line, TextCol: Integer): string;
    var
      P: TPoint;
      cArr: TPointArray;
      B: TBox;
    begin
      Result := '';
      P := TextCoords(Line);
      if (FindColorsTolerance(cArr, TextCol, MCX1, P.y, MCX2, P.y + 13, 0)) then
      begin
        B := GetTPABounds(cArr);
        result := Trim(GetTextAtExWrap(b.x1-1,p.y,B.x2+1,p.y+13,0,5,2,TextCol,0,SmallChars));
      end;
    end;

    Or simply use GetTextAtExWrap()
    Thank you! ill try it out tomorrow

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
  •