Skip to content

Manual:DIL Manual send pre()

iamnove edited this page Aug 24, 2022 · 51 revisions


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
{
   i:=send_pre("cmdtest",self,null,null,0,argument,null);
if (i == SFR_BLOCK)
  quit;
          sendtext ("No one blocked me!&n",self);
          quit;
          }
          dilend


dilbegin pretest();
code
{
   :loop:
   wait(SFB_PRE, command("cmdtest"));
   block;
        act("hahahaha I blocked your cmdtest command",
       A_SOMEONE, activator, medium, null, TO_ALL);
        goto loop;
}
dilend
---~---~---~---~---~---~---~---~---


---~---~---~---~---~---~---~---~---
Clone this wiki locally