SRL Archive - Help

Detect Game Text?


halgboy_tbc

2012-04-19 17:10:43

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

2012-04-19 17:12:07

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

2012-04-20 18:03:42

Thanks for this and also your DTM guide, which I was reading yesterday.

Abu

2012-04-20 18:04:41

From: halgboy_tbc
Thanks for this and also your DTM guide, which I was reading yesterday.


No problem ;)

Me be a king :D