mIRC Home    About    Download    Register    News    Help

Print Thread
Script Check If Nick Is Identified #249618 07/12/14 07:29 PM
Joined: Dec 2014
Posts: 4
J
jb0525283 Offline OP
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Dec 2014
Posts: 4
Hi,

I am making a script that only is available to a few nicks. I obviously can do a simple check if the nick is in the approved list, but I also need to check if they are identified, otherwise someone could log in and since they have 30 seconds to identify, they could use it when they shouldn't be able to.

These are regular users, NOT ops, so isop will not work. Wish there was a isidentified.

So how do I check if they are identified?

Re: Script Check If Nick Is Identified [Re: jb0525283] #249619 07/12/14 07:33 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
I know that pball : http://scripting.pball.x10.mx/

made a script that checks for ident, you can modify it to your needs
Code:
/*
[Addon]
Script=Check Ident
Version=1
Author=pball
Desc=Check if a nick is identified
For=Mirc
Date=

[script]
*/
alias chkident { set -u3 $+(%,ns_,$$1) 1 | .msg nickserv status $$1 }

menu nicklist,query {
  Check Identified:{ set -u3 $+(%,ns_,$$1) 1 | .msg nickserv status $$1 }
}

on ^*:notice:*:*:{
  if ($nick == nickserv) {
    if ($1 == STATUS) && ($3 isnum) && ($($+(%,ns_,$2),2)) {
      if ($3 == 0) || ($3 == 1) { echo 4 -a $2 is not identified | set -u3 $+(%,ns_,$2) 2 | ns info $2 } 
      else echo 11 -a $2 is identified 
      halt
    }
    elseif ($($+(%,ns_,$strip($2)),2)) { echo 4 -a $2 is not registered | halt }
    elseif ($var(%ns_*,1).value) halt
  }
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Script Check If Nick Is Identified [Re: Nillen] #249620 07/12/14 07:36 PM
Joined: Dec 2014
Posts: 4
J
jb0525283 Offline OP
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Dec 2014
Posts: 4
I know you can do that, but I dont want to detect idents. I want to check if they are identified on text so to speak. That possible?

Re: Script Check If Nick Is Identified [Re: jb0525283] #249621 07/12/14 07:41 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
That's why I said you can modify it.
Use the script that mentions if they are idented, and do that every time they speak.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Script Check If Nick Is Identified [Re: jb0525283] #249622 07/12/14 07:45 PM
Joined: Nov 2009
Posts: 295
P
pball Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
The only way I know to check if a nick is identified is to whois the nick or request the info through nickserv. So you can't check if they are identified during an on text event.


http://scripting.pball.win
My personal site with some scripts I've released.
Re: Script Check If Nick Is Identified [Re: pball] #249624 07/12/14 07:49 PM
Joined: Dec 2014
Posts: 4
J
jb0525283 Offline OP
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Dec 2014
Posts: 4
why cant I request that info from NS on text?

Re: Script Check If Nick Is Identified [Re: pball] #249625 07/12/14 08:19 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
What I meant was to store the nick, whois the nick and then take action whether or not it's identified upon getting the notice from nickserv.

OP, you can't cause it requires you to use two different events and mIRC can't handle two events at once.
So like I said, store the nick on text event, whois the nick, on notice event verify if the nick is ident or not and then take action to it.
Delay will likely be <1 second.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Script Check If Nick Is Identified [Re: Nillen] #249626 07/12/14 08:39 PM
Joined: Dec 2014
Posts: 4
J
jb0525283 Offline OP
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Dec 2014
Posts: 4
So how would I keep track of all the different nicks as they identify, leave, etc? mirc is not exactly the best at dynamic arrays..

Re: Script Check If Nick Is Identified [Re: jb0525283] #249630 07/12/14 10:41 PM
Joined: Nov 2009
Posts: 295
P
pball Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
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 ^_^)

Code:
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.


http://scripting.pball.win
My personal site with some scripts I've released.