mIRC Home    About    Download    Register    News    Help

Print Thread
#210264 09/03/09 08:23 PM
Joined: Mar 2009
Posts: 3
D
DrSlony Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Mar 2009
Posts: 3
Hey

We have a script that passes a virtual cup or crown around on our GTA2 channel. We need it to check if a nick has identified with nickserv, and if he has been online or identified for at least 5 seconds, before he can !passcup or !passcrown. All those who want to be legible for the cup or crown have to register with nickserv beforehand.

How do we check:
1- whether a nick has identified with nickserv?
2- how long a nick is online?

DrSlony #210268 09/03/09 09:42 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You can use /msg nickserv status <nick> to determine if the user of the active nick has identified for the nick or not.
For details regarding the return from this command see /msg nickserv status help

As to the amount of time online, you would have to perform a /whois on the nick.

Most networks that have nickserv only allow a minute for the nick to be identified for (presuming that the nick is registered), so you can estimate how long it's been since a nick was identified for by using something like $calc($ctime - <sign-in time> - 60)

RusselB #210269 09/03/09 09:46 PM
Joined: Mar 2009
Posts: 3
D
DrSlony Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Mar 2009
Posts: 3
How do I have the script "read" the output of /msg nickserv status nick?
Can you give an example?

DrSlony #210270 09/03/09 11:24 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You need to use the ON NOTICE event.

Code:
on *:notice:STATUS & &:*:{
  if $nick == nickserv {
    if $3 == 0 {
      echo -a $2 not online or not registered
    }
    elseif $3 == 1 {
      echo -a user not recognized as the owner of $2
    }
    elseif $3 == 2 {
      echo -a user recognized as owner of $2 via access list
authorization
    }
    else {
      echo -a user recognized as owner of $2 via password identification
    }
  }
}


RusselB #210281 10/03/09 01:01 PM
Joined: Mar 2009
Posts: 3
D
DrSlony Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Mar 2009
Posts: 3
Thank you kindly smile


Link Copied to Clipboard