Difference between revisions of "Manual:DIL Manual/send pre()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
(XML import)
 
Line 1: Line 1:
 +
<span id="bfsend_pre"></span>
 +
'''Function:'''</i><!--ENDCODE-->send_pre( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);</i><!--ENDCODE-->
 +
 +
<!--TERM-->  '''c'''
 +
<!--DEFINITION-->        the command string that is sending the message
 +
<!--TERM-->  '''a'''
 +
<!--DEFINITION-->        the unitptr (activator) that activated the message
 +
<!--TERM-->  '''m'''
 +
<!--DEFINITION-->        the unitptr (medium) that the Dil is acting through
 +
<!--TERM-->  '''t'''
 +
<!--DEFINITION-->        the unitptr (target) the Dil is acting on
 +
<!--TERM-->  '''p'''
 +
<!--DEFINITION-->        the power of the message
 +
<!--TERM-->  '''arg'''
 +
<!--DEFINITION-->        the argument sent with the message
 +
<!--TERM-->  '''o'''
 +
<!--DEFINITION-->        the unitptr (other) you also want the message to go to
 +
 +
 +
 +
New Function send_pre() takes same arguments as send_done but returns either
 +
  SFR_SHARE or SFR_BLOCK.
 +
If the command is blocked by another special or dil, then SFB_BLOCK will be returned,
 +
  and you should quit your dil.
 +
'''Example:'''
 +
<i><!--CODE-->
 +
---~---~---~---~---~---~---~---~---
  
 +
dilbegin cmdtst(arg : string);
 +
var
 +
  i : integer;
 +
code
 +
dilend
  
 +
 +
dilbegin pretest();
 +
code
 +
dilend
 +
 +
---~---~---~---~---~---~---~---~---
 +
 +
</i><!--ENDCODE-->
 +
 +
 +
---~---~---~---~---~---~---~---~---
 
<span id="bfsend_pre"></span>
 
<span id="bfsend_pre"></span>
 
  '''Function:'''</i><!--ENDCODE-->send_pre( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);</i><!--ENDCODE-->
 
  '''Function:'''</i><!--ENDCODE-->send_pre( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);</i><!--ENDCODE-->
Line 33: Line 76:
 
   i : integer;
 
   i : integer;
 
  code
 
  code
{
+
dilend
    i:=send_pre("cmdtest",self,null,null,0,argument,null);
 
 
 
if (i == SFR_BLOCK)
 
  quit;
 
 
 
          sendtext ("No one blocked me!&amp;n",self);
 
          quit;
 
          }
 
          dilend
 
  
  
 
  dilbegin pretest();
 
  dilbegin pretest();
 
  code
 
  code
{
+
dilend
    :loop:
 
    wait(SFB_PRE, command("cmdtest"));
 
    block;
 
        act("hahahaha I blocked your cmdtest command",
 
        A_SOMEONE, activator, medium, null, TO_ALL);
 
        goto loop;
 
}
 
dilend
 
  
 
  ---~---~---~---~---~---~---~---~---
 
  ---~---~---~---~---~---~---~---~---

Latest revision as of 22:33, 4 December 2025

Function:send_pre( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);
  c
         the command string that is sending the message
  a
         the unitptr (activator) that activated the message
  m
         the unitptr (medium) that the Dil is acting through
  t
         the unitptr (target) the Dil is acting on
  p
         the power of the message
  arg
         the argument sent with the message
  o
         the unitptr (other) you also want the message to go to


New Function send_pre() takes same arguments as send_done but returns either
 SFR_SHARE or SFR_BLOCK.
If the command is blocked by another special or dil, then SFB_BLOCK will be returned,
 and you should quit your dil.
Example:

---~---~---~---~---~---~---~---~---
dilbegin cmdtst(arg : string);
var
  i : integer;
code

dilend


dilbegin pretest();
code

dilend

---~---~---~---~---~---~---~---~---


---~---~---~---~---~---~---~---~---

Function:send_pre( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);
  c
         the command string that is sending the message
  a
         the unitptr (activator) that activated the message
  m
         the unitptr (medium) that the Dil is acting through
  t
         the unitptr (target) the Dil is acting on
  p
         the power of the message
  arg
         the argument sent with the message
  o
         the unitptr (other) you also want the message to go to


New Function send_pre() takes same arguments as send_done but returns either
 SFR_SHARE or SFR_BLOCK.
If the command is blocked by another special or dil, then SFB_BLOCK will be returned,
 and you should quit your dil.
Example:

---~---~---~---~---~---~---~---~---
dilbegin cmdtst(arg : string);
var
  i : integer;
code

dilend


dilbegin pretest();
code

dilend

---~---~---~---~---~---~---~---~---


---~---~---~---~---~---~---~---~---