Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SendChatText

From RoR Wiki
Revision as of 19:48, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Chat functions
Version: WAR 1.4.8

Sends a line of chat text or a slash command, exactly as if the player had typed it.

SendChatText(text, channel)

Arguments

text
wstring – The text or slash command, for example L"/afk" or L"Hello".
channel
wstring – Channel command to put in front of text, for example L"/guild", or L"".

Returns

Nothing.

Details

  • Only one call per frame is processed. The client remembers the frame of the last call; any further call in the same frame is ignored, even if its arguments are wrong. Spread several commands over several frames (for example with an OnUpdate handler).
  • If text is empty, nothing happens.
  • text is first handled on its own as a chat command. If it is not handled that way, the client builds channel.." "..text, or "/say "..text when channel is empty, and handles that. The built line is limited to 1050 characters.
  • The stock UI uses this function both for normal chat (passing the current channel's server command) and for many slash commands with an empty channel.
  • The function needs at least two arguments and only reads the last two.

Errors

None besides the generic Invalid Parameters message when an argument is not a wide string.

Example

Sending a slash command, from default/ea_socialwindow/source/socialwindowtaboptions.lua:

SendChatText(  L"/afk "..afkNote, L"" )

Sending what the player typed to the current channel, from default/ea_chatwindow/source/chatwindow.lua:

if( chatText ~= L"" )
then
    SendChatText( chatText, chatChannel )
end

See also