Guest

Untitled

By: a guest on Jan 30th, 2010  |  syntax: None  |  size: 5.82 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. bind pub -|- !k pub:kick
  2. bind pub -|- !kb pub:kickban
  3. bind pub -|- !v pub:voice
  4. bind pub -|- !dv pub:devoice
  5. bind pub o|o !t pub:topic
  6. bind pub -|- !o pub:op
  7. bind pub o|o !do pub:deop
  8. bind mode -|- "% +v" mode:voice
  9.  
  10.  
  11. proc pub:kick {n uh h ch w} {
  12.  global vkick
  13.  if {![isvoice $n $ch] && ![matchattr $h o|o $ch] || [isop $n $ch]} {return}
  14.  set who [lindex $w 0]
  15.  set why [lrange $w 1 end]
  16.  if {$why == "" || $why == " "} {set why "requested"}
  17.  
  18.  if {[info exists vkick($uh)]} {
  19.   putserv "NOTICE $n :1 kick per minute max. please wait."
  20.  } elseif {$who == ""} {
  21.   putquick "KICK $ch $n :You failed to specify who to kick, so you get kicked."
  22.  } elseif {[matchattr [nick2hand $who $ch] b]} {
  23.   puthelp "NOTICE $n :You cannot kick channel bots, sorry."
  24.  } elseif {[matchattr [nick2hand $who $ch] m] && ![matchattr $h n]} {
  25.   puthelp "KICK $ch $n :You cannot kick channel masters, sorry."
  26.  } elseif {![onchan $who $ch]} {
  27.   puthelp "PRIVMSG $ch :No such nick. You're stupid. Be glad I don't kick you instead."
  28.  } elseif {[matchattr $h m|m $ch]} {
  29.   putquick "PRIVMSG $ch :Yes, Your Majesty! It shall happen immediately!"
  30.   putquick "KICK $ch $who :$why"
  31.  } elseif {[matchattr $h o|o $ch]} {
  32.   putserv "PRIVMSG $ch :Happy to be of service!"
  33.   putserv "KICK $ch $who :$n: $why"
  34.  } elseif {[isop $who $ch] || [matchattr [nick2hand $who $ch] o|o $ch]} {
  35.   puthelp "NOTICE $n :You cannot kick that person, sorry."
  36.  } else {
  37.   puthelp "PRIVMSG $ch :Yes, ma'am! Right away, ma'am!"
  38.   puthelp "KICK $ch $who :$n: $why"
  39.   set vkick($uh) [timer 1 [list unset vkick($uh)]]
  40.  }
  41. }
  42.  
  43. proc pub:kickban {n uh h ch w} {
  44.  global vkick
  45.  if {![isvoice $n $ch] && ![matchattr $h o|o $ch] || [isop $n $ch]} {return}
  46.  if {[string index $w 0] == "-" && ([set bantime [expr [string range [lindex $w 0] 1 end]]] > 0) && $bantime < 120} {
  47.   set who [lindex $w 1]
  48.   set why [lrange $w 2 end]
  49.  } {
  50.   set who [lindex $w 0]
  51.   set why [lrange $w 1 end]
  52.   if {[matchattr $h m|m]} {set bantime 15} {set bantime 7}
  53.  }
  54.  
  55.  if {$why == "" || $why == " "} {set why "requested"}
  56.  
  57.  if {[info exists vkick($uh)]} {
  58.   puthelp "NOTICE $n :1 kick(ban) per minute max. please wait."
  59.  } elseif {$who == ""} {
  60.    putserv "NOTICE $n :You failed to specify who to kickban."
  61.  } elseif {[matchattr [nick2hand $who $ch] b]} {
  62.      puthelp "NOTICE $n :You cannot kick channel bots, sorry."
  63.  } elseif {[matchattr [nick2hand $who $ch] m|m $ch] && ![matchattr $h n] || [matchattr [nick2hand $who $ch] o]} {
  64.      puthelp "KICK $ch $n :You cannot kick channel masters, sorry."
  65.  } elseif {![onchan $who $ch]} {
  66.      putserv "NOTICE $n :No such nick: $who"
  67.  } elseif {[matchattr $h m|m]} {
  68.      putquick "PRIVMSG $ch :Yes, Your Majesty! It shall happen immediately!"
  69.      newchanban $ch "*!*[string range [getchanhost $who] 1 end]" $h "($bantime minutes) $n: $why" $bantime
  70.      putquick "KICK $ch $who :($bantime minute ban): $why"
  71.  } elseif {[matchattr $h o|o]} {
  72.      newchanban $ch "*!*[string range [getchanhost $who] 1 end]" $h "($bantime minutes) $n: $why" $bantime
  73.  } elseif {![matchattr [nick2hand $who] o|o] && ![matchattr [nick2hand $who] v|v]} {
  74.      newchanban $ch "*!*[string range [getchanhost $who] 1 end]" $h "(3 minutes) $n: $why" 3
  75.      set vkick($uh) [timer 1 [list unset vkick($uh)]]
  76.  } else {
  77.   puthelp "NOTICE $ch :Unable to comply."
  78.  }
  79. }
  80.  
  81. proc pub:voice {n uh h ch w} {
  82.  if {([matchattr $h o|o $ch] || [isvoice $n $ch] || [matchattr $h v|v $ch]) && ![isop $n $ch]} {
  83.   set who [lindex $w 0]
  84.   if {$who == ""} {set who $n}
  85.   if {[onchan $who $ch] && ![isvoice $who $ch]} {
  86.    putquick "MODE $ch +v $who"
  87.   }
  88.  }
  89. }
  90.  
  91. proc pub:devoice {n uh h ch w} {
  92.  global vdv
  93.  if {(![matchattr $h o|o $ch] && ![isvoice $n $ch]) || [isop $n $ch]} {return}
  94.  if {[info exists vdv($uh)]} {
  95.   puthelp "NOTICE $n :One de-voice per minute, max, sorry."
  96.   return
  97.  }
  98.  set who [lindex $w 0]
  99.  if {$who == ""} {set who $n}
  100.  if {[onchan $who $ch] && [isvoice $who $ch] && ((![matchattr [nick2hand $who $ch] o|o $ch] && ![matchattr [nick2hand $who $ch] v|v $ch]) || $who == $n || [matchattr $h m|m $ch])} {
  101.   putquick "MODE $ch -v $who"
  102.   if {![matchattr $h o|o $ch]} {set vdv($uh) [timer 1 [list unset vdv($uh)]]}
  103.  }
  104. }
  105.  
  106. proc pub:topic {n uh h ch t} {
  107.  if {[isop $n $ch]} {return}
  108.  if {$t != "" && $t != " "} {putquick "TOPIC $ch :$t"}
  109. }
  110.  
  111. proc pub:op {n uh h ch w} {
  112.  set who [lindex $w 0]
  113.  if {[isop $n $ch]} {return}
  114.  if {$who == ""} {
  115.   set who $n
  116.   if {![matchattr $h o|o $ch]} {
  117.    putquick "KICK $ch $n :You are not an op! Don't do that again!"
  118.   } elseif {[isop $n $ch]} {
  119.    putserv "PRIVMSG $ch :You are already opped. What are you dumb?"
  120.   }
  121.  }
  122.  if {[onchan $who $ch] && ![isop $who $ch] && [matchattr $h o|o $ch] && [matchattr [nick2hand $who $ch] o|o $ch]} {putquick "MODE $ch +o $who"
  123.  } else { puthelp "NOTICE $n :Unable to comply." }
  124. }
  125.  
  126. proc pub:deop {n uh h ch w} {
  127.  if {[isop $n $ch]} {return}
  128.  set who [lindex $w 0]
  129.  if {$who == ""} {
  130.   set who $n
  131.   if {![matchattr $h o|o $ch]} {
  132.    putserv "KICK $ch $n :You are not authorized! Don't do that again!"
  133.   } elseif {![isop $n $ch]} {
  134.    putserv "PRIVMSG $ch :You are not opped. What are you dumb?"
  135.   }
  136.  }
  137.  if {[matchattr [nick2hand $who $ch] b]} {
  138.   puthelp "NOTICE $n :You cannot de-op channel bots, sorry."
  139.  } elseif {[onchan $who $ch] && [isop $who $ch] && [matchattr $h o|o $ch]} {
  140.   putquick "MODE $ch -o $who"
  141.  } else { puthelp "NOTICE $n :Unable to comply." }
  142. }
  143.  
  144. proc mode:voice {n uh h ch mc who} {
  145.  global vnotice
  146.  if {![info exists vnotice($uh)]} {
  147.   puthelp "NOTICE $who :As a voice in this channel you have access to kick/ban people (except ops) and voice other users. Commands: !v <nick> or !k <nick> <reason> to voice or kick someone. You can also de-voice someone with !dv <nick> - To ban someone for one minute, use !kb <nick> <reason>"
  148.   set vnotice($uh) [timer 120 [list unset vnotice($uh)]]
  149.  }
  150. }