bind pub n|n .vip pub_vip
bind pub join - check_vip
bind raw 319  - whois_vip

proc whois_vip { from keyword text } {
set whois.chans [llength [split $text]]
while {$whois.chans > 0} {
  set whois.current [lindex [split $text] $whois.chans]
  if {channel get $whois.current} {
    set whois.mode channel get $whois.current
    pushmode $whois.channel $whois.mode $whois.nick
  }
  incr $whois.chans -1
}
}

proc pub_vip { nick host hand chan text } {
if {[lindex [split $text] 1] == "add"} {
  if {[lindex [split $text] 3] == "+v" || [lindex [split $text] 3] == "+o"} {
    channel set @[lindex [split $text] 2] [lindex [split $text] 3]
    setudef str @[lindex [split $text] 2]
    putserv "PRIVMSG $chan :Added [lindex [split $text] 2] as Vip Channel. Ops in [lindex [split $text] 2] will get [lindex [split $text] 3] in $chan"
  }
}

proc check_vip { nick host hand chan text } {
set whois.nick $nick
set whois.chan $chan
putserv "WHOIS $nick"
}
