All pastes #186438 Raw Edit

Anonymous

public text v1 · immutable
#186438 ·published 2006-09-29 22:38 UTC
rendered paste body
on *:TEXT:!chancheck:#RSPC:{
  if ($nick isreg #RSPC) { halt }
  else pccheck
}

on *:JOIN:#RSPC:{
  pccheck
}

alias pccheck {
  .enable #pcwhois
  var %a $nick(#RSPC,0)
  var %b 1
  while (%b <= %a) {
    whois $nick(#RSPC,%b)
    inc %b
  }
}

alias whoisnumerics return 301|307|310|311|312|313|314|317|318|319|320|330|335|338|369|378|379|401|406|671

#pcwhois on

raw *:*:{
  if ($istok($whoisnumerics,$numeric,124)) { haltdef }
  if ($numeric == 319) {
    var %a $numtok($1-,32)
    var %b 3
    while (%b <= %a) {
      if ($istok(%pc.channels,$iif($left($eval($+($,%b),2),1) == $chr(35),$eval($+($,%b),2),$right($eval($+($,%b),2),-1)),32)) { ban -ku300 #RSPC $2 2 You are on another PC channel: $iif($left($eval($+($,%b),2),1) == $chr(35),$eval($+($,%b),2),$right($eval($+($,%b),2),-1)) $+ , please part from it. 5 Minute Ban. | halt }
      inc %b
    }
  }
  elseif ($numeric == 318) && ($2 == $nick(%rspc,$nick(#rspc,0))) {
    .disable #pcwhois
  }
}

#pcwhois end

alias addchan { set %pc.channels $addtok(%pc.channels,$1,32) }
alias remchan { set %pc.channels $remtok(%pc.channels,$1,32) }

on *:CONNECT:{
  timer 0 300 /pccheck
}