How about something like this.
on text !command {
set %command $nick
ns status $nick
}
on notice {
if %command && identified {
do command here
}
}
There will be some lag time since you'd have to wait for nickserv to reply. You could also save a variable saying that nick is identified and just check that and skip checking if identified each time.
Or
Like I have with a bot of mine. I type a login command and then I have unlimited access for a set time before I have to login again.
Some code for that. (feel lucky, never shared code from this bot ^_^)
on text if ($1 == ~login) && ($address($nick,7) isin %loadnicks) { set -u10 $+(%,$nick,.ns.status) $nick | ns status $nick }
on ^*:notice:*:*:{
if ($nick == nickserv) && ($1 == STATUS) && ($2 == $($+(%,$2,.ns.status),2)) && ($3 isnum) {
if ($3 == 3) {
set -u1800 $+(%,$2,.login) true
.timer $+ $+($2,.login) 1 1680 .msg = $+ $2 2 minutes till log off
.timer $+ $+($2,.loginup) 1 1800 .msg = $+ $2 your time is up
.msg = $+ $2 welcome to $me $+ 's admin system (to logout manually type ~logoff)
}
halt
}
}
You could remove the timer from the variable and just have it remove that when the person parts/quits from the chan, so it checks if they are identified next time they join. Might also want those variables to be removed when your mirc closes.