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

From SlothMUD Wiki
Jump to: navigation, search
(Example)
 
Line 61: Line 61:
 
= Example =
 
= Example =
 
<pre>
 
<pre>
addproc template mudl
+
addproc <mobile> mudl
setproc template 0 intercept_ask_bss
+
setproc <mobile> 0 intercept_ask_bss
  
 
if ('quest' = %s[1],
 
if ('quest' = %s[1],
Line 70: Line 70:
 
     cmd(%c, 'say Yes I have a quest for you!'),
 
     cmd(%c, 'say Yes I have a quest for you!'),
 
     set(flag(%f, 'procedure-flags', 'overrode-command'), true),
 
     set(flag(%f, 'procedure-flags', 'overrode-command'), true),
    msg_character(%a, 'Procedure flag = ' + %f),
 
 
     return(true)
 
     return(true)
 
)),
 
)),
Line 76: Line 75:
 
@
 
@
  
setproc template 0 PROC_ENABLED 1
+
setproc <mobile> 0 PROC_ENABLED 1
 
compile
 
compile
 
</pre>
 
</pre>

Latest revision as of 21:45, 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 <mobile> mudl
setproc <mobile> 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),
    return(true)
)),
return(false)
@

setproc <mobile> 0 PROC_ENABLED 1
compile