SC2Mapster.com Wiki

SC2 API / Functions / EventChatMessage

EventChatMessage

string EventChatMessage (bool strict);

Message content available on TriggerAddEventChatMessage callback

Since it's not possible to change the trigger prototype, additional arguments are accessed through function calls. When you are inside a trigger that has been bound thanks to TriggerAddEventChatMessage, you can call this function to get the full message.

Parameters

bool strict
  • true: return the substring that was matched.
  • false: return the entire string including matched substring.

Return value

string - The message that has been typed by the user

Examples

Example: Repeat Trigger
// Define the trigger function
bool TriggerRepeat (bool checkConds, bool doActions) {
    // Repeat what you said
    DebugString(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, "waves", false);

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of vjeux vjeux Mar 04, 2010 at 17:21 UTC - 0 likes

    I wonder what is being returned when called outside a trigger callback.

  • 1 comment

Facts

Date created
Mar 04, 2010
Last updated
Jul 29, 2010

Authors