Vp say: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
(Created page with "{{sdk method page|say|Makes a bot say a message in the current world's chat channel. |paramex=message |parameters= {{sdk parameter row|string|message|Chat message}} |ret...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
   {{sdk parameter row|string|message|Chat message}}
   {{sdk parameter row|string|message|Chat message}}
|returncodes=
|returncodes=
   {{sdk return code row|NOT_INITIALIZED|SDK not initialized with {{sdk method|init}} yet}}
   {{sdk return code row|not_in_world    |Bot is not currently in a world}}
  {{sdk return code row|NOT_IN_WORLD  |Bot is not currently in a world}}
   {{sdk return code row|string_too_long |Chat message exceeds 255 characters in length}}
   {{sdk return code row|STRING_TOO_LONG|Chat message exceeds 255 characters in length}}
|behavior=
|behavior=
Like normal chat from other users, the message will appear in the [[browser]] with standard black text formatting.
* This will trigger {{sdk event|chat}} for those who have subscribed to it. See {{sdk method|event_set}}.
* Like normal chat from other users, the message will appear in the [[browser]] with standard black text formatting.
|caveats=
|caveats=
The bot will not hear itself speak; it will not receive a {{sdk event|CHAT}} event for its own message.
* The bot will not hear itself speak; it will not receive a {{sdk event|CHAT}} event for its own message.
|seealso=
|seealso=
* {{sdk method|console_message}}
* {{sdk method|console_message}}
}}
}}

Latest revision as of 01:05, 18 December 2016

Method call snippet vp_say(instance, message);

Makes a bot say a message in the current world's chat channel.

Parameters

These are the parameters that this method requires:

Parameter Usage
VPInstance
instance
Pointer to the instance this method call is intended for
string
message
Chat message

Returns

This method returns a return code integer, which indicates whether the call was successful or errored for any reason:

Return code Cause
VP_RC_SUCCESS Successful call (for methods that have a registered callback, it only means the request has been sent)
VP_RC_NOT_IN_WORLD Bot is not currently in a world
VP_RC_STRING_TOO_LONG Chat message exceeds 255 characters in length

Behavior

  • This will trigger VP_EVENT_CHAT for those who have subscribed to it. See vp_event_set().
  • Like normal chat from other users, the message will appear in the browser with standard black text formatting.

Caveats

  • The bot will not hear itself speak; it will not receive a VP_EVENT_CHAT event for its own message.

Examples

This method has no usage examples; please add at least one to this page

See also