mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2014
Posts: 4
J
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?

Joined: Dec 2013
Posts: 779
N
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
Joined: Dec 2014
Posts: 4
J
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?

Joined: Dec 2013
Posts: 779
N
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
Joined: Nov 2009
Posts: 295
P
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.
Joined: Dec 2014
Posts: 4
J
Self-satisified door
OP Offline
Self-satisified door
J
Joined: Dec 2014
Posts: 4
why cant I request that info from NS on text?

Joined: Dec 2013
Posts: 779
N
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
Joined: Dec 2014
Posts: 4
J
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..

Joined: Nov 2009
Posts: 295
P
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.

Link Copied to Clipboard