I'm not sure where it adds the host($address) to ident the one who is doing the on chat request.
I have no idea what your talking about about this, u never had any code to that effect that i saw.
* i have tested my code now and repaired it, it had a few small errors, i now think are all corrected *
[code]alias add.admin {
var %nick = $iif($gettok($1,1,32),$v1,$iif(!$isid,$?="Nick to be added?"))
if (!%nick) { $iif($isid,return,echo -a) > No nick entered. | return }
if ($readini($botini,n,Admin,%nick)) { $iif($isid,return,echo -a) > %nick is already admin. | return }
var %pass = $remove($iif($2,$2,$iif(!$isid,$?="Password for %nick for access in bot? (without spaces)")),$chr(32))
if (!%pass) { $iif($isid,return,echo -a) > No pass entered. | return }
writeini $botini Admin %nick %pass
$iif($isid,return,echo -a) > %nick added as admin. | return
}
;
on *:chat:*:{
if (.pass != $strip($1)) && (!$($+(%,dccpass.,$nick),2)) { msg =$nick Invalid command. | close -c $nick | halt }
if (.pass == $strip($1)) && ( $($+(%,dccpass.,$nick),2)) { msg =$nick You already are identified. | halt }
if (.pass == $strip($1)) && (!$($+(%,dccpass.,$nick),2)) {
if (($strip($2)) && ($readini($botini,n,Admin,$nick) == $strip($2))) {
write data\online.txt $nick $address($nick,2) | msg =$nick Accepted password
![smile smile](/images/graemlins/mirc/smile.gif)
| mostra.codes | set $+(%,dccpass.,$nick) 1 | halt
}
else {
msg =$nick Invalid password. | close -c $nick | halt
}
}
}[code]
.
.
here is a break down of things u likely migth not know...
.
var %nick = $iif($gettok($1,1,32),$v1,$iif(!$isid,$?="Nick to be added?"))
var %nick = $iif(A,B,$iif(C,D))
A is a conditional test to see if the first word in $1 exists ($1 maybe more than one word if passed using $add.admin)
B is selected if A is true and value is A pulled from the $iif conditional test (shorter and faster than writing out all of A again)
C is a conditional test to see if you are NOT using $add.admin (i used this so $add.admin was automated, you never get prompted)
D is selected if C is true, and is a request prompt for nick
.
if (!%nick) { $iif($isid,return,echo -a) > No nick entered. | return }
if (A) { $iif(B,C,D) > No nick entered. | return }
A is a conditinal test to see if %nick does NOT exist
B use the RETURN command if in $add.admin
C use the ECHO -a command if not in $add.admin
.
if ($readini($botini,n,Admin,%nick)) { $iif($isid,return,echo -a) > %nick is already admin. | return }
if ($readini(A,B,C,D)) { $iif($isid,return,echo -a) > %nick is already admin. | return }
A is the ini filename
B is a switch meaning to not evaluate lines (ex a line might be $time, with out the ,n, u would get back 12:00:00 or what ever the time is)
C is the section header [section header]
D is the valuename valuename=value
* $readini returns value of valuename=value, so if it exists then thats the passord, thus user exists & return/echo message and exit
.
var %pass = $remove($iif($2,$2,$iif(!$isid,$?="Password for %nick for access in bot? (without spaces)")),$chr(32))
var %pass = $remove($iif(A,B,$iif(C,D)),$chr(32))
A is a conditional test to see if <password> was passed
B is the password
C is a conditional test to see if you are NOT using $add.admin (i used this so $add.admin was automated, you never get prompted)
D is selected if C is true, and is a request prompt for password
* $remove used to remove spaces from any password
.
if (!%pass) { $iif($isid,return,echo -a) > No pass entered. | return }
if (A) { $iif($isid,return,echo -a) > No pass entered. | return }
A is a conditinal test to see if %pass does NOT exist
.
if (.pass != $strip($1)) && (!$($+(%,dccpass.,$nick),2)) { msg =$nick Invalid command. | close -c $nick | halt }
if (.pass != $strip($1)) && (!$($+(A,B,C),2)) { msg =$nick Invalid command. | close -c $nick | halt }
A is the % sign in %dccpass.
$nick variable
B is the dccpass. in %dccpass.
$nick variable
C is the $nick in %dccpass.
$nick variable
$+( ) connects them all together to make %dccpass.
$nick (
$nick is of course the actual nickname)
$( ,2) cause mirc to know your not wanting the string litteral %dccpass.
$nick but the contents of that variable name
* so %dccpass.
$nick is essentially a nick specific %dccpass varaiable (dynamic variable name)
.
$+(%,dccpass.,$nick) 1
when setting a dynamic variable you dont encolse it in $( ,2) becuase u just need the name of the varaiable NOT its value