mIRC Home    About    Download    Register    News    Help

Print Thread
#186022 16/09/07 08:54 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Is it possible to have a script that will scan the nick list and get the result in a @window for unregistered nicks in the channel? Just like scanning for who list for exemple.

Last edited by Garou; 16/09/07 08:57 PM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
It's possible, but you may flood off the server for performing many /whois'es.

Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
maybe with a timer in it so that it takes it time ? :P

Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Or maybe have it check like in whois: Status: has identified for this nick ??

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
who-ing is sufficient; next time at least try your own smile
Code:
alias nonregistered {
  if ($me ison #$1) {
    ; enable group to grab raw replies
    .enable #nonregistered
    ; secure disable of that group
    .timernonregistered 1 30 .disable #nonregistered
    ; store channel to check
    set -e %nonregisteredchan #$1
    ; request users list
    who #$1
    ; create hidden sorted list window for that chans nonregistered users (or hide&clear existing window)
    if ($window($+(@,nonregistered,$chr(160),#$1))) { window -h $v1 | clear $v1 }
    else { window -hlsCk0z $+(@,nonregistered,$chr(160),#$1) -1 -1 300 500 }
  }
  else { echo -a Syntax: /nonregistered <channel>. You have to be on that channel. }
}

#nonregistered off
; who replies
raw 352:*: { 
  if ($2 == %nonregisteredchan) {
    ; add nonregistered nicks to the hidden listwindow
    if (r !isincs $7) { aline $+(@,nonregistered,$chr(160),$2) $6 }
    haltdef
  }
}

; end of who
raw 315:*: {
  if ($2 == %nonregisteredchan) {
    ; show the formerly hidden window, unset stored channel, execute "secure disable"
    window -a $+(@,nonregistered,$chr(160),$2)
    unset %nonregisteredchan
    .timernonregistered -e
    haltdef
  }
}
#nonregistered end


Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That doesn't work on this end mate, I'm registered to services. I'm not interested in the script just thought I'd try it out. r doesn't seem to be in the $7 of the raw message.

SK #Test Praetorian 83.104.15C.960 crookedchat.net SK H+ 0 Madison

SK is Praetorian@83.104.15C.960 * Madison
SK on #Test
SK is registered to services

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Well I refered to:
Quote:
Is it possible to have a script that will scan the nick list and get the result in a @window for unregistered nicks in the channel? Just like scanning for who list for exemple.
I use to chat on unreal and it's working fine for me.
Looks like the ircd you're on provides no "r" in who reply usermodes - then you're right, a mass-whois is inevitable. (Is it whois raw 307 - like "<nick> is a registered nick"?)
I could modify the antiflood whois method of this snippet if it's not working for Garou as well.

Edit: Hum I did *grin*
This is the slow whois version. It took 2 mins on a chan with 150 nicks... thus I added that "counter" - hope it's raw 307 we're talking about grin
Code:
alias unregistered {
  if ($me ison #$1) {
    if (%unregistered.chan) { echo -a Sorry, I'm still looking up the nicks of %unregistered.chan | return }
    set %unregistered.chan #$1

    ; create a hash table storing all nicks
    if (!$hget(unregistered)) { hmake unregistered 50 }
    var %nr = 1
    while ($nick(#$1,%nr)) { hadd unregistered $v1 | inc %nr }

    ; create / clear output window
    var %w = $+(@,unregistered,$chr(160),#$1)
    $iif(($window(%w)),clear %w,window -lsCk0z %w -1 -1 300 500)
    aline %w $str($chr(160),3) $+ Looking up: nick 001 of $base($hget(unregistered,0).item,10,10,3) ...

    ; start masswhois
    .enable #unregistered
    unregistered.whois #$1
  }
  else { echo -a Syntax: /unregistered <channel>. You need to be on that channel. }
}

alias -l unregistered.whois {
  ; whois next nick...until finished
  if (($me ison $1) && ($hget(unregistered,1).item)) { whois $v1 }
  else {
    var %w = $+(@,unregistered,$chr(160),$1)
    rline %w 1 $str($chr(160),3) $+ $iif(($me ison $1),Scan finished. $&
      $iif(($line(%w,2)),They did not register:,All nicks on $1 registered.),Scan aborted.)
    hfree unregistered
    .disable #unregistered
    unset %unregistered.*
  }
}

#unregistered off
raw *:*:{
  if ($hget(unregistered,$2).item) {

    ; nick has registered: store that nick
    if ($numeric == 307) {
      set %unregistered.regnick $2
      haltdef
    }

    ; end of whois for that nick or no such nick
    elseif ($istok(318 401,$numeric,32)) { 
      var %w = $+(@,unregistered,$chr(160),%unregistered.chan)

      ; nick has not registered: add the nick to the window 
      if (($numeric == 318) && (%unregistered.regnick != $2)) { aline %w $2 }

      ; update count
      rline %w 1 $str($chr(160),3) $+ Looking up: nick $&
        $base($calc($gettok($line(%w,1),6,32) - $hget(unregistered,0).item +1),10,10,3) of $gettok($line(%w,1),6,32) ...

      ; proceed with next nick and additional 200ms delay
      hdel unregistered $2
      .timerunregistered -m 1 200 unregistered.whois %unregistered.chan
      haltdef
    }

    ; halt the other whois lines as well
    elseif ($int($calc($numeric / 100)) == 3) { haltdef }
  }
}
#unregistered end

Last edited by Horstl; 17/09/07 11:28 AM.
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
wow this is what i needed thx. Can you add it in the menu whith a start and stop button ?


Link Copied to Clipboard