Chat Listener

The Chat Listener is a tool that allows you to listen for chat messages and run OnMessage callbacks which should be thread safe.

You can debug incoming messages by adding this compiler directive before you include WaspLib:

{$DEFINE WL_DEBUG_CHAT_LISTENER}

For more information on listeners and how to run them check Listeners.


TChatMessage type

Type representing a chat message.


ChatListener.GetIronManType

function TChatListener.GetIronManType(trgt: TTarget) : ERSIronMan;

Very similar to Chat.GetIronManType.

Returns the account ironman type.

Example:

WriteLn ChatListener.GetIronManType(Target);

ChatListener.GetMessage

function TChatListener.GetMessage(trgt: TTarget; line: Integer): TChatMessage;

Very similar to Chat.GetMessage when the chat is not transparent in how it works.

Gets the message on the last Chat line.

Example:

WriteLn ChatListener.GetMessage(Target, 5);

ChatListener.GetTransparentMessage

function TChatListener.GetTransparentMessage(trgt: TTarget; line: Integer): TChatMessage;

Very similar to Chat.GetMessage for transparent messages in how it works.

Gets the message on the last Chat line.

Example:

WriteLn ChatListener.GetTransparentMessage(Target, 5);

ChatListener.Check

function TChatListener.Check(): Boolean;

Returns true if there’s been new messages.

Example:

WriteLn ChatListener.Check();

ChatListener variable

Global TChatListener variable.