Log in

View Full Version : Detect Game Text?



halgboy_tbc
04-19-2012, 09:10 PM
What can I do to detect if a certain statement is written in the rs chat box (black, regular text, like "Welcome to Runescape") so I can trigger an action?

Thanks.

Abu
04-19-2012, 09:12 PM
You can use this:
(*
GetChatBoxText
~~~~~~~~~~~~~~

.. code-block:: pascal

function GetChatBoxText(Line, TextCol: Integer): string;

Gets text on the line Line with colour TextCol.
(Line 1 is the top, Line 8 is the bottom line).
Colours:

- clMessage/clBlack - Black text messages ("Oh Dear you are dead", etc).
- clChat/clBlue - Chat messages from you and other players.
- clTrade/clPurple - Colour of trade request text.
- clFriend - Colour of friend and clan chat.

Works with other colours too.


.. note::

by ZephyrsFury

Example:

.. code-block:: pascal


*)

or preferably this:
(*
FindBlackChatMessage
~~~~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function FindBlackChatMessage(ChatMsg: String): Boolean;

Returns True if text with color 0 in last chat line is found.

.. note::

by Wizzup?

Example:

.. code-block:: pascal


*)

halgboy_tbc
04-20-2012, 10:03 PM
Thanks for this and also your DTM guide, which I was reading yesterday.

Abu
04-20-2012, 10:04 PM
Thanks for this and also your DTM guide, which I was reading yesterday.

No problem ;)

Me be a king :D