User Tools

Site Tools


addons:events

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
addons:events [2017/04/21 19:41]
atom0s
addons:events [2017/04/21 19:46]
atom0s
Line 146: Line 146:
 ashita.register_event('​incoming_text',​ function(mode,​ message, modifiedmode,​ modifiedmessage,​ blocked) ashita.register_event('​incoming_text',​ function(mode,​ message, modifiedmode,​ modifiedmessage,​ blocked)
     print('​Incoming text event fired!'​);​     print('​Incoming text event fired!'​);​
 +    return false;
 +end);
 +</​code>​
 +
 +**Parameters** \\
 +    * **mode** - (number) The chat mode of the message. (Controls the color of the overall message.)
 +    * **message** - (string) The message being added to the chat log.
 +    * **modifiedmode** - (number) The modified mode, if another addon or plugin has modified it.
 +    * **modifiedmessage** - (string) The modified message, if another addon or plugin has modified it.
 +    * **blocked** - (bool) True if the message has been blocked by another addon or plugin, false otherwise.
 +
 +**Returns** \\
 +    * **bool** - True if the message should be blocked, false otherwise.
 +    * or
 +    * **number** - The modified message mode to use instead of the current one.
 +    * or
 +    * **string** - The modified message to use instead of the current one.
 +    * or
 +    * **string, number** - The modified message and mode to use instead of the current ones.
 +
 +----
 +==== Event: outgoing_text =====
 +
 +Called when the game client is sending text to the server.\\
 +//(This gets called when a command, chat, etc. is not handled by the client and is being sent to the server.)//
 +
 +<code lua>
 +ashita.register_event('​outgoing_text',​ function(mode,​ message, modifiedmode,​ modifiedmessage,​ blocked)
 +    print('​Outgoing text event fired!'​);​
     return false;     return false;
 end); end);
addons/events.txt · Last modified: 2017/04/22 00:10 (external edit)