Difference between revisions of "MUDL:send msgs for ask"

From SlothMUD Wiki
Jump to: navigation, search
(Created page with "{|class="abilitiestable" border="0" cellspacing="0" cellpadding="0" ! Function Name | send_msgs_for_ask |- ! Settable | No |- ! Returns | Boolean |} {|class="abilitiestable"...")
 
Line 1: Line 1:
 +
 +
__TOC__
 +
 +
 +
= Summary =
 +
 
{|class="abilitiestable" border="0" cellspacing="0" cellpadding="0"
 
{|class="abilitiestable" border="0" cellspacing="0" cellpadding="0"
 
! Function Name
 
! Function Name
Line 10: Line 16:
 
|}
 
|}
  
 +
 +
This function sends the appropriate messages for an "ask" command.  It is most likely to be used inside the intercept_ask function.  The function returns TRUE if all the parameters are valid and FALSE otherwise.
 +
 +
 +
= Parameters =
  
 
{|class="abilitiestable" border="0" cellspacing="0" cellpadding="0"
 
{|class="abilitiestable" border="0" cellspacing="0" cellpadding="0"
Line 29: Line 40:
 
| The text to be heard by the second actor.
 
| The text to be heard by the second actor.
 
|}
 
|}
 +
 +
 +
= Output =
 +
 +
{|class="abilitiestable" border="0" cellspacing="0" cellpadding="0"
 +
! Person
 +
! Message Sent
 +
|-
 +
| Actor
 +
| You ask <Second Actor> [about] <question>.
 +
|-
 +
| Second Actor
 +
| <Actor> asks you [about] <question>.
 +
|-
 +
| Others in Room
 +
| <Actor> asks <Second Actor> a question.
 +
|}
 +
 +
 +
= Example =
 +
<pre>
 +
addproc template mudl
 +
setproc template 0 intercept_ask_bss
 +
 +
if ('quest' = %s[1],
 +
(
 +
    send_msgs_for_ask(%a, %c, %1, %2, %3),
 +
 +
    cmd(%c, 'say Yes I have a quest for you!'),
 +
    set(flag(%f, 'procedure-flags', 'overrode-command'), true),
 +
    msg_character(%a, 'Procedure flag = ' + %f),
 +
    return(true)
 +
)),
 +
return(false)
 +
@
 +
 +
setproc template 0 PROC_ENABLED 1
 +
compile
 +
</pre>
 +
 +
 +
[[Category:Building]]
 +
[[Category:MUDL|send_msgs_for_ask]]

Revision as of 21:44, 4 March 2016


Summary

Function Name send_msgs_for_ask
Settable No
Returns Boolean


This function sends the appropriate messages for an "ask" command. It is most likely to be used inside the intercept_ask function. The function returns TRUE if all the parameters are valid and FALSE otherwise.


Parameters

Arguments
Character Actor performing the ask command.
Character Second Actor receiving the ask command.
Boolean Whether the Actor typed "about" as part of the question.
String The text to be spoken by the first actor.
String The text to be heard by the second actor.


Output

Person Message Sent
Actor You ask <Second Actor> [about] <question>.
Second Actor <Actor> asks you [about] <question>.
Others in Room <Actor> asks <Second Actor> a question.


Example

addproc template mudl
setproc template 0 intercept_ask_bss

if ('quest' = %s[1],
(
    send_msgs_for_ask(%a, %c, %1, %2, %3),

    cmd(%c, 'say Yes I have a quest for you!'),
    set(flag(%f, 'procedure-flags', 'overrode-command'), true),
    msg_character(%a, 'Procedure flag = ' + %f),
    return(true)
)),
return(false)
@

setproc template 0 PROC_ENABLED 1
compile