Difference between revisions of "Manual:DIL Manual/set password()"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
(XML import)
 
Line 1: Line 1:
 
 
 
<span id="bpsetpassword"></span>
 
<span id="bpsetpassword"></span>
  
Line 24: Line 22:
  
 
  code
 
  code
{
+
dilend
 +
 
  
if(self.type != UNIT_ST_PC) quit;
 
arg:="";
 
prmt:=self.prompt;
 
self.prompt:="Enter new password:  ";
 
wait (SFB_CMD,self==activator);
 
block;
 
tlist:=getwords (excmdstr);
 
if (length(tlist)>1){
 
sendtext ("Password must be only one word.  Try again.&amp;n",self);
 
self.prompt:=prmt;
 
quit;
 
}
 
if (length(excmdstr)&lt;5){
 
        sendtext ("Password to short. Password must be 5 characters or longer.\
 
Try again.&amp;n",self);
 
        self.prompt:=prmt;
 
        quit;
 
        }
 
  
if (length(excmdstr)>16){
 
        sendtext ("Password to long. Try again.&amp;n",self);
 
        self.prompt:=prmt;
 
        quit;
 
        }
 
  
        firstpwd:=excmdstr;
+
---~---~---~---~---~---~---~---~---
        self.prompt:="Enter password again";
+
 
 +
</i><!--ENDCODE-->
 +
<span id="bpsetpassword"></span>
 +
 
 +
'''Function:'''  <i><!--CODE-->set_password( u : unitptr, s : string ) ;</i><!--ENDCODE-->
 +
 
 +
<!--TERM-->  '''u'''
 +
<!--DEFINITION-->        the unit that you want to set the password of
 +
<!--TERM-->  '''s'''
 +
<!--DEFINITION-->        the password you are using to set
 +
 
 +
This function sets a unit password it only works on Players characters of corse.
 +
'''Example:'''
 +
<i><!--CODE-->
 +
---~---~---~---~---~---~---~---~---
 +
 
 +
dilbegin aware do_password (arg:string);
 +
  var
 +
        prmt:string;
 +
  firstpwd:string;
  
wait (SFB_CMD,self==activator);
+
  i:integer;
block;
+
  tlist:stringlist;
if (excmdstr!=firstpwd){
 
sendtext ("Passwords do not match try again.&amp;n",self);
 
self.prompt:=prmt;
 
quit;
 
}
 
set_password(self,excmdstr);
 
sendtext("Changed your Password to '"+excmdstr+"' Please write it down!&amp;n",self);
 
self.prompt:=prmt;
 
  
  quit;
+
  code
}
+
dilend
dilend
 
  
  

Latest revision as of 22:36, 4 December 2025

Function:  set_password( u : unitptr, s : string ) ;
  u
         the unit that you want to set the password of
  s
         the password you are using to set
This function sets a unit password it only works on Players characters of corse.
Example:

---~---~---~---~---~---~---~---~---
dilbegin aware do_password (arg:string);
var
        prmt:string;
 firstpwd:string;
 i:integer;
 tlist:stringlist;
code

dilend



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

Function:  set_password( u : unitptr, s : string ) ;
  u
         the unit that you want to set the password of
  s
         the password you are using to set
This function sets a unit password it only works on Players characters of corse.
Example:

---~---~---~---~---~---~---~---~---
dilbegin aware do_password (arg:string);
var
        prmt:string;
 firstpwd:string;
 i:integer;
 tlist:stringlist;
code

dilend



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