Difference between revisions of "Manual:DIL Manual/send done()"
Jump to navigation
Jump to search
(XML import of LLM wiki pages) |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | = | + | |
| − | '''Function:''' | + | |
| − | send_done( c : string, a :unitptr, m : unitptr, t :unitptr, p : integer, arg : string, o : unitptr); | + | <span id="bpsend_done"></span> |
| + | |||
| + | '''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 19: | Line 22: | ||
| − | 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''' |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
'''Example:''' | '''Example:''' | ||
| + | <i><!--CODE--> | ||
| + | ---~---~---~---~---~---~---~---~--- | ||
dilbegin do_read (arg:string); | dilbegin do_read (arg:string); | ||
| Line 46: | Line 44: | ||
code | code | ||
{ | { | ||
| − | + | i:=atoi (arg); | |
| − | + | if (i<0) | |
{ | { | ||
exec ("look "+arg,self); | exec ("look "+arg,self); | ||
goto read_quit; | goto read_quit; | ||
} | } | ||
| − | + | ||
if (itoa (i)!=arg) | if (itoa (i)!=arg) | ||
{ | { | ||
| Line 58: | Line 56: | ||
goto read_quit; | goto read_quit; | ||
} | } | ||
| − | + | ||
u:=self.outside.inside; | u:=self.outside.inside; | ||
while (u!=null) | while (u!=null) | ||
| Line 66: | Line 64: | ||
u:=u.next; | u:=u.next; | ||
} | } | ||
| − | + | ||
if (u==null) | if (u==null) | ||
{ | { | ||
| Line 72: | Line 70: | ||
quit; | quit; | ||
} | } | ||
| − | + | ||
if (u.extra.["$BOARD_L_RES"].descr!="") | if (u.extra.["$BOARD_L_RES"].descr!="") | ||
{ | { | ||
| Line 136: | Line 134: | ||
} | } | ||
dilend | dilend | ||
| + | |||
| + | ---~---~---~---~---~---~---~---~--- | ||
| + | |||
| + | </i><!--ENDCODE--> | ||
Latest revision as of 10:42, 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
{
i:=atoi (arg);
if (i<0)
{
exec ("look "+arg,self);
goto read_quit;
}
if (itoa (i)!=arg)
{
exec ("look "+arg,self);
goto read_quit;
}
u:=self.outside.inside;
while (u!=null)
{
if ((u.type==UNIT_ST_OBJ) and (u.objecttype==ITEM_BOARD))
break;
u:=u.next;
}
if (u==null)
{
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<=0)
{
act ("But the board is empty!",
A_ALWAYS,self,null,null,TO_CHAR);
goto read_quit;
}
templist:=split(temp,"&x");
ln:=length (templist);
x:="$BOARD_MAX" in self.extra;
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);
temp:=templist.[i-1];
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<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,".");
if (length(templist)<2)
act ("Message "+arg+": "+temp,
A_ALWAYS,self,null,null,TO_CHAR);
else
act ("Message "+arg+": Re: "+temp,
A_ALWAYS,self,null,null,TO_CHAR);
pagestring(buff,self);
:read_quit:
send_done("read",self,null,u,0,arg,null);
quit;
}
dilend
---~---~---~---~---~---~---~---~---