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

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import of LLM wiki pages)
(XML import)
 
Line 1: Line 1:
 
 
 
<span id="bpsend_done"></span>
 
<span id="bpsend_done"></span>
  
Line 43: Line 41:
 
         act_str:string;
 
         act_str:string;
 
  code
 
  code
{
+
dilend
i:=atoi (arg);
 
if (i&lt;0)
 
        {
 
        exec ("look "+arg,self);
 
        goto read_quit;
 
        }
 
  
  if (itoa (i)!=arg)
+
  ---~---~---~---~---~---~---~---~---
        {
 
        exec ("look "+arg,self);
 
        goto read_quit;
 
        }
 
  
  u:=self.outside.inside;
+
  </i><!--ENDCODE-->
while (u!=null)
+
<span id="bpsend_done"></span>
        {
 
        if ((u.type==UNIT_ST_OBJ) and (u.objecttype==ITEM_BOARD))
 
                break;
 
        u:=u.next;
 
        }
 
  
  if (u==null)
+
  '''Function:'''</i><!--ENDCODE-->
        {
+
send_done( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr);</i><!--ENDCODE-->
        act ("You do not see that here.",A_ALWAYS,self,null,null,TO_CHAR);
 
        quit;
 
        }
 
  
                if (u.extra.["$BOARD_L_RES"].descr!="")
+
<!--TERM-->  '''c'''
                {
+
<!--DEFINITION-->        the command string that is sending the message
                act_str:=u.extra.["$BOARD_L_RES"].descr(self,u);
+
<!--TERM-->  '''a'''
                if (act_str!="")
+
<!--DEFINITION-->        the unitptr (activator) that activated the message
                {
+
<!--TERM-->  '''m'''
        act(act_str,
+
<!--DEFINITION-->        the unitptr (medium) that the Dil is acting through
                        A_ALWAYS,self,null,null,TO_CHAR);
+
<!--TERM-->  '''t'''
                quit;
+
<!--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
  
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;
pagestring(buff,self);
+
        templist:stringlist;
 
+
        buff:string;
:read_quit:
+
        f_name:string;
  send_done("read",self,null,u,0,arg,null);
+
        act_str:string;
quit;
+
  code
  }
+
dilend
dilend
 
  
 
  ---~---~---~---~---~---~---~---~---
 
  ---~---~---~---~---~---~---~---~---
  
 
  </i><!--ENDCODE-->
 
  </i><!--ENDCODE-->

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

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