SC2Mapster.com
Maps
Assets
Teams
Authors
Forums
Wiki
Paste
Sign in
Register new account
SC2Mapster.com Wiki
SC2 API
/
Functions
/
TriggerAddEventChatMessage
r8
Source
Markup:
<<apifunction>> <<name>>TriggerAddEventChatMessage<</name>> <<description>> <<code>>void TriggerAddEventChatMessage (trigger t, int player, string capture, bool strict);<</code>> Register a trigger that will be executed on Chat Messages <</description>> <<param trigger t>>The trigger that will be executed. Must have the following prototype: <<code>>bool name(bool checkConds, bool doActions);<</code>> * **checkConds** : always true? * **doActions** : always true? * The return value is used to increment either FailedConditions (when false) or Run in the debug trigger window<</param>> <<param int player>>The number of the player<</param>> <<param string capture>>The string you want to capture. This is case insensitive.<</param>> <<param bool strict>>* true: The chat message has to be exactly the capture string * false : The string to capture is a substring of the chat message<</param>> <<example Repeat Trigger>> // Define the trigger function bool TriggerRepeat (bool checkConds, bool doActions) { // Repeat what you said UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText(EventChatMessage(false))); return true; } // Create a new trigger based off the function trigger t = TriggerCreate("TriggerRepeat"); // Bind it to the Chat Message event TriggerAddEventChatMessage(t, 1, "repeat", false); // Whenever the player 1 will say something that contains the word "repeat" // It is going to call the trigger and repeat what he just said. <</example>> <<seealso>>EventChatMessage<</seealso>> <<seealso>>TriggerCreate<</seealso>> <<seealso>>TriggerAddEventMapInit <</seealso>> <</apifunction>>
Markup Type:
The type of markup for this entry.
Click here for details
.
BBCode
Markdown
Plain Text
WikiCreole