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

From DikuMUD Wiki
Jump to navigation Jump to search
(Adding new parameter to handle CMD_AUTO_)
(XML import)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
= senddone() =
+
<span id="bpsend_done"></span>
'''Function:'''
+
 
  send_done( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr, i : integer);
+
'''Function:'''</i><!--ENDCODE-->
 +
  send_done( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);</i><!--ENDCODE-->
  
 
  <!--TERM-->  '''c'''
 
  <!--TERM-->  '''c'''
Line 17: Line 18:
 
  <!--TERM-->  '''o'''
 
  <!--TERM-->  '''o'''
 
  <!--DEFINITION-->        the unitptr (other) you also want the message to go to
 
  <!--DEFINITION-->        the unitptr (other) you also want the message to go to
<!--TERM-->  '''i'''
 
<!--DEFINITION-->        CMD_AUTO_XXX to send a CMD_AUTO or 0
 
  
  
This sends the 'SFB_DONE' message to any dils that are waiting for it in the
+
  This sends the 'SFB_DONE' message to any dils that are waiting for it in the
surrounding area and to the other pointer if not null.  The following is just
+
  surrounding area and to the other pointer if not null.  The following is just
one example you can find many more in '''commands.zon'''
+
  one example you can find many more in '''commands.zon'''
 
 
'''Built-in variables''':
 
  activator : unitptr
 
  medium    : unitptr
 
  target    : unitptr
 
  argument  : string
 
  power    : integer
 
  
 
  '''Example:'''
 
  '''Example:'''
 +
<i><!--CODE-->
 +
---~---~---~---~---~---~---~---~---
  
 
  dilbegin do_read (arg:string);
 
  dilbegin do_read (arg:string);
Line 47: Line 41:
 
         act_str:string;
 
         act_str:string;
 
  code
 
  code
  {
+
dilend
  i:=atoi (arg);
+
 
  if (i&lt;0)
+
  ---~---~---~---~---~---~---~---~---
        {
+
 
        exec ("look "+arg,self);
+
</i><!--ENDCODE-->
        goto read_quit;
+
<span id="bpsend_done"></span>
        }
+
 
   
+
  '''Function:'''</i><!--ENDCODE-->
if (itoa (i)!=arg)
+
send_done( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);</i><!--ENDCODE-->
        {
+
 
        exec ("look "+arg,self);
+
<!--TERM-->  '''c'''
        goto read_quit;
+
  <!--DEFINITION-->        the command string that is sending the message
        }
+
  <!--TERM-->  '''a'''
   
+
  <!--DEFINITION-->        the unitptr (activator) that activated the message
  u:=self.outside.inside;
+
  <!--TERM-->  '''m'''
  while (u!=null)
+
  <!--DEFINITION-->        the unitptr (medium) that the Dil is acting through
        {
+
<!--TERM-->  '''t'''
        if ((u.type==UNIT_ST_OBJ) and (u.objecttype==ITEM_BOARD))
+
<!--DEFINITION-->        the unitptr (target) the Dil is acting on
                break;
+
<!--TERM-->  '''p'''
        u:=u.next;
+
<!--DEFINITION-->        the power of the message
        }
+
  <!--TERM-->  '''arg'''
   
+
<!--DEFINITION-->        the argument sent with the message
  if (u==null)
+
<!--TERM-->  '''o'''
        {
+
<!--DEFINITION-->        the unitptr (other) you also want the message to go to
        act ("You do not see that here.",A_ALWAYS,self,null,null,TO_CHAR);
 
        quit;
 
        }
 
   
 
                if (u.extra.["$BOARD_L_RES"].descr!="")
 
                {
 
                act_str:=u.extra.["$BOARD_L_RES"].descr(self,u);
 
                if (act_str!="")
 
                {
 
        act(act_str,
 
                        A_ALWAYS,self,null,null,TO_CHAR);
 
                quit;
 
                }
 
                }
 
  
brdname:=u.names.[length (u.names)-1];
 
i:=loadstr (brdname+".idx",temp);
 
if (i&lt;=0)
 
        {
 
        act ("But the board is empty!",
 
                A_ALWAYS,self,null,null,TO_CHAR);
 
        goto read_quit;
 
        }
 
  
templist:=split(temp,"&amp;x");
+
  This sends the 'SFB_DONE' message to any dils that are waiting for it in the
ln:=length (templist);
+
  surrounding area and to the other pointer if not nullThe following is just
x:="$BOARD_MAX" in self.extra;
+
  one example you can find many more in '''commands.zon'''
if ((atoi(arg)>atoi(x.descr)) or
 
  (atoi(arg)>ln))
 
        {
 
        act("That message exists only within the boundaries of your mind.",
 
                A_ALWAYS,self,null,null,TO_CHAR);
 
        goto read_quit;
 
        }
 
  
  i:=atoi(arg);
+
  '''Example:'''
  temp:=templist.[i-1];
+
  <i><!--CODE-->
  f_name:=getword(temp);
+
  ---~---~---~---~---~---~---~---~---
i:=loadstr (brdname+"."+f_name,buff);
 
if (i==0)
 
        {
 
        sendtext("You have to let the poster finish the post before reading it.",self);
 
        quit;
 
        }
 
if (i&lt;1)
 
        {
 
        log("05: Error when loading board info.");
 
        act ("This board is not working report to an Administrator",
 
                A_ALWAYS,self,null,null,TO_CHAR);
 
                quit;
 
                }
 
  
  templist:=split(f_name,".");
+
  dilbegin do_read (arg:string);
  if (length(templist)&lt;2)
+
  var
         act ("Message "+arg+": "+temp,
+
brdname:string;
                A_ALWAYS,self,null,null,TO_CHAR);
+
        i:integer;
else
+
        u:unitptr;
         act ("Message "+arg+": Re"+temp,
+
        x:extraptr;
                A_ALWAYS,self,null,null,TO_CHAR);
+
         ln:integer;
 +
        temp:string;
 +
        templist:stringlist;
 +
        buff:string;
 +
         f_name:string;
 +
        act_str:string;
 +
  code
 +
dilend
  
  pagestring(buff,self);
+
  ---~---~---~---~---~---~---~---~---
  
  :read_quit:
+
  </i><!--ENDCODE-->
  send_done("read",self,null,u,0,arg,null,0);
 
quit;
 
}
 
dilend
 

Latest revision as of 22:36, 4 December 2025

Function:
send_done( 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


  This sends the 'SFB_DONE' message to any dils that are waiting for it in the
  surrounding area and to the other pointer if not null.  The following is just
  one example you can find many more in commands.zon
Example:

---~---~---~---~---~---~---~---~---
dilbegin do_read (arg:string);
var
brdname:string;
        i:integer;
        u:unitptr;
        x:extraptr;
        ln:integer;
        temp:string;
        templist:stringlist;
        buff:string;
        f_name:string;
        act_str:string;
code

dilend

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

Function:
send_done( 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


  This sends the 'SFB_DONE' message to any dils that are waiting for it in the
  surrounding area and to the other pointer if not null.  The following is just
  one example you can find many more in commands.zon
Example:

---~---~---~---~---~---~---~---~---
dilbegin do_read (arg:string);
var
brdname:string;
        i:integer;
        u:unitptr;
        x:extraptr;
        ln:integer;
        temp:string;
        templist:stringlist;
        buff:string;
        f_name:string;
        act_str:string;
code

dilend

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