mIRC Home    About    Download    Register    News    Help

Topic Options
#249618 - 07/12/14 07:29 PM Script Check If Nick Is Identified
jb0525283 Offline
Self-satisified door

Registered: 07/12/14
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?

Top
#249619 - 07/12/14 07:33 PM Re: Script Check If Nick Is Identified [Re: jb0525283]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#249620 - 07/12/14 07:36 PM Re: Script Check If Nick Is Identified [Re: Nillen]
jb0525283 Offline
Self-satisified door

Registered: 07/12/14
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?

Top
#249621 - 07/12/14 07:41 PM Re: Script Check If Nick Is Identified [Re: jb0525283]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#249622 - 07/12/14 07:45 PM Re: Script Check If Nick Is Identified [Re: jb0525283]
pball Online
Fjord artisan

Registered: 04/11/09
Posts: 294
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.x10.mx/
My personal site with some scripts I've released.

Top
#249624 - 07/12/14 07:49 PM Re: Script Check If Nick Is Identified [Re: pball]
jb0525283 Offline
Self-satisified door

Registered: 07/12/14
Posts: 4
why cant I request that info from NS on text?

Top
#249625 - 07/12/14 08:19 PM Re: Script Check If Nick Is Identified [Re: pball]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#249626 - 07/12/14 08:39 PM Re: Script Check If Nick Is Identified [Re: Nillen]
jb0525283 Offline
Self-satisified door

Registered: 07/12/14
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..

Top
#249630 - 07/12/14 10:41 PM Re: Script Check If Nick Is Identified [Re: jb0525283]
pball Online
Fjord artisan

Registered: 04/11/09
Posts: 294
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.x10.mx/
My personal site with some scripts I've released.

Top