mIRC Home    About    Download    Register    News    Help

Print Thread
#184474 29/08/07 03:41 PM
Joined: Jul 2007
Posts: 6
S
Sige Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2007
Posts: 6
Im looking for a script that shows what other channels a person is in when they join my channel.

Sige #184490 29/08/07 07:09 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You'd have to
- whois all joining users to get that info
- parse the right line of whois reply to get all (visible) chans the user is on: raw 319
- by removing the chan just joined, you'll get the "other" channels the user is on
- it's also a good idea to silence the whois replies.. smile but how to know which replies should be silenced and which not? e.g. by setting a variable for each whois'd user.

Code:
; menu switch
menu channel {
  $iif(($group(#showchans) == on),$style(1)) Show chans on join...
  .$iif(($group(#showchans) == on),stop,start) showing chans : $iif(($group(#showchans) == on),.disable,.enable) #showchans
}

#showchans on
; user joining
on !*:join:#: {
  ; if less than 8 joinwho variables set at all (little flood protect)
  if ($var(%com.who.*,0) < 8) {
    ; set a temp variable for the user joining 
    set -eu10 $+(%,com.who.,$nick) $chan
    ; whois that nick
    whois $nick
  }
}

; server replies 
raw *:*: {
  ; is a variable set for that nick?
  if ($($+(%,com.who.,$2),2)) { 
    ; the channel joinig has been the value of the variable...
    var %chan = $v1
    ; whois reply "is on"
    if ($numeric == 319) { 
      ; remove the joining chan in the reply - output according to "other chans/no other chan"
      if ($remtok($3-,$wildtok($3-,$+(*,%chan),1,32),1,32)) { echo -c info %chan ... $2 is also on: $v1 }
      else { echo -c info %chan ... $2 is on no other (visible) chan. } 
      ; halt that line
      haltdef 
    }
    ; unset the variable on whois end
    elseif ($numeric == 318) { unset $+(%,com.who.,$2) | haltdef }
    ; halt output of the other whois lines (thus the delay)
    elseif (($int($calc($numeric / 100)) == 3) || ($numerkic == 401)) { haltdef }
  }
}
#showchans end


Edit: Changed halting behaviour, now it's more consistent.

Last edited by Horstl; 29/08/07 11:06 PM.
Horstl #184505 29/08/07 09:39 PM
Joined: Jul 2007
Posts: 6
S
Sige Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Jul 2007
Posts: 6
oohhhh thank you so much, works perfectly ^_^


Link Copied to Clipboard