Guest User

Untitled

a guest
Dec 5th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.50 KB | None | 0 0
  1. namespace eval ::autov {
  2. setudef flag VV
  3.  
  4. # Ici on mets le temp en seconde pour que le bot voice.
  5. variable voicejoin 10
  6. #Ici ont mets le message de join ceci et en forme de /me
  7. variable msgme "Le mode voice (+v) vous sera attribué dans quelques secondes, en attendant le silence vous est imposé, merci de bien vouloir patienter."
  8.  
  9. proc ::autov::verif {nick chan} {
  10.         putserv "mode $chan +v $nick"
  11. }
  12.  
  13. bind pub o "!von" [namespace current]::von
  14. proc von { nick host hand chan arg } {
  15.     if {[channel get $chan VV] == 0} {
  16.          channel set $chan +VV
  17.          putquick "PRIVMSG $chan :Auto-Voice Activé !"
  18.          foreach von [chanlist $chan] { if [isop $von $chan] continue; pushmode $chan +v $von }
  19.     } else {
  20.          putquick "PRIVMSG $chan :Auto-Voice déjà Activé !"
  21.     }
  22. }
  23.  
  24. bind pub o "!voff" [namespace current]::voff
  25. proc voff { nick host hand chan arg } {
  26.     if {[channel get $chan VV] != 0} {
  27.          channel set $chan -VV
  28.          putquick "PRIVMSG $chan :Auto-Voice Désactivé !"
  29.          foreach voff [chanlist $chan] { if [isop $voff $chan] continue; pushmode $chan -v $voff }
  30.     } else {
  31.          putquick "PRIVMSG $chan :Auto-Voice déjà Désactivé !"
  32.     }
  33. }
  34.  
  35. bind join - "*" [namespace current]::autovoice
  36. proc autovoice { nick uhost handle args } {
  37. set chan [lindex $args 0]
  38. if {[channel get $chan VV]==0} { return; }
  39.       puthelp "PRIVMSG $chan :\001ACTION $autov::msgme\001"
  40.       utimer $autov::voicejoin [list ::autov::verif $nick $chan]
  41.     }
  42. }
Add Comment
Please, Sign In to add comment