Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 104.22 KB | None | 0 0
  1. namespace eval GB {
  2.  
  3.     # Pseudo Admin du Bot #
  4.     variable admin "alias_angelius"
  5.     # Salon de log #
  6.     variable log "#Op-Trip"
  7.     # Commande Prefix Permet de choisir la commande par défault soit "." ou "!" #
  8.     set commande(choix) "."
  9.  
  10.     # Array Message #
  11.  
  12.     array set msg {
  13.          "bl" "\0034Tu es banni du salon. \00314( \0031Blackliste\00314 )"
  14.          "kick" "Vous venez d'être kické par $nick sur $chan !"
  15.          "kickban" "Exclu(e) de $chan !"
  16.          "nc" "~ Exp/Notice-Chan ~ Pas de notice salon svp"
  17.          "level" "Vous n'avez pas le level suffisant dans $::botnick pour utiliser cette commande $nick !"
  18.          "salon" "Désolé $nick mais le salon que tu demandes est inconnu !"
  19.          "auth" "Avant d'utiliser la commande veuillez vous authentifier au préalable merci : ( /msg $::botnick auth <pseudo> <pass> )"
  20.          "access" "Désolé $nick mais je ne trouve pas ton accès dans ma base de données !"
  21.          "botdeop" "Désolé je ne peux pas exécuter la commande je suis déop sur $chan !"
  22.          "nosalon" "Désolé $nick mais je suis absent du salon $chan !"
  23.          "pseudo" "Désolé mais le pseudonyme demandé n'est pas sur $chan !"
  24.          "nochan" "Désolé $nick mais je ne te vois pas sur $chan !"
  25.          "nopseudo" "Désolé mais vous n'êtes pas présent sur le salon $chan !"
  26.          "iso" "Désolé $nick mais tu me demandes quelque chose alors que tu l'es déjà sur $chan !"
  27. }  
  28.  
  29.     # Setudef #
  30.  
  31.          setudef flag GB
  32.  
  33.     # Retour de Procédure Idée et aide venant de MenzAgitat #
  34.  
  35.     # Retour Proc Kickban #
  36.  
  37.     proc ban_user {nick host chan} {
  38.         putquick "MODE $chan +b [::GB::hostmask_process $nick $host 2]"
  39.         putquick "KICK $chan $nick [subst -nocommands -nobackslashes $::GB::msg(kickban)]"
  40. }
  41.  
  42.     # Procédure inspiré du Anti-Frenzy de MenzAgitat #
  43.  
  44.     proc ::GB::hostmask_process {nick host type} {
  45.          set fullhost "$nick!$host"
  46.          set nick "*" ; set ident "*" ; set host "*"
  47.          scan $fullhost "%\[^!\]!%\[^@\]@%s" nick ident host
  48.          set nick [join [string trimleft $nick "@+"]]
  49.          set ident [join [string trimleft $ident "~"]]
  50.          set hostmask $host
  51.     if { [regexp {([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)} $host] } {
  52.          set host [lreplace [split $host .] end end *]
  53.     } else {
  54.          set host [split $host .]
  55.     if { [llength $host] == 3 } { set host [lreplace $host 0 0 *] }
  56.     if { [llength $host] > 3 } { set host [lreplace $host 0 1 *] }
  57.     }
  58.          set domain [join $host .]
  59.     switch "$type" {
  60.          "0" { return "*!$ident@$hostmask" }
  61.          "1" { return "*!*$ident@$hostmask" }
  62.          "2" { return "*!*@$hostmask" }
  63.          "3" { return "*!*$ident@$domain" }
  64.          "4" { return "*!*@$domain" }
  65.          "5" { return "$nick!*$ident@$hostmask" }
  66.          "6" { return "$nick!*$ident@$hostmask" }
  67.          "7" { return "$nick!*@$hostmask" }
  68.          "8" { return "$nick!*$ident@$domain" }
  69.          "9" { return "$nick!*@$domain" }
  70.          "10" { return "*!$ident@$domain" }
  71.          "11" { return "*!$ident@*.IP" }
  72.          "12" { return "*!$ident@*.EpiK" }
  73.     }
  74.     if {[set resultmask $nick!$ident@$fullhost] eq "*!*@*"} { return "invalid!host@mask" }
  75.     return $resultmask
  76. }
  77.  
  78.     # PL #
  79.  
  80.     proc opco {hand idx} {
  81.          putquick "privmsg $::GB::log :\0031\[\00312Connection\0031\] \0034$hand \0033vien de se connecter a la \0036Party-Line.\0036"
  82.          dccbroadcast "\00312Connection PL Autorisé pour \0034$hand\0034"
  83. }
  84.  
  85.     proc opdeco {hand idx} {
  86.          putquick "privmsg $::GB::log :\0031\[\00312Déconection\0031\] \0034$hand \0033vien de se déconecter de la \0036Part-Line.\0036"
  87.          dccbroadcast "\00312Déconnection PL pour \0034$hand\0034"
  88. }
  89.  
  90.     # Auth #
  91.  
  92.     proc auth { nick host hand text } {
  93.          set args [split $text]
  94.          set chan [lindex $text 0]
  95.          set pseudo [lindex $text 0]
  96.     if {[llength $args] != 2} {
  97.          puthelp "notice $nick :\002Erreur :\002 ( /msg $::botnick auth <pseudo> <pass> )"
  98.     return 0
  99.     }
  100.          set password [lindex $args 1]
  101.     if { [nick2hand $pseudo] eq "*" } {
  102.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  103.     return 0
  104.     }
  105.     if {![passwdok $pseudo $password]} {
  106.          puthelp "notice $nick :\002Erreur :\002 Votre mot de pass ou/et votre pseudo est/sont incorrect(s) !"
  107.     return 0
  108.     }
  109.     if {![string match -nocase [lindex [getuser $pseudo HOSTS] 0] $nick!$host]} {
  110.          puthelp "notice $nick :\002Erreur :\002 Votre host ne correspond pas avec votre access !"
  111.     return 0
  112.     }
  113.     if {[getuser $pseudo XTRA AUTH] eq "ON"} {
  114.          puthelp "notice $nick :\002Erreur :\002 Vous êtes déjà authentifier !"
  115.     return 0
  116.     }
  117.     if {[getuser $hand XTRA SUSPEND] eq "ON"} {
  118.          puthelp "notice $nick :\002Erreur :\002 Vous êtes suspendu !"
  119.     return 0
  120.     }      
  121.          puthelp "notice $nick :\0031\[AUTHENTIFICATION REUSSIE\]\0031 Vous êtes maintenant authentifié !"
  122.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Auth\0036\] \0031par : \0034$hand"
  123.          putquick "invite $nick $::GB::log"
  124.          setuser $pseudo XTRA AUTH ON;
  125.          setuser $hand XTRA SEEN [clock format [clock seconds] -format "le %d/%m/%Y à %Hh%M"]
  126.          save
  127.     return
  128. }
  129.  
  130.     # Deauth #
  131.  
  132.     proc deauth { nick host hand arg } {
  133.          set chan [lindex $arg 0]
  134.     if {[getuser $hand XTRA auth] eq "ON"} {
  135.          puthelp "notice $nick :\0031\[DEAUTHENTIFICATION REUSSIE\]\0031 Vous êtes maintenant deauthentifié !"
  136.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Deauth\0036\] \0031par : \0034$hand"
  137.          setuser $hand XTRA AUTH OFF;
  138.          save
  139.     return
  140.     }
  141. }
  142.  
  143.     # Isauth #
  144.  
  145.     proc [namespace current]::isauth {hand} {
  146.     if {[getuser $hand XTRA AUTH] eq "OFF"} {return 0}
  147.     if {[getuser $hand XTRA AUTH] eq "ON"} {return 1}
  148. }
  149.  
  150.     # Addsuspend #
  151.  
  152.     proc addsuspend {nick host hand arg} {
  153.     if {![matchattr $hand o]} {
  154.          putserv "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  155.     return 0
  156.     }
  157.          set arg [split $arg]
  158.          set login [lindex $arg 0]
  159.     if {$login==""} {
  160.          puthelp "notice $nick :\002/msg $::botnick addsuspend\002<login>"
  161.          puthelp "notice $nick :\002Exemple :\002/msg $botnick addsuspend $::GB::admin"
  162.     return 0
  163.     }
  164.     if { [nick2hand $login] eq "*" } {
  165.          puthelp "notice $nick :\002ADDSUSPEND\002: Le login \002$login\002 a aucun accès."
  166.     return 0
  167.     }
  168.     if {[getuser $login XTRA suspend]=="ON"} {
  169.          puthelp "notice $nick :\002ADDSUSPEND\002: Le login \002$login\002 est déjà suspendu."
  170.     return 0
  171.     }
  172.          setuser $login XTRA SUSPEND ON
  173.          puthelp "notice $nick :\002ADDSUSPEND\002: \002$login\002 a été suspendu."
  174.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Addsuspend\0036\] \0031ajouté par : \0034$hand pour $login"
  175.     return
  176. }
  177.  
  178.     # Delsuspend #
  179.  
  180.     proc delsuspend {nick host hand arg} {
  181.     if {![matchattr $hand o|]} {
  182.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  183.     return 0
  184.     }
  185.          set arg [split $arg]
  186.          set login [lindex $arg 0]
  187.     if {$login==""} {
  188.          puthelp "notice $nick :\002/msg $botnick delsuspend\002<login>"
  189.          puthelp "notice $nick :\002Exemple :\002/msg $botnick delsuspend $::GB::admin"
  190.     return 0
  191.     }
  192.     if { [nick2hand $login] eq "*" } {
  193.          puthelp "notice $nick :\002DELSUSPEND\002 : Le login \002$login\002 a aucun accès."
  194.     return 0
  195.     }
  196.     if {[getuser $login XTRA suspend]=="OFF"} {
  197.          puthelp "notice $nick :\002DELSUSPEND\002 : Le login \002$login\002 n'est pas suspendu."
  198.     return 0
  199.     }
  200.          setuser $login XTRA SUSPEND OFF
  201.          puthelp "notice $nick :\002DELSUSPEND\002 : \002$login\002 n'est plus suspendu."
  202.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Delsuspend\0036\] \0031retiré par : \0034$hand pour $login"
  203.     return
  204. }
  205.  
  206.     # Deauth Part #
  207.  
  208.     proc partdeauth { nick uhost hand chan {msg ""}} {
  209.     if {[matchattr $hand o|o $chan] && [isauth $hand]} {
  210.          setuser $hand XTRA AUTH OFF
  211.          puthelp "notice $nick :Déauthentification suite à votre part du salon.."
  212.          putserv "privmsg $::GB::log :\00314Déauthentification \0036suite au part de \0031: \0034$hand"
  213.     }
  214. }
  215.  
  216.     # Deauth Quit #
  217.  
  218.     proc quitdeauth { nick uhost hand chan {msg ""}} {
  219.     if {[matchattr $hand o|o $chan] && [isauth $hand]} {
  220.          setuser $hand XTRA AUTH OFF
  221.          putserv "privmsg $::GB::log :\00314Déauthentification \0036suit au quit de \0031: \0034$hand"
  222.     }
  223. }
  224.  
  225.     # Deauth Join #
  226.  
  227.     proc joindeauth {nick host hand chan} {
  228.     if {$nick=="$::botnick"} {
  229.          putserv "privmsg $::GB::log :\0034Réinitialisation des accès, tous les authentifiés ont été deauth par sécurité.\0034"
  230.     foreach user [userlist * $chan] {
  231.          setuser $user XTRA AUTH OFF
  232.         }
  233.     }
  234. }
  235.  
  236.     # Blacklist #
  237.  
  238.     # Création et Gestion Db #
  239.  
  240.     if ![file exist database/blacklist.db] {
  241.          set load [open database/blacklist.db w+]
  242.     close fcreate
  243.          putlog "\2Je créé le blacklist.db\2"
  244. }
  245.  
  246.     if ![file exist database/exempt.db] {
  247.          set load [open database/exempt.db w+]
  248.     close fcreate
  249.          putlog "\2Je créé le exempt.db\2"
  250. }
  251.  
  252.      proc progfile {file action arg} {
  253.          set return 0
  254.          set dbr [open database/$file.db r+]
  255.          set dbw [open tmp.tmp w+]
  256.     while {![eof $dbr]} {
  257.          set r [gets $dbr]
  258.     if {$r!=""} {puts $dbw $r}
  259.     }
  260.     close $dbr
  261.     close $dbw
  262.          set dbr [open tmp.tmp r+]
  263.          set dbw [open database/$file.db w+]
  264.     while {![eof $dbr]} {
  265.          set r [gets $dbr]
  266.     if {$action=="add"} {
  267.     if {$r!=""} {
  268.     puts $dbw $r
  269.     } else {
  270.     puts $dbw $arg
  271.     }
  272.          set return 1
  273.     }
  274.     if {$action=="del"} {
  275.     if {$r!=""} {
  276.     if {![string match -nocase $arg [lindex $r 0]] && ![string match -nocase $arg [lindex $r 1]]} {
  277.     puts $dbw $r
  278.     } else {
  279.          set return 1
  280.             }
  281.         }
  282.     }
  283.     if {$action=="chk"} {
  284.     if {$r!=""} {
  285.     puts $dbw $r
  286.     if [string match -nocase [lindex $arg 0] [lindex $r 1]] {
  287.          set return [lindex $r 0]
  288.     if ![string match -nocase [lindex $arg 1] [lindex $r 2]] {set return 2}
  289.     if ![string match [lindex $arg 2] [lindex $r 3]] {set return 3}
  290.             }
  291.         }
  292.     }
  293.     if {$action=="icr"} {
  294.     if {$r!=""} {
  295.     puts $dbw $r
  296.     if [string match -nocase $arg [lindex $r 0]] {
  297.          set return 1
  298.             }
  299.         }
  300.     }
  301.     if {$action=="cf"} {
  302.     if {$r!=""} {
  303.     puts $dbw $r
  304.     if [string match -nocase [lindex $r 0] $arg] {
  305.          set return 1
  306.             }
  307.         }
  308.     }
  309.     if {$action=="ibr"} {
  310.     if {$r!=""} {
  311.     puts $dbw $r
  312.     if [string match -nocase $arg [lindex $r 1]] {
  313.          set return 1
  314.                 }
  315.             }
  316.         }
  317.  
  318.     }
  319.     close $dbr
  320.     close $dbw
  321.     return $return
  322. }
  323.  
  324.     # Add blacklist #
  325.  
  326.     proc +blacklist {nick uhost hand chan args} {
  327.          set verifexempt "[split [lindex $args 0] |]"
  328.          set nickverife "[lindex $verifexempt 0]"
  329.     if {[channel get $chan GB]==0} { return; }
  330.     if {[lindex $args 0]!=""} {
  331.     if {[progfile blacklist icr $nickverife]!="0"} {
  332.          puthelp "notice $nick :Attention le Nick: \2$nickverife\2 est déjà dans la Blacklist ou ne peux etre Blackliste."
  333.     return 0
  334.     }
  335.     if {[progfile exempt icr $nickverife]!="0"} {
  336.          puthelp "notice $nick :Attention le Nick: \2$nickverife\2 Ne peux être ajouter a la Blackliste."
  337.     return 0
  338.     }
  339.          progfile blacklist add $nickverife
  340.          puthelp "notice $nick :Le Nick: \2$nickverife\2 a bien été ajouté à la blacklist."
  341.          putquick "privmsg $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était ajouter au pseudo des (\0034Blackliste\00314)"
  342.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Blacklist\0036\] \0031ajouté par : \0034$hand"
  343.     return 0
  344.     } else {
  345.          puthelp "privmsg $chan :Il faut une victime"
  346.     return 0
  347.     }
  348. }
  349.  
  350.     # Del Blacklist #
  351.  
  352.     proc -blacklist {nick uhost hand chan args} {
  353.          set verifexempt "[split [lindex $args 0] |]"
  354.          set nickverife "[lindex $verifexempt 0]"
  355.     if {[channel get $chan GB]==0} { return; }
  356.     if {[lindex $args 0]!=""} {
  357.     if {[progfile blacklist del $nickverife]!="1"} {
  358.          puthelp "notice $nick :Attention le Nick: \2$nickverife\2 n'est pas dans la Blacklist."
  359.     return 0
  360.     }
  361.          progfile blacklist del $nickverife
  362.          puthelp "notice $nick :Le Nick: \2$nickverife\2 a bien été supprimé de la blacklist."
  363.          putquick "privmsg $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était retiré au pseudo des (\0034Blackliste\00314)"
  364.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Blacklist\0036\] \0031retiré par : \0034$hand"
  365.     return 0
  366.     } else {
  367.          puthelp "privmsg $chan :Il faut une victime"
  368.     return
  369.     }
  370. }
  371.  
  372.     # List Blacklist #
  373.  
  374.     proc .blacklist {nick uhost hand chan args} {
  375.          set nickb [lindex $args 0]
  376.          set blusers [open database/blacklist.db r]
  377.     if {[channel get $chan GB]==0} { return; }
  378.          putserv "notice $nick :\2Voici la Blacklist:\2"
  379.          putserv "notice $nick :\2\2"
  380.     while {![eof $blusers]} {
  381.          set bluser [gets $blusers]
  382.     if {$bluser!="" && $nickb==""} {
  383.          putserv "notice $nick :\2Nick:\2 $bluser"
  384.     } elseif [string match -nocase $nickb $bluser] {
  385.          putserv "notice $nick :\2Nick:\2 $bluser."
  386.         }
  387.     }
  388.          putserv "notice $nick :\2Fin de la Blacklist\2."
  389.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Blacklist\0036\] \0031par : \0034$hand"
  390.     close $blusers
  391.          putserv "notice $nick :\2\2"
  392. }
  393.  
  394.     # Add Exempt #
  395.  
  396.     proc +exempt {nick uhost hand chan args} {
  397.          set verifexempt "[split [lindex $args 0] |]"
  398.          set nickverife "[lindex $verifexempt 0]"
  399.     if {[channel get $chan GB]==0} { return; }
  400.     if {[lindex $args 0]!=""} {
  401.     if {[progfile exempt icr $nickverife]!="0"} {
  402.          putserv "notice $nick :Attention le Nick: \2$nickverife\2 est déjà dans la liste des protégés."
  403.     return 0
  404.     }
  405.          progfile exempt add $nickverife
  406.          puthelp "notice $nick :Le Nick: \2$nickverife\2 a bien été ajouté à la liste des protégés."
  407.          putquick "privmsg $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était ajouter au pseudo des (\0034Protégés\00314)"
  408.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Exempt\0036\] \0031ajouté par : \0034$hand"
  409.     return 0
  410.     } else {
  411.          puthelp "privmsg $chan :Il faut une victime"
  412.     return 0
  413.     }
  414. }
  415.  
  416. # Del Exempt #
  417.  
  418.     proc -exempt {nick uhost hand chan args} {
  419.          set verifexempt "[split [lindex $args 0] |]"
  420.          set nickverife "[lindex $verifexempt 0]"
  421.     if {[channel get $chan GB]==0} { return; }
  422.     if {[lindex $args 0]!=""} {
  423.     if {[progfile exempt del $nickverife]!="1"} {
  424.          putserv "notice $nick :Attention le Nick: \2$nickverife\2 n'est pas dans la liste des protégés."
  425.     return 0
  426.     }
  427.          progfile exempt del $nickverife
  428.          puthelp "notice $nick :Le Nick: \2$nickverife\2 a bien été supprimé de la listes des protégés."
  429.          putquick "privmsg $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était retiré au pseudo des (\0034Protégés\00314)"
  430.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Exempt\0036\] \0031retiré par : \0034$hand"
  431.     return 0
  432.     } else {
  433.          puthelp "privmsg $chan :Il faut une victime"
  434.     return
  435.     }
  436. }
  437.  
  438.     # List Exempt #
  439.  
  440.     proc .exempt {nick uhost hand chan args} {
  441.          set nickb [lindex $args 0]
  442.          set blusers [open database/exempt.db r]
  443.     if {[channel get $chan GB]==0} { return; }
  444.          putserv "notice $nick :\2Voici la ExemptList:\2"
  445.          putserv "notice $nick :\2\2"
  446.     while {![eof $blusers]} {
  447.          set bluser [gets $blusers]
  448.     if {$bluser!="" && $nickb==""} {
  449.          putserv "notice $nick :\2Nick:\2 $bluser"
  450.     } elseif [string match -nocase $nickb $bluser] {
  451.          putserv "notice $nick :\2Nick:\2 $bluser."
  452.         }
  453.     }
  454.          putserv "notice $nick :\2Fin de la ExemptList\2."
  455.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Exempt\0036\] \0031par : \0034$hand"
  456.     close $blusers
  457.          putserv "notice $nick :\2\2"
  458. }
  459.  
  460.     # Join #
  461.  
  462.     proc xbl {n u h c} {
  463.          set k [lindex [split $n |] 0]
  464.     if {[progfile blacklist cf $k]=="1"} {
  465.          set vnick $n
  466.          set hostmask "[split [getchanhost $vnick $c] @]"
  467.          set hostmask "!*@*[lindex $hostmask 1]"
  468.          pushmode $c +b $hostmask
  469.          pushmode $c +b $k!*@*
  470.          pushmode $c +b $k|*!*@*
  471.          puthelp "kick $c $vnick :[subst -nocommands -nobackslashes $::GB::msg(bl)]"
  472.     }
  473. }
  474.  
  475.     # AddChan/DelChan/ListChan Msg #
  476.  
  477.     proc addchan { nick host hand text } {
  478.          set chan [lindex $text 0]
  479.          set chans [join [lrange [split $text] 0 0]]
  480.     if {[channel get $chan GB]==0} { return; }
  481.     if { [nick2hand $nick] eq "*" } {
  482.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  483.     return 0
  484.    }
  485.     if {![isauth $hand]} {
  486.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  487.     return 0
  488.     }
  489.     if {$text==""} {
  490.          puthelp "notice $nick :Addchan incorrect ! Veuillez respecter la syntaxe suivante : ( /msg $::botnick addchan <#salon> ) !"
  491.     }
  492.     if ![matchattr $hand o| [lindex $text 0]] {
  493.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  494.     return 0
  495.    }    
  496.     if {[string match -nocase $chans $chan]} {
  497.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Add-Chan\0036\] \0031par : \0034$hand"
  498.          putserv "notice $nick :$chans Rajouter au Addchan !"
  499.          channel add $chans
  500.          savechannels
  501.     return 0
  502.     }
  503.     if {[lsearch [channels] $chans]==-1} {
  504.          puthelp "notice $nick :$chans existe déja dans la liste des addchan"
  505.     return
  506.     }
  507. }
  508.  
  509.     # Delchan #
  510.  
  511.     proc delchan { nick host hand text } {
  512.          set chan [lindex $text 0]
  513.          set chans [join [lrange [split $text] 0 0]]
  514.     if {[channel get $chan GB]==0} { return; }
  515.     if { [nick2hand $nick] eq "*" } {
  516.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  517.     return 0
  518.     }
  519.     if {![isauth $hand]} {
  520.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  521.     return 0
  522.     }
  523.     if {$text==""} {
  524.          puthelp "notice $nick :Addchan incorrect ! Veuillez respecter la syntaxe suivante : ( /msg $::botnick delchan <#salon> ) !"
  525.     }
  526.     if ![matchattr $hand o| [lindex $text 0]] {
  527.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  528.     return 0
  529.    }    
  530.     if {[lsearch [channels] $chans]==-1} {
  531.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  532.     return 0
  533.     }
  534.     if {[string match -nocase $chans $chan]} {
  535.          putserv "privmsg $::GB::log :\00314Commande \0036\[\0033Del-Chan\0036\] \0031par : \0034$hand"
  536.          putserv "notice $nick :$chans Retiré des Addchan !"
  537.          channel remove $chans
  538.          savechannels
  539.     return
  540.     }
  541. }  
  542.    
  543.     # ListChan #
  544.  
  545.     proc listchan { nick host hand text } {
  546.          set chan [lindex $text 0]
  547.          set chans [join [lrange [split $text] 0 0]]
  548.     if {[channel get $chan GB]==0} { return; }
  549.     if { [nick2hand $nick] eq "*" } {
  550.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  551.     return 0
  552.     }
  553.     if {![isauth $hand]} {
  554.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  555.     return 0
  556.     }
  557.     if ![matchattr $hand o| [lindex $text 0]] {
  558.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  559.     return 0
  560.     }    
  561.     if {[string match -nocase $chans $chan]} {
  562.          set voir 1
  563.          putquick "privmsg $nick :\0034\[Liste Salons\]"
  564.     foreach liste [channels] {
  565.          putquick "privmsg $nick :\0037=>\0032 $voir \0037<= \0033 $liste"
  566.     incr voir 1
  567.     }
  568.          putquick "privmsg $nick :\0036\[Fin De Liste\]"
  569.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033List-Chan\0036\] \0031par : \0034$hand"
  570.     return 0
  571.     }
  572.     if {[lsearch [channels] $chans]==-1} {
  573.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  574.      return
  575.     }
  576. }
  577.    
  578.     # Access/Newpass #
  579.  
  580.     proc access { nick host hand text } {
  581.          set chan [lindex $text 0]
  582.          set mask [lindex $text 1]
  583.     if {[channel get $chan GB]==0} { return; }
  584.     if { [nick2hand $nick] eq "*" } {
  585.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  586.     return 0
  587.     }
  588.     if {![isauth $hand]} {
  589.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  590.     return 0
  591.     }
  592.     if ![string match #* $chan] {
  593.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick access <#salon> <mask> )"
  594.     return 0
  595.     }
  596.     if {$mask==""} {
  597.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick access <#salon> <mask> )"
  598.     return 0
  599.     }
  600.     if ![validchan $chan] {
  601.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  602.     return 0
  603.     }
  604.     if ![matchattr $hand o|o [lindex $text 0]] {
  605.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  606.     return 0
  607.     }
  608.          putserv "privmsg $nick :Liste des access de $chan correspondant à \0031\[ \0034$mask \0031\] :"
  609.     foreach user [userlist |n $chan] {
  610.     if [string match -nocase $mask $user] {
  611.          putserv "privmsg $nick :Owner $user"
  612.         }
  613.     }
  614.     foreach user [userlist |m $chan] {
  615.     if ![matchattr $user |n $chan]&&[string match -nocase $mask $user] {
  616.          putserv "privmsg $nick :Master $user"
  617.         }
  618.     }
  619.     foreach user [userlist |o $chan] {
  620.     if ![matchattr $user |m $chan]&&[string match -nocase $mask $user] {
  621.          putserv "privmsg $nick :Operateur $user"
  622.         }
  623.     }
  624.     foreach user [userlist o|] {
  625.     if [string match -nocase $mask $user] {
  626.          putserv "privmsg $nick :SuperOp $user"
  627.         }
  628.     }
  629.          putserv "privmsg $nick :Fin de la liste d'access."
  630.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Access\0036\] \0031par : \0034$hand"
  631.     return
  632. }
  633.  
  634.     # Newpass #
  635.  
  636.     proc newpass { nick uhost hand text } {
  637.     if { [nick2hand $nick] eq "*" } {
  638.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  639.     return 0
  640.     }
  641.     if {![isauth $hand]} {
  642.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  643.     return 0
  644.     }
  645.     if {$text==""} {
  646.          puthelp "notice $nick :Ancien mot de passe incorrect ! Veuillez respecter la syntaxe suivante : ( /msg $::botnick newpass <ancien-pass> <nouveau-pass> ) !"
  647.     }
  648.     if {[getuser $hand PASS]==""} {
  649.          setuser $hand PASS [lindex $text 0]
  650.          puthelp "notice $nick :Mot de passe défini : [lindex $text 0] !"
  651.     return 0
  652.     }
  653.     if {[passwdok $hand [lindex $text 0]]} {
  654.     if {[llength $text]>1} {
  655.          setuser $hand PASS [lindex $text 1]
  656.          puthelp "notice $nick :Nouveau mot de passe défini : [lindex $text 1] !"
  657.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033New-Pass\0036\] \0031par : \0034$hand"
  658.     return
  659.         }    
  660.     }
  661. }
  662.  
  663.     # Addop/Addmaster/Addowner/Addsuperop Msg #
  664.  
  665.     proc addop { nick host hand text } {
  666.          set vhand [lindex [split [lindex $text 0] |] 0]
  667.          set chan [lindex $text 1]
  668.     if {[channel get $chan GB]==0} { return; }
  669.     if { [nick2hand $nick] eq "*" } {
  670.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  671.     return 0
  672.     }
  673.     if ![isauth $hand] {
  674.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  675.     return 0
  676.     }
  677.     if {![string match #* $chan]} {
  678.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick addop <pseudo> <#salon> ) !"
  679.     return 0
  680.     }
  681.     if ![validchan $chan] {
  682.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  683.     return 0
  684.     }
  685.     if ![matchattr $hand o|m $chan] {
  686.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  687.     return 0
  688.     }
  689.     if [matchattr $vhand |n $chan] {
  690.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
  691.     return 0
  692.     }
  693.     if [matchattr $vhand |m $chan] {
  694.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
  695.     return 0
  696.     }
  697.     if [matchattr $vhand |o $chan] {
  698.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Opérateurs sur $chan !"
  699.     return 0
  700.     }
  701.     if [matchattr $vhand |m $chan] {
  702.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
  703.     return 0
  704.     }
  705.          adduser $vhand $vhand!*@*
  706.          setuser $vhand HOSTS $vhand|*!*@*
  707.          chattr  $vhand -h|+o $chan
  708.          puthelp "notice $nick :$vhand a bien été ajouté(e) en tant qu'opérateur sur $chan !"
  709.          puthelp "privmsg $vhand :Bonjour $vhand Je suis $::botnick le Robot de Gestion "
  710.          puthelp "privmsg $vhand :On vient de te créer un Access dans ma base de données"
  711.          puthelp "privmsg $vhand :Donc je te conseille de taper la commande qui suit "
  712.          puthelp "privmsg $vhand :/msg $::botnick conf"
  713.          puthelp "privmsg $vhand :Ceci t'aidera pour les premiers pas pour configurer ton mot de passe par exemple"
  714.          puthelp "privmsg $vhand :Si vous ne l'avez pas encore effectué sinon ceci ne vous servira à rien de le tapez"
  715.          puthelp "privmsg $vhand :Fin de l'aide."
  716.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Add-Op\0036\] \0031par : \0034$hand"
  717.          save
  718. }
  719.  
  720.     # Addmaster #
  721.  
  722.     proc addmaster { nick uhost hand text } {
  723.          set vhand [lindex [split [lindex $text 0] |] 0]
  724.          set chan [lindex $text 1]
  725.     if {[channel get $chan GB]==0} { return; }
  726.     if { [nick2hand $nick] eq "*" } {
  727.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  728.     return 0
  729.     }
  730.     if {![isauth $hand]} {
  731.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  732.     return 0
  733.     }
  734.     if {![string match #* $chan]} {
  735.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick addmaster <pseudo> <#salon> ) !"
  736.     return 0
  737.     }
  738.     if ![validchan $chan] {
  739.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  740.     return 0
  741.     }
  742.     if ![matchattr $hand o|n $chan] {
  743.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  744.     return 0
  745.     }
  746.     if [validuser [lindex $text 0]] {
  747.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List"
  748.     return 0
  749.     }
  750.          adduser $vhand [lindex $text 0]!*@*
  751.          setuser $vhand HOSTS [lindex $text 0]|*!*@*
  752.          chattr  $vhand -h|+om [lindex $text 1]
  753.          puthelp "notice $nick :[lindex $text 0] a bien été ajouté(e) en tant que Master sur [lindex $text 1] !"
  754.          puthelp "privmsg $vhand :Bonjour $vhand Je suis $::botnick le Robot de Gestion "
  755.          puthelp "privmsg $vhand :On vient de te créer un Access dans ma base de données"
  756.          puthelp "privmsg $vhand :Donc je te conseille de taper la commande qui suit "
  757.          puthelp "privmsg $vhand :/msg $::botnick conf"
  758.          puthelp "privmsg $vhand :Ceci t'aidera pour les premiers pas pour configurer ton mot de passe par exemple"
  759.          puthelp "privmsg $vhand :Si vous ne l'avez pas encore effectué sinon ceci ne vous servira à rien de le tapez"
  760.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Add-Master\0036\] \0031par : \0034$hand"
  761.          save
  762.     return
  763. }
  764.  
  765.     # Addowner #
  766.  
  767.     proc addowner { nick uhost hand text } {
  768.          set vhand [lindex [split [lindex $text 0] |] 0]
  769.          set chan [lindex $text 1]
  770.     if {[channel get $chan GB]==0} { return; }
  771.     if { [nick2hand $nick] eq "*" } {
  772.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  773.     return 0
  774.     }
  775.     if {![isauth $hand]} {
  776.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  777.     return 0
  778.     }
  779.     if {![string match #* $chan]} {
  780.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick addowner <pseudo> <#salon> ) !"
  781.     return 0
  782.     }
  783.     if ![validchan $chan] {
  784.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  785.     return 0
  786.     }
  787.     if ![matchattr $hand o| $chan] {
  788.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  789.     return 0
  790.     }
  791.     if {![validuser [lindex $text 0]]} {
  792.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List"
  793.     return 0
  794.     }
  795.          adduser $vhand [lindex $text 0]!*@*
  796.          setuser $vhand HOSTS [lindex $text 0]|*!*@*
  797.          chattr  $vhand -h|+on [lindex $text 1]
  798.          puthelp "notice $nick :[lindex $text 0] a bien été ajouté(e) en tant que Owner sur [lindex $text 1] !"
  799.          puthelp "privmsg $vhand :Bonjour $vhand Je suis $::botnick le Robot de Gestion "
  800.          puthelp "privmsg $vhand :On vient de te créer un Access dans ma base de données"
  801.          puthelp "privmsg $vhand :Donc je te conseille de taper la commande qui suit "
  802.          puthelp "privmsg $vhand :/msg $::botnick conf"
  803.          puthelp "privmsg $vhand :Ceci t'aidera pour les premiers pas pour configurer ton mot de passe par exemple"
  804.          puthelp "privmsg $vhand :Si vous ne l'avez pas encore effectué sinon ceci ne vous servira à rien de le tapez"
  805.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Add-Owner\0036\] \0031par : \0034$hand"
  806.          save
  807.     return 0
  808.     }
  809.  
  810. # Addsuperop #
  811.  
  812.      proc addsuperop { nick host hand text } {
  813.          set vhand [lindex [split [lindex $text 0] |] 0]
  814.          set chan [lindex $text 1]
  815.     if { [nick2hand $nick] eq "*" } {
  816.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  817.     return 0
  818.     }
  819.     if ![isauth $hand] {
  820.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  821.     return 0
  822.     }
  823.     if ![matchattr $hand o|] {
  824.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  825.     return 0
  826.     }
  827.          adduser $vhand $vhand!*@*
  828.          setuser $vhand HOSTS $vhand|*!*@*
  829.          chattr  $vhand +o
  830.          chattr $vhand -h|
  831.          puthelp "notice $nick :$vhand a bien été ajouté(e) en tant que SuperOp sur $::botnick !"
  832.          puthelp "privmsg $vhand :Bonjour $vhand Je suis $::botnick le Robot de Gestion "
  833.          puthelp "privmsg $vhand :On vient de te créer un Access dans ma base de données"
  834.          puthelp "privmsg $vhand :Donc je te conseille de taper la commande qui suit "
  835.          puthelp "privmsg $vhand :/msg $::botnick conf"
  836.          puthelp "privmsg $vhand :Ceci t'aidera pour les premiers pas pour configurer ton mot de passe par exemple"
  837.          puthelp "privmsg $vhand :Si vous ne l'avez pas encore effectué sinon ceci ne vous servira à rien de le tapez"
  838.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Add-Superop\0036\] \0031par : \0034$hand"
  839.          save
  840. }
  841.  
  842.     # Delop/Delmaster/Delowner/Delsuperop #
  843.  
  844.     # Delop #
  845.  
  846.     proc delop { nick uhost hand text } {
  847.          set vhand [lindex [split [lindex $text 0] |] 0]
  848.          set chan [lindex $text 1]
  849.     if {[channel get $chan GB]==0} { return; }
  850.     if { [nick2hand $nick] eq "*" } {
  851.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  852.     return 0
  853.     }
  854.     if {![isauth $hand]} {
  855.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  856.     return 0
  857.     }
  858.     if {![string match #* $chan]} {
  859.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick delop <pseudo> <#salon> ) !"
  860.     return 0
  861.     }
  862.     if ![validchan $chan] {
  863.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  864.     return 0
  865.     }
  866.     if ![matchattr $hand o|m $chan] {
  867.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  868.     return 0
  869.     }
  870.     if ![matchattr $vhand |o $chan] {
  871.          puthelp "notice $nick :Ce pseudo ne figure pas dans l'Access-List de $chan !"
  872.     return 0
  873.     }
  874.     if [matchattr $vhand |n $chan] {
  875.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
  876.     return 0
  877.     }
  878.     if [matchattr $vhand |m $chan] {
  879.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
  880.     return 0
  881.     }
  882.          delchanrec $vhand $chan
  883.          puthelp "notice $nick :[lindex $text 0] a bien été supprimé(e) de l'Access-List Opérateurs sur [lindex $text 1] !"
  884.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Del-Op\0036\] \0031par : \0034$hand"
  885.          save
  886.     foreach c [channels] {
  887.     if [haschanrec $vhand $c] {
  888.     return
  889.         }
  890.     }
  891.          deluser $vhand
  892.          save
  893. }
  894.  
  895.     # Delmaster #
  896.  
  897.     proc delmaster { nick uhost hand text } {
  898.          set vhand [lindex [split [lindex $text 0] |] 0]
  899.          set chan [lindex $text 1]
  900.     if {[channel get $chan GB]==0} { return; }
  901.     if { [nick2hand $nick] eq "*" } {
  902.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  903.     return 0
  904.     }
  905.     if {![isauth $hand]} {
  906.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  907.     return 0
  908.     }
  909.     if {![string match #* $chan]} {
  910.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick delmaster <pseudo> <#salon> ) !"
  911.     return 0
  912.     }
  913.     if ![validchan $chan] {
  914.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  915.     return 0
  916.     }
  917.     if ![matchattr $hand o|n $chan] {
  918.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  919.     return 0
  920.     }
  921.     if ![matchattr $vhand |o $chan] {
  922.          puthelp "notice $nick :Ce pseudo ne figure pas dans l'Access-List de $chan !"
  923.     return 0
  924.     }
  925.     if [matchattr $vhand |n $chan] {
  926.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
  927.     return 0
  928.     }
  929.     if ![matchattr $vhand |m $chan] {
  930.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
  931.     return 0
  932.     }
  933.          delchanrec $vhand $chan
  934.          puthelp "notice $nick :[lindex $text 0] a bien été supprimé(e) de l'Access-List Master sur [lindex $text 1] !"
  935.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Del-Master\0036\] \0031par : \0034$hand"
  936.          save
  937.     foreach c [channels] {
  938.     if [haschanrec $vhand $c] {
  939.      return
  940.         }
  941.     }
  942.          deluser $vhand
  943.          save
  944. }
  945.  
  946.     # Delowner #
  947.  
  948.     proc delowner { nick uhost hand text } {
  949.          set vhand [lindex [split [lindex $text 0] |] 0]
  950.          set chan [lindex $text 1]
  951.     if {[channel get $chan GB]==0} { return; }
  952.     if { [nick2hand $nick] eq "*" } {
  953.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  954.     return 0
  955.     }
  956.     if {![isauth $hand]} {
  957.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  958.     return 0
  959.     }
  960.     if {![string match #* $chan]} {
  961.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick delowner <pseudo> <#salon> ) !"
  962.     return 0
  963.     }
  964.     if ![validchan $chan] {
  965.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  966.     return 0
  967.     }
  968.     if ![matchattr $hand o| $chan] {
  969.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  970.     return 0
  971.     }
  972.     if ![matchattr $vhand |o $chan] {
  973.          puthelp "notice $nick :Ce pseudo ne figure pas dans l'Access-List de $chan !"
  974.     return 0
  975.     }
  976.     if ![matchattr $vhand |n $chan] {
  977.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
  978.     return 0
  979.     }
  980.     if ![matchattr $vhand |m $chan] {
  981.          puthelp "notice $nick :Ce pseudo figure dans l'Access-List Master sur $chan !"
  982.     return 0
  983.     }
  984.          delchanrec $vhand $chan
  985.          puthelp "notice $nick :[lindex $text 0] a bien été supprimé(e) de l'Access-List Owner sur [lindex $text 1] !"
  986.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Del-Owner\0036\] \0031par : \0034$hand"
  987.          save
  988.     foreach c [channels] {
  989.     if [haschanrec $vhand $c] {
  990.     return
  991.         }
  992.     }
  993.          deluser $vhand
  994.          save
  995. }
  996.  
  997.     # Delsuperop #
  998.  
  999.     proc delsuperop { nick host hand text } {
  1000.          set vhand [lindex [split [lindex $text 0] |] 0]
  1001.          set chan [lindex $text 1]
  1002.     if { [nick2hand $nick] eq "*" } {
  1003.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1004.     return 0
  1005.     }
  1006.     if ![isauth $hand] {
  1007.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1008.     return 0
  1009.     }
  1010.     if ![matchattr $hand o] {
  1011.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1012.     return 0
  1013.     }
  1014.          deluser $vhand
  1015.          puthelp "notice $nick :$vhand a bien été supprimé en tant que superop sur $::botnick !"
  1016.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Del-Superop\0036\] \0031par : \0034$hand"
  1017.          save
  1018. }
  1019.  
  1020.     # op/deop/voice/devoice Chan #
  1021.  
  1022.     # op #
  1023.  
  1024.     proc op { nick host hand chan text } {
  1025.     if {[channel get $chan GB]==0} { return; }
  1026.     if { [nick2hand $nick] eq "*" } {
  1027.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1028.     return 0
  1029.     }
  1030.     if {![isauth $hand]} {
  1031.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1032.     return 0
  1033.     }
  1034.     if {$text!=""} {
  1035.     if ![matchattr $hand o|o $chan] {
  1036.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1037.     return 0
  1038.     }
  1039.          pushmode $chan +oooooo [join $text]
  1040.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Op\0036\] \0031par : \0034$hand"
  1041.     return 0
  1042.     }
  1043.     if [isop [join $nick] $chan] {
  1044.          putserv "NOTICE $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1045.     return 0
  1046.     }
  1047.          pushmode $chan +o [join $nick]
  1048.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Op\0036\] \0031par : \0034$hand"
  1049. }
  1050.  
  1051.     # Deop #
  1052.  
  1053.     proc deop { nick host hand chan text } {
  1054.          set verifexempt "[split [lindex $text 0] |]"
  1055.          set nickverife "[lindex $verifexempt 0]"
  1056.     if {[channel get $chan GB]==0} { return; }
  1057.     if { [nick2hand $nick] eq "*" } {
  1058.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1059.     return 0
  1060.     }
  1061.     if {![isauth $hand]} {
  1062.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1063.     return 0
  1064.     }
  1065.     if {$text!=""} {
  1066.     if {![matchattr $hand o|o $chan]} {
  1067.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1068.     return 0
  1069.     }
  1070.     if {[progfile exempt icr $nickverife]!="0"} {
  1071.          putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
  1072.     return 0
  1073.     }
  1074.          pushmode $chan -oooooo [join $text]
  1075.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Deop\0036\] \0031par : \0034$hand"
  1076.     return 0
  1077.     }
  1078.     if {![isop [join $nick] $chan]} {
  1079.          putserv "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1080.     return 0
  1081.     }
  1082.          pushmode $chan -o [join $nick]
  1083.          puthelp "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Deop\0036\] \0031par : \0034$hand"
  1084. }
  1085.  
  1086.     # Voice #
  1087.  
  1088.     proc voice { nick host hand chan text } {
  1089.     if {[channel get $chan GB]==0} { return; }
  1090.     if { [nick2hand $nick] eq "*" } {
  1091.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1092.     return 0
  1093.     }
  1094.     if {![isauth $hand]} {
  1095.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1096.     return 0
  1097.     }
  1098.     if {![matchattr $hand o|o $chan]} {
  1099.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1100.     return 0
  1101.     }
  1102.     if {$text!=""} {
  1103.          putserv "mode $chan +vvvvvv [join $text]"
  1104.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Voice\0036\] \0031par : \0034$hand"
  1105.     return 0
  1106.     }
  1107.     if [isvoice [join $nick] $chan] {
  1108.          putserv "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1109.     return 0
  1110.     }
  1111.          pushmode $chan +v [join $nick]
  1112.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Voice\0036\] \0031par : \0034$hand"
  1113. }
  1114.  
  1115.     # Devoice #
  1116.  
  1117.     proc devoice { nick host hand chan text } {
  1118.          set verifexempt "[split [lindex $text 0] |]"
  1119.          set nickverife "[lindex $verifexempt 0]"
  1120.     if {[channel get $chan GB]==0} { return; }
  1121.     if { [nick2hand $nick] eq "*" } {
  1122.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1123.     return 0
  1124.     }
  1125.     if {![isauth $hand]} {
  1126.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1127.     return 0
  1128.     }
  1129.     if {![matchattr $hand o|o $chan]} {
  1130.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1131.     return 0
  1132.     }
  1133.     if {[progfile exempt icr $nickverife]!="0"} {
  1134.          putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
  1135.     return 0
  1136.     }
  1137.     if {$text!=""} {
  1138.          pushmode $chan -vvvvvv [join $text]
  1139.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Devoice\0036\] \0031par : \0034$hand"
  1140.     return 0
  1141.     }
  1142.     if {![isvoice [join $nick] $chan]} {
  1143.          putserv "NOTICE $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1144.     return 0
  1145.     }
  1146.          pushmode $chan -v [join $nick]
  1147.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Devoice\0036\] \0031par : \0034$hand"
  1148. }
  1149.  
  1150.     # Opall/Deopall/Voiceall/Devoiceall Chan #
  1151.  
  1152.     # Opall #
  1153.  
  1154.     proc opall {nick host hand chan arg} {
  1155.          set arg [split $arg]
  1156.     if {[channel get $chan GB]==0} { return; }
  1157.     if { [nick2hand $nick] eq "*" } {
  1158.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1159.     return 0
  1160.     }
  1161.     if {![isauth $hand]} {
  1162.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1163.     return 0
  1164.     }
  1165.     if {![matchattr $hand o|m $chan]} {
  1166.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1167.     return 0
  1168.     }
  1169.     foreach opall [chanlist $chan] { if [isop $opall $chan] continue; pushmode $chan +o $opall }
  1170.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Op-All\0036\] \0031par : \0034$hand"
  1171.     return
  1172. }
  1173.  
  1174.     # Deopall #
  1175.  
  1176.     proc deopall { nick host hand chan arg } {
  1177.          set arg [split $arg]
  1178.     if {[channel get $chan GB]==0} { return; }
  1179.     if { [nick2hand $nick] eq "*" } {
  1180.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1181.     return 0
  1182.     }
  1183.     if {![isauth $hand]} {
  1184.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1185.     return 0
  1186.     }
  1187.     if {![matchattr $hand o|m $chan]} {
  1188.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1189.     return 0
  1190.     }
  1191.     foreach deopall [chanlist $chan] { if [isvoice $deopall $chan] continue; pushmode $chan -o $deopall }
  1192.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Deop-All\0036\] \0031par : \0034$hand"
  1193.     return
  1194. }
  1195.  
  1196.     # voiceall #
  1197.  
  1198.     proc voiceall { nick host hand chan arg } {
  1199.          set arg [split $arg]
  1200.     if {[channel get $chan GB]==0} { return; }
  1201.     if { [nick2hand $nick] eq "*" } {
  1202.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1203.     return 0
  1204.     }
  1205.     if {![isauth $hand]} {
  1206.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1207.     return 0
  1208.     }
  1209.     if {![matchattr $hand o|m $chan]} {
  1210.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1211.     return 0
  1212.     }
  1213.     foreach voiceall [chanlist $chan] { if [isop $voiceall $chan] continue; pushmode $chan +v $voiceall }
  1214.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Voice-All\0036\] \0031par : \0034$hand"
  1215.     return
  1216. }
  1217.  
  1218.     # Devoiceall #
  1219.  
  1220.     proc devoiceall { nick host hand chan arg } {
  1221.          set arg [split $arg]
  1222.     if {[channel get $chan GB]==0} { return; }
  1223.     if { [nick2hand $nick] eq "*" } {
  1224.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1225.     return 0
  1226.     }
  1227.     if {![isauth $hand]} {
  1228.          puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> ) !"
  1229.     return 0
  1230.     }
  1231.     if {![matchattr $hand o|m $chan]} {
  1232.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1233.     return 0
  1234.     }
  1235.     foreach devoiceall [chanlist $chan] { if [isop $devoiceall $chan] continue; pushmode $chan -v $devoiceall }
  1236.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Devoice-All\0036\] \0031par : \0034$hand"
  1237.     return
  1238. }
  1239.    
  1240.     # Opall/Deopall/Voiceall/Devoiceall Msg #
  1241.  
  1242.     # Opall #
  1243.  
  1244.     proc xopall { nick host hand text } {
  1245.          set chan [lindex $text 0]
  1246.     if { [nick2hand $nick] eq "*" } {
  1247.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1248.     return 0
  1249.     }
  1250.     if {![isauth $hand]} {
  1251.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1252.     return 0
  1253.     }
  1254.     if {![string match #* [lindex $text 0]]} {
  1255.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick opall <#salon> ) !"
  1256.     return 0
  1257.     }
  1258.     if {![validchan [lindex $text 0]]} {
  1259.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1260.     return 0
  1261.     }
  1262.     if {![matchattr $hand o|m [lindex $text 0]]} {
  1263.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1264.     return 0
  1265.     }
  1266.     if {![botonchan [lindex $text 0]]} {
  1267.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1268.     return 0
  1269.     }
  1270.     if {![botisop [lindex $text 0]]} {
  1271.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1272.     return 0
  1273.     }
  1274.     if {![onchan $nick [lindex $text 0]]} {
  1275.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1276.     return 0
  1277.     }
  1278.     if {[isop [join $nick] [lindex $text 0]]} {
  1279.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1280.     return 0
  1281.     }
  1282.     foreach xopall [chanlist $chan] { if [isop $xopall $chan] continue; pushmode $chan +o $xopall }
  1283.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Op-All\0036\] \0031par : \0034$hand"
  1284. }
  1285.    
  1286.     # Deopall #
  1287.  
  1288.     proc xdeopall { nick host hand text } {
  1289.          set chan [lindex $text 0]
  1290.     if { [nick2hand $nick] eq "*" } {
  1291.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1292.     return 0
  1293.     }
  1294.     if {![isauth $hand]} {
  1295.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1296.     return 0
  1297.     }
  1298.     if {![string match #* [lindex $text 0]]} {
  1299.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick deopall <#salon> ) !"
  1300.     return 0
  1301.     }
  1302.     if {![validchan [lindex $text 0]]} {
  1303.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1304.     return 0
  1305.     }
  1306.     if {![matchattr $hand o|m [lindex $text 0]]} {
  1307.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1308.     return 0
  1309.     }
  1310.     if {![botonchan [lindex $text 0]]} {
  1311.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1312.     return 0
  1313.     }
  1314.     if {![botisop [lindex $text 0]]} {
  1315.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1316.     return 0
  1317.     }
  1318.     if {![onchan $nick [lindex $text 0]]} {
  1319.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1320.     return 0
  1321.     }
  1322.     foreach xdeopall [chanlist $chan] { if [isvoice $xdeopall $chan] continue; pushmode $chan -o $xdeopall }
  1323.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Deop-All\0036\] \0031par : \0034$hand"
  1324. }
  1325.    
  1326.     # Voiceall #
  1327.  
  1328.     proc xvoiceall { nick host hand text } {
  1329.          set chan [lindex $text 0]
  1330.     if { [nick2hand $nick] eq "*" } {
  1331.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1332.     return 0
  1333.     }
  1334.     if {![isauth $hand]} {
  1335.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1336.     return 0
  1337.     }
  1338.     if {![string match #* [lindex $text 0]]} {
  1339.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick voiceall <#salon> ) !"
  1340.     return 0
  1341.     }
  1342.     if {![validchan [lindex $text 0]]} {
  1343.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1344.     return 0
  1345.     }
  1346.     if {![matchattr $hand o|m [lindex $text 0]]} {
  1347.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1348.     return 0
  1349.     }
  1350.     if {![botonchan [lindex $text 0]]} {
  1351.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1352.     return 0
  1353.     }
  1354.     if {![botisop [lindex $text 0]]} {
  1355.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1356.     return 0
  1357.     }
  1358.     if {![onchan $nick [lindex $text 0]]} {
  1359.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1360.     return 0
  1361.     }
  1362.     foreach xvoiceall [chanlist $chan] { if [isop $xvoiceall $chan] continue; pushmode $chan +v $xvoiceall }
  1363.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Voice-All\0036\] \0031par : \0034$hand"
  1364. }
  1365.    
  1366.     # Devoiceall #
  1367.  
  1368.     proc xdevoiceall { nick host hand text } {
  1369.          set chan [lindex $text 0]
  1370.     if { [nick2hand $nick] eq "*" } {
  1371.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1372.     return 0
  1373.     }
  1374.     if {![isauth $hand]} {
  1375.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1376.     return 0
  1377.     }
  1378.     if {![string match #* [lindex $text 0]]} {
  1379.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick devoiceall <#salon> ) !"
  1380.     return 0
  1381.     }
  1382.     if {![validchan [lindex $text 0]]} {
  1383.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1384.     return 0
  1385.     }
  1386.     if {![matchattr $hand o|m [lindex $text 0]]} {
  1387.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1388.     return 0
  1389.     }
  1390.     if {![botonchan [lindex $text 0]]} {
  1391.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1392.     return 0
  1393.     }
  1394.     if {![botisop [lindex $text 0]]} {
  1395.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1396.     return 0
  1397.     }
  1398.     if {![onchan $nick [lindex $text 0]]} {
  1399.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1400.     return 0
  1401.     }
  1402.     foreach xdevoiceall [chanlist $chan] { if [isop $xdevoiceall $chan] continue; pushmode $chan -v $xdevoiceall }
  1403.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Devoice-All\0036\] \0031par : \0034$hand"
  1404. }
  1405.  
  1406.     # op/deop/voice/devoice Msg #
  1407.  
  1408.     # Op #
  1409.  
  1410.     proc xop { nick host hand text } {
  1411.          set chan [lindex $text 0]
  1412.     if {[channel get $chan GB]==0} { return; }
  1413.     if { [nick2hand $nick] eq "*" } {
  1414.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1415.     return 0
  1416.     }
  1417.     if {![isauth $hand]} {
  1418.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1419.     return 0
  1420.     }
  1421.     if {![string match #* [lindex $text 0]]} {
  1422.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick op <#salon> <pseudo(s)> )"
  1423.     return 0
  1424.     }
  1425.     if {![validchan [lindex $text 0]]} {
  1426.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1427.     return 0
  1428.     }
  1429.     if {![matchattr $hand o|o [lindex $text 0]]} {
  1430.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1431.     return 0
  1432.     }
  1433.     if {![botonchan [lindex $text 0]]} {
  1434.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1435.     return 0
  1436.     }
  1437.     if {![botisop [lindex $text 0]]} {
  1438.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1439.     return 0
  1440.     }
  1441.     if {[lindex $text 1]!=""} {
  1442.          pushmode [lindex $text 0] +oooooo [join [lrange $text 1 end]]
  1443.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Op\0036\] \0031par : \0034$hand"
  1444.     return 0
  1445.     }
  1446.     if {![onchan $nick [lindex $text 0]]} {
  1447.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1448.     return 0
  1449.     }
  1450.     if {[isop [join $nick] [lindex $text 0]]} {
  1451.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1452.     return 0
  1453.     }
  1454.          pushmode [lindex $text 0] +o [join $nick]
  1455.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Op\0036\] \0031par : \0034$hand"
  1456. }
  1457.  
  1458.     # Deop #
  1459.  
  1460.     proc xdeop { nick host hand text } {
  1461.          set chan [lindex $text 0]
  1462.          set verifexempt "[split [lindex $text 1] |]"
  1463.          set nickverife "[lindex $verifexempt 0]"
  1464.     if {[channel get $chan GB]==0} { return; }
  1465.     if { [nick2hand $nick] eq "*" } {
  1466.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1467.     return 0
  1468.     }
  1469.     if {![isauth $hand]} {
  1470.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1471.     return 0
  1472.     }
  1473.     if {![string match #* [lindex $text 0]]} {
  1474.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick deop <#salon> <pseudo(s)> ) !"
  1475.     return 0
  1476.     }
  1477.     if {![validchan [lindex $text 0]]} {
  1478.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1479.     return 0
  1480.     }
  1481.     if {![matchattr $hand o|o [lindex $text 0]]} {
  1482.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1483.     return 0
  1484.     }
  1485.     if {![onchan $nick [lindex $text 0]]} {
  1486.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1487.     return 0
  1488.     }
  1489.     if {![botonchan [lindex $text 0]]} {
  1490.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1491.     return 0
  1492.     }
  1493.     if {![botisop [lindex $text 0]]} {
  1494.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1495.     return 0
  1496.     }
  1497.     if {[progfile exempt icr $nickverife]!="0"} {
  1498.          putserv "notice $nick :Attention le Nick: \2$nickverife\2 est dans la liste des protégés."
  1499.     return 0
  1500.     }
  1501.     if {[lindex $text 1] !=""} {
  1502.          pushmode [lindex $text 0] -oooooo [join [lrange $text 1 end]]
  1503.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Deop\0036\] \0031par : \0034$hand"
  1504.     return 0
  1505.     }
  1506.     if {![isop [join $nick] [lindex $text 0]]} {
  1507.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1508.     return 0
  1509.     }
  1510.          pushmode [lindex $text 0] -o [join $nick]
  1511.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Deop\0036\] \0031par : \0034$hand"
  1512. }
  1513.  
  1514.     # Voice #
  1515.  
  1516.     proc xvoice { nick uhost hand text } {
  1517.          set chan [lindex $text 0]
  1518.     if {[channel get $chan GB]==0} { return; }
  1519.     if { [nick2hand $nick] eq "*" } {
  1520.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1521.     return 0
  1522.     }
  1523.     if {![isauth $hand]} {
  1524.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1525.     return 0
  1526.     }
  1527.     if {![string match #* [lindex $text 0]]} {
  1528.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick voice <#salon> <pseudo(s)> ) !"
  1529.     return 0
  1530.     }
  1531.     if {![validchan [lindex $text 0]]} {
  1532.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1533.     return 0
  1534.     }
  1535.     if {![matchattr $hand o|o [lindex $text 0]]} {
  1536.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1537.     return 0
  1538.     }
  1539.     if {![onchan $nick [lindex $text 0]]} {
  1540.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1541.     return 0
  1542.     }
  1543.     if {![botonchan [lindex $text 0]]} {
  1544.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1545.     return 0
  1546.     }
  1547.     if {![botisop [lindex $text 0]]} {
  1548.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1549.     return 0
  1550.     }
  1551.     if {[lindex $text 1] !=""} {
  1552.          pushmode [lindex $text 0] +vvvvvv [join [lrange $text 1 end]]
  1553.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Voice\0036\] \0031par : \0034$hand"
  1554.     return 0
  1555.     }
  1556.     if [isop [join $nick] [lindex $text 0]] {
  1557.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1558.     return 0
  1559.     }
  1560.          pushmode [lindex $text 0] +v [join $nick]
  1561.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Voice\0036\] \0031par : \0034$hand"
  1562. }
  1563.  
  1564.     # Devoice #
  1565.  
  1566.     proc xdevoice { nick host hand text } {
  1567.          set chan [lindex $text 0]
  1568.          set verifexempt "[split [lindex $text 1] |]"
  1569.          set nickverife "[lindex $verifexempt 0]"
  1570.     if {[channel get $chan GB]==0} { return; }
  1571.     if { [nick2hand $nick] eq "*" } {
  1572.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1573.     return 0
  1574.     }
  1575.     if {![isauth $hand]} {
  1576.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1577.     return 0
  1578.     }
  1579.     if {![string match #* [lindex $text 0]]} {
  1580.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick devoice <#salon> <pseudo(s)> ) !"
  1581.     return 0
  1582.     }
  1583.     if {![validchan [lindex $text 0]]} {
  1584.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1585.     return 0
  1586.     }
  1587.     if {![matchattr $hand o|o [lindex $text 0]]} {
  1588.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1589.     return 0
  1590.     }
  1591.     if {![onchan $nick [lindex $text 0]]} {
  1592.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1593.     return 0
  1594.     }
  1595.     if {![botonchan [lindex $text 0]]} {
  1596.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1597.     return 0
  1598.     }
  1599.     if {![botisop [lindex $text 0]]} {
  1600.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1601.     return 0
  1602.     }
  1603.     if {[progfile exempt icr $nickverife]!="0"} {
  1604.          putserv "notice $nick :Attention le Nick: \2$nickverife\2 est dans la liste des protégés."
  1605.     return 0
  1606.     }
  1607.     if {[lindex $text 1] !=""} {
  1608.          pushmode [lindex $text 0] -vvvvvv [join [lrange $text 1 end]]
  1609.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Devoice\0036\] \0031par : \0034$hand"
  1610.     return 0
  1611.     }
  1612.     if ![isvoice [join $nick] [lindex $text 0]] {
  1613.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(iso)]"
  1614.     return 0
  1615.     }
  1616.          pushmode [lindex $text 0] -v [join $nick]
  1617.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Devoice\0036\] \0031par : \0034$hand"
  1618. }
  1619.  
  1620.     # Ban/Kick/Unban/Kickban Chan  #
  1621.  
  1622.     # Ban #
  1623.  
  1624.     proc ban { nick host hand chan text } {
  1625.          set verifexempt "[split [lindex $text 0] |]"
  1626.          set nickverife "[lindex $verifexempt 0]"
  1627.     if {[channel get $chan GB]==0} { return; }
  1628.     if { [nick2hand $nick] eq "*" } {
  1629.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1630.     return 0
  1631.     }
  1632.     if {![isauth $hand]} {
  1633.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1634.     return 0
  1635.     }
  1636.     if {![matchattr $hand o|o $chan]} {
  1637.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1638.     return 0
  1639.     }
  1640.     if {$text == ""} {
  1641.          puthelp "notice $nick :Syntaxe incorrecte ! ( $::GB::commande(choix)ban <pseudo/host> ) !"
  1642.     return 0
  1643.     }
  1644.     if {[progfile exempt icr $nickverife]!="0"} {
  1645.          putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
  1646.     return 0
  1647.     }
  1648.     if {[string match *!*@* [lindex $text 0]]} {
  1649.          pushmode $chan +b [lindex $text 0]
  1650.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Ban\0036\] \0031par : \0034$hand"
  1651.     return 0
  1652.     }
  1653.     if {[llength [getchanhost [lindex $text 0]]]!=0} {
  1654.          set host [lindex [split [getchanhost [lindex $text 0]] @] 1]
  1655.          pushmode $chan +b *!*@$host
  1656.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Ban\0036\] \0031par : \0034$hand"
  1657.     return
  1658.     }
  1659.          puthelp "notice $nick :Le pseudo [lindex $text 0] n'est pas sur un de mes salons, je ne peux récupérer son host !"
  1660. }
  1661.  
  1662.     # Kick #
  1663.  
  1664.     proc kick { nick uhost hand chan text } {
  1665.          set Knick "[lindex $text 0]"
  1666.          set verifexempt "[split [lindex $text 0] |]"
  1667.          set nickverife "[lindex $verifexempt 0]"
  1668.     if {[channel get $chan GB]==0} { return; }
  1669.     if { [nick2hand $nick] eq "*" } {
  1670.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1671.     return 0
  1672.     }
  1673.     if {![isauth $hand]} {
  1674.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1675.     return 0
  1676.     }
  1677.     if {![matchattr $hand o|o $chan]} {
  1678.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1679.     return 0
  1680.     }
  1681.     if {$text == ""} {
  1682.          puthelp "notice $nick :Syntaxe : ( $::GB::commande(choix)kick <pseudo> ) !"
  1683.     return 0
  1684.     }
  1685.     if {$text != ""} {
  1686.     if {![onchan [lindex $text 0]]} {
  1687.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1688.     return 0
  1689.     }
  1690.     if {[progfile exempt icr $nickverife]!="0"} {
  1691.          putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
  1692.     return 0
  1693.     }
  1694.     if {[lindex $text 1] == ""} {
  1695.          putkick $chan [lindex $text 0] [subst -nocommands -nobackslashes $::GB::msg(kick)]
  1696.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Kick\0036\] \0031par : \0034$hand"
  1697.     return 0
  1698.         }
  1699.     }
  1700. }
  1701.  
  1702.     # Unban #
  1703.  
  1704.     proc unban { nick uhost hand chan text } {
  1705.     if {[channel get $chan GB]==0} { return; }
  1706.     if { [nick2hand $nick] eq "*" } {
  1707.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1708.     return 0
  1709.     }
  1710.     if {![isauth $hand]} {
  1711.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1712.     return 0
  1713.     }
  1714.     if {![matchattr $hand o|o $chan]} {
  1715.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1716.     return 0
  1717.     }
  1718.     if {$text == ""} {
  1719.          puthelp "notice $nick :Syntaxe : ( $::GB::commande(choix)unban <host> ) !"
  1720.     return 0
  1721.     }
  1722.     if {[string match *!*@* [lindex $text 0]]} {
  1723.          pushmode $chan -b [lindex $text 0]
  1724.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Unban\0036\] \0031par : \0034$hand"
  1725.     return 0
  1726.     }
  1727.     if {[llength [getchanhost [lindex $text 0]]]!=0} {
  1728.          set host [lindex [split [getchanhost [lindex $text 0]] @] 1]
  1729.          putquick "mode $chan -b *!*@$host"
  1730.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Unban\0036\] \0031par : \0034$hand"
  1731.     return
  1732.     }
  1733. }
  1734.  
  1735.     # Kickban #
  1736.  
  1737.     proc kickban { nick host hand chan text } {
  1738.          set KBnick "[lindex $text 0]"
  1739.          set host [lindex [split [getchanhost [lindex $text 0]] @] 1]
  1740.          set verifexempt "[split [lindex $text 0] |]"
  1741.          set nickverife "[lindex $verifexempt 0]"
  1742.     if {[channel get $chan GB]==0} { return; }
  1743.     if { [nick2hand $nick] eq "*" } {
  1744.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1745.     return 0
  1746.     }
  1747.     if {![isauth $hand]} {
  1748.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1749.     return 0
  1750.     }
  1751.     if {![matchattr $hand o|o $chan]} {
  1752.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1753.     return 0
  1754.     }
  1755.     if {$text == ""} {
  1756.          puthelp "notice $nick :Syntaxe : ( $::GB::commande(choix)kickban <pseudo> ) !"
  1757.     return 0
  1758.     }
  1759.     if {![onchan [lindex $text 0] $chan]} {
  1760.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1761.     return 0
  1762.     }
  1763.     if {![botisop [lindex $chan]]} {
  1764.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1765.     return 0
  1766.     }
  1767.     if {[progfile exempt icr $nickverife]!="0"} {
  1768.          putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
  1769.     return 0
  1770.     }
  1771.         ::GB::ban_user $KBnick *!*@$host $chan
  1772.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Kick-Ban\0036\] \0031par : \0034$hand"
  1773.     return
  1774. }
  1775.  
  1776.     # Ban/Kick/Unban/Kickban MSG #
  1777.  
  1778.     # Ban #
  1779.  
  1780.     proc xban { nick uhost hand arg } {
  1781.          set chan [lindex $arg 0]
  1782.          set cible [lindex $arg 1]
  1783.          set verifexempt "[split [lindex $arg 1] |]"
  1784.          set nickverife "[lindex $verifexempt 0]"
  1785.     if {[channel get $chan GB]==0} { return; }
  1786.     if { [nick2hand $nick] eq "*" } {
  1787.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1788.     return 0
  1789.     }
  1790.     if {![isauth $hand]} {
  1791.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1792.     return 0
  1793.     }
  1794.     if ("[llength $arg]"!="2")||![string match -nocase #* $chan] {
  1795.          puthelp "notice $nick :Syntaxe incorrect ( /msg $::botnick ban <#salon> <pseudo/host> ) !"
  1796.     return 0
  1797.     }
  1798.     if {![validchan [lindex $arg 0]]} {
  1799.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1800.     return 0
  1801.     }
  1802.     if {![matchattr $hand o|o $chan]} {
  1803.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1804.     return 0
  1805.     }
  1806.     if {![botonchan [lindex $arg 0]]} {
  1807.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1808.     return 0
  1809.     }
  1810.     if {![botisop [lindex $arg 0]]} {
  1811.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1812.     return 0
  1813.     }
  1814.     if {[string match *!*@* $cible]} {
  1815.          putquick "mode $chan +b $cible"
  1816.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Ban\0036\] \0031par : \0034$hand"
  1817.     return 0
  1818.     }
  1819.     if {[progfile exempt icr $nickverife]!="0"} {
  1820.          putserv "notice $nick :Attention le Nick: \2$cible\2 est dans la liste des protégés."
  1821.     return 0
  1822.     }
  1823.     if {[llength [getchanhost $cible]]!=0} {
  1824.          set host [lindex [split [getchanhost $cible] @] 1]
  1825.          putquick "mode $chan +b *!*@$host"
  1826.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Ban\0036\] \0031par : \0034$hand"
  1827.     return 0
  1828.     }
  1829.          puthelp "notice $nick :Le pseudo $cible n'est pas sur un de mes salons, je ne peux récupérer son host !"
  1830. }
  1831.  
  1832.     # kick #
  1833.  
  1834.     proc xkick { nick uhost hand text } {
  1835.          set Knick "[lindex $text 0]"
  1836.          set chan [lindex $text 0]
  1837.          set cible [lindex $text 1]
  1838.          set verifexempt "[split [lindex $text 1] |]"
  1839.          set nickverife "[lindex $verifexempt 0]"
  1840.     if {[channel get $chan GB]==0} { return; }
  1841.     if { [nick2hand $nick] eq "*" } {
  1842.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1843.     return 0
  1844.     }
  1845.     if {![isauth $hand]} {
  1846.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1847.     return 0
  1848.     }
  1849.     if {![string match #* [lindex $text 0]]} {
  1850.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick kick <#salon> <pseudo(s)> ) !"
  1851.     return 0
  1852.     }
  1853.     if {![validchan [lindex $text 0]]} {
  1854.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  1855.     return 0
  1856.     }
  1857.     if {![matchattr $hand o|o $chan]} {
  1858.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1859.     return 0
  1860.     }
  1861.     if {![onchan $nick [lindex $text 0]]} {
  1862.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1863.     return 0
  1864.     }
  1865.     if {![botonchan [lindex $text 0]]} {
  1866.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  1867.     return 0
  1868.     }
  1869.     if {![botisop [lindex $text 0]]} {
  1870.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  1871.     return 0
  1872.     }
  1873.     if {![onchan $cible $chan]} {
  1874.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nopseudo)]"
  1875.     return 0
  1876.     }
  1877.     if {[progfile exempt icr $nickverife]!="0"} {
  1878.          puthelp "notice $nick :Attention le Nick: \2[lindex $text 1]\2 est dans la liste des protégés."
  1879.     return 0
  1880.     }
  1881.     if {[onchan [join [lindex $text 1]] [lindex $text 0]]} {
  1882.          putquick "kick [lindex $text 0] [lindex $text 1] :[subst -nocommands -nobackslashes $::GB::msg(kick)]"
  1883.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Kick\0036\] \0031par : \0034$hand"
  1884.      return
  1885.     }
  1886. }
  1887.  
  1888.     # Unban #
  1889.  
  1890.     proc xunban { nick uhost hand arg } {
  1891.          set chan [lindex $arg 0]
  1892.     if {[channel get $chan GB]==0} { return; }
  1893.     if { [nick2hand $nick] eq "*" } {
  1894.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1895.     return 0
  1896.     }
  1897.     if {![isauth $hand]} {
  1898.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1899.     return 0
  1900.     }
  1901.     if {![matchattr $hand o|o $chan]} {
  1902.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1903.     return 0
  1904.     }
  1905.     if {![string match #* [lindex $arg 0]]} {
  1906.          puthelp "notice $nick :Syntaxe : ( /msg $::botnick unban <#salon> <host> ) !"
  1907.     return 0
  1908.     }
  1909.     if {[string match *!*@* [lindex $arg 1]]} {
  1910.          putquick "mode $chan -b [lindex $arg 1]"
  1911.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Unban\0036\] \0031par : \0034$hand"
  1912.     return 0
  1913.     }
  1914.     if {[llength [getchanhost [lindex $arg 0]]]!=0} {
  1915.          set host [lindex [split [getchanhost [lindex $arg 0]] @] 1]
  1916.          putquick "mode $chan -b *!*@$host"
  1917.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Unban\0036\] \0031par : \0034$hand"
  1918.     return 0
  1919.     }
  1920. }
  1921.  
  1922.     # Kickban #
  1923.  
  1924.     proc xkickban { nick uhost hand arg } {
  1925.          set KBnick "[lindex $text 0]"
  1926.          set chan [lindex $arg 0]
  1927.          set verifexempt "[split [lindex $arg 1] |]"
  1928.          set nickverife "[lindex $verifexempt 0]"
  1929.     if {[channel get $chan GB]==0} { return; }
  1930.     if { [nick2hand $nick] eq "*" } {
  1931.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1932.     return 0
  1933.     }
  1934.     if {![isauth $hand]} {
  1935.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1936.     return 0
  1937.     }
  1938.     if {![matchattr $hand o|o $chan]} {
  1939.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1940.     return 0
  1941.     }
  1942.     if {![string match #* [lindex $arg 0]]} {
  1943.          puthelp "notice $nick :Syntaxe : ( /msg $::botnick kickban <#salon> <pseudo> ) !"
  1944.     return 0
  1945.     }
  1946.     if {[progfile exempt icr $nickverife]!="0"} {
  1947.          puthelp "notice $nick :Attention le Nick: \2[lindex $arg 1]\2 est dans la liste des protégés."
  1948.     return 0
  1949.     }
  1950.     if {[llength [getchanhost [lindex $arg 1]]]!=0} {
  1951.          set host [lindex [split [getchanhost [lindex $arg 1]] @] 1]
  1952.          ::GB::ban_user $KBnick *!*@$host $chan
  1953.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Kick-Ban\0036\] \0031par : \0034$hand"
  1954.     return
  1955.     }
  1956. }
  1957.  
  1958.     # Clearban/Mode Chan #
  1959.  
  1960.     # Clearban #
  1961.  
  1962.     proc clearbans { nick host hand chan text } {
  1963.     if {[channel get $chan GB]==0} { return; }
  1964.     if { [nick2hand $nick] eq "*" } {
  1965.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1966.     return 0
  1967.     }
  1968.     if {![isauth $hand]} {
  1969.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1970.     return 0
  1971.     }
  1972.     if {![matchattr $hand o|m $chan]} {
  1973.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1974.     return 0
  1975.     }
  1976.     foreach bsyntaxe [chanbans $chan] {
  1977.          putquick "mode $chan -b [lindex $bsyntaxe 0]"
  1978.     }
  1979.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Clear-Bans\0036\] \0031par : \0034$hand"
  1980. }
  1981.  
  1982.     # Mode #
  1983.  
  1984. proc mode { nick uhost hand chan text } {
  1985.     if {[channel get $chan GB]==0} { return; }
  1986.     if { [nick2hand $nick] eq "*" } {
  1987.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  1988.     return 0
  1989.     }
  1990.     if {![isauth $hand]} {
  1991.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  1992.     return 0
  1993.     }
  1994.     if {$text!=""} {
  1995.     if {![matchattr $hand o|m $chan]} {
  1996.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  1997.     return 0
  1998.     }
  1999.          putquick "mode $chan $text"
  2000.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Mode\0036\] \0031par : \0034$hand"
  2001.     }
  2002. }
  2003.  
  2004.     # Clearbans/Mode Msg #
  2005.  
  2006.     # Clearbans #
  2007.  
  2008.     proc xclearbans { nick host hand text } {
  2009.          set chan [lindex $text 0]
  2010.     if {[channel get $chan GB]==0} { return; }
  2011.     if { [nick2hand $nick] eq "*" } {
  2012.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2013.     return 0
  2014.     }
  2015.     if {![isauth $hand]} {
  2016.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2017.     return 0
  2018.     }
  2019.     if {![string match #* [lindex $text 0]]} {
  2020.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick clearbans <#salon> ) !"
  2021.     return 0
  2022.     }
  2023.     if {![validchan [lindex $text 0]]} {
  2024.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  2025.     return 0
  2026.     }
  2027.     if {![matchattr $hand o|m [lindex $text 0]]} {
  2028.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2029.     return 0
  2030.     }
  2031.     if {![botonchan [lindex $text 0]]} {
  2032.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  2033.     return 0
  2034.     }
  2035.     if {![botisop [lindex $text 0]]} {
  2036.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  2037.     return 0
  2038.     }
  2039.     foreach bsyntaxe [chanbans $chan] {
  2040.          putquick "mode $chan -b [lindex $bsyntaxe 0]"
  2041.     }
  2042.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Clear-Bans\0036\] \0031par : \0034$hand"
  2043. }
  2044.  
  2045.     # Mode #
  2046.  
  2047.     proc xmode { nick host hand text } {
  2048.          set chan [lindex $text 0]
  2049.     if {[channel get $chan GB]==0} { return; }
  2050.     if { [nick2hand $nick] eq "*" } {
  2051.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2052.     return 0
  2053.     }
  2054.     if {![isauth $hand]} {
  2055.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2056.     return 0
  2057.     }
  2058.     if {![string match #* [lindex $text 0]]} {
  2059.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick mode <#salon> <mode(s)> ) !"
  2060.     return 0
  2061.     }
  2062.     if {![validchan [lindex $text 0]]} {
  2063.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  2064.     return 0
  2065.     }
  2066.     if {$text!=""} {
  2067.     if {![matchattr $hand o|m [lindex $text 0]]} {
  2068.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2069.     return 0
  2070.     }
  2071.     if {![botonchan [lindex $text 0]]} {
  2072.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  2073.     return 0
  2074.     }
  2075.     if {![botisop [lindex $text 0]]} {
  2076.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(botdeop)]"
  2077.     return 0
  2078.     }
  2079.          putquick "mode $chan [lindex $text 1]"
  2080.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Mode\0036\] \0031par : \0034$hand"
  2081.     }
  2082. }
  2083.  
  2084.     # Topic Chan/Msg #
  2085.  
  2086.     # Topic Chan #
  2087.  
  2088.     proc topic { nick host hand chan arg} {
  2089.     if {[channel get $chan GB]==0} { return; }
  2090.     if { [nick2hand $nick] eq "*" } {
  2091.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2092.     return 0
  2093.     }
  2094.  
  2095.     if {![isauth $hand]} {
  2096.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2097.     return 0
  2098.     }
  2099.  
  2100.     if {![matchattr $hand o|o $chan]} {
  2101.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2102.     return 0
  2103.     }
  2104.          putquick "TOPIC $chan :$arg"
  2105.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Topic\0036\] \0031par : \0034$hand"
  2106. }
  2107.  
  2108.     # Topic Msg #
  2109.    
  2110.     proc xtopic { nick host hand text } {
  2111.          set chan [string tolower [lindex $text 0]]
  2112.     if {[channel get $chan GB]==0} { return; }
  2113.     if { [nick2hand $nick] eq "*" } {
  2114.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2115.     return 0
  2116.     }
  2117.     if {![isauth $hand]} {
  2118.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2119.     return 0
  2120.     }
  2121.     if {![string match #* [lindex $text 0]]} {
  2122.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick topic <#chan> <text> ) !"
  2123.     return 0
  2124.     }
  2125.     if {![validchan [lindex $text 0]]} {
  2126.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  2127.     return 0
  2128.     }
  2129.     if { [string length $text] ne "" } {
  2130.     if {![matchattr $hand o|o [lindex $text 0]]} {
  2131.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2132.     return 0
  2133.          }
  2134.          putquick "TOPIC $chan :[lindex $text 1 end]"
  2135.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Topic\0036\] \0031par : \0034$hand"
  2136.     }
  2137. }
  2138.    
  2139.     # Infoline #
  2140.  
  2141.     proc infoline { nick host hand arg } {
  2142.          set chan [string tolower [lindex $arg 0]]
  2143.     if {[channel get $chan GB]==0} { return; }
  2144.     if { [nick2hand $nick] eq "*" } {
  2145.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2146.     return 0
  2147.     }
  2148.     if {![isauth $hand]} {
  2149.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2150.     return 0
  2151.     }
  2152.     if {![string match #* [lindex $arg 0]]} {
  2153.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick infoline <#salon> <text> ) !"
  2154.     return 0
  2155.     }
  2156.     if {![validchan [lindex $arg 0]]} {
  2157.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  2158.     return 0
  2159.     }
  2160.     if { [string length $arg] ne "" } {
  2161.     if {![matchattr $hand o|o [lindex $arg 0]]} {
  2162.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2163.     return 0
  2164.     }
  2165.          setchaninfo $hand $chan [join [lrange $arg 1 end]]
  2166.          puthelp "notice $nick :Infoline définie :[join [lrange $arg 1 end]]"
  2167.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Info-Line\0036\] \0031par : \0034$hand"
  2168.     }
  2169. }
  2170.  
  2171.     # Message au join Infoline de CrazyCat #
  2172.  
  2173.     proc greet { nick uhost handle chan } {
  2174.     if { ![validuser $handle] } { return; }
  2175.     if { [getchaninfo $handle $chan] ne "" } {
  2176.          putserv "PRIVMSG $chan :\[$nick\] [getchaninfo $handle $chan]"
  2177.    }
  2178.    return
  2179. }
  2180.    
  2181.     # Notice-Chan #
  2182.  
  2183.     proc nonotice_chanoff { nick uhost hand text dest } {
  2184.     if ("$nick"=="")||("$dest"=="$::botnick") {return 0}
  2185.     if [validuser [finduser $nick!*@*]]&&[matchattr $hand o|o $dest] {return 0}
  2186.     if [isop $nick $dest]||[isvoice $nick $dest] {return 0}
  2187.     if ![botisop $dest] {return 0}
  2188.     if [string match -nocase niubot?? $nick] {return 0}
  2189.          set host [lindex [split $uhost @] 1]
  2190.          putquick "mode $dest +b *!*@$host"
  2191.          putquick "kick $dest $nick :[subst -nocommands -nobackslashes $::GB::msg(nc)]"
  2192. }
  2193.    
  2194.     # Amsg #
  2195.  
  2196.     proc amsg { nick host hand chan arg } {
  2197.     if {[channel get $chan GB]==0} { return; }
  2198.     if { [nick2hand $nick] eq "*" } {
  2199.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2200.     return 0
  2201.     }
  2202.     if {![isauth $hand]} {
  2203.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2204.     return 0
  2205.     }
  2206.     if {![matchattr $hand o|n $chan]} {
  2207.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2208.     return 0
  2209.     }
  2210.     if [string equal -nocase $chan "$::GB::log"] {
  2211.     foreach c [channels] {
  2212.          putserv "privmsg $c :\0031\[\00314 Information \0031\] \0034$hand \0032: $arg"
  2213.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)Amsg\0036\] \0031par : \0034$hand"
  2214.         }
  2215.     }
  2216. }
  2217.  
  2218.     # Activation/Désactivation du TCL #
  2219.  
  2220.     proc gbon { nick host hand chan arg } {
  2221.     if {[channel get $chan GB] == 0} {
  2222.          channel set $chan +GB
  2223.          putquick "PRIVMSG $chan :TCL Activé !"
  2224.     } else {
  2225.          putquick "PRIVMSG $chan :TCL déjà Activé !"
  2226.     }
  2227.          puthelp "privmsg $::GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)gbon\0036\] \0031par : \0034$hand"
  2228. }
  2229.  
  2230.     proc gboff { nick host hand chan arg } {
  2231.     if {[channel get $chan GB] != 0} {
  2232.          channel set $chan -GB
  2233.          putquick "PRIVMSG $chan :TCL Désactivé !"
  2234.     } else {
  2235.          putquick "PRIVMSG $chan :TCL déjà Désactivé !"
  2236.     }
  2237.          puthelp "privmsg $::GB::log :\00314Commande \0036\[\0033$::GB::commande(choix)gboff\0036\] \0031par : \0034$hand"
  2238. }
  2239.    
  2240.     # Auth-List #
  2241.  
  2242.     proc authlist { nick host hand arg } {
  2243.          set chan [string tolower [lindex $arg 0]]
  2244.     if {[channel get $chan GB]==0} { return; }
  2245.     if { [nick2hand $nick] eq "*" } {
  2246.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2247.     return 0
  2248.     }
  2249.     if {![isauth $hand]} {
  2250.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2251.     return 0
  2252.     }
  2253.     if {![string match #* [lindex $arg 0]]} {
  2254.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick authlist <#salon> ) !"
  2255.     return 0
  2256.     }
  2257.     if {![validchan [lindex $arg 0]]} {
  2258.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  2259.     return 0
  2260.     }
  2261.     if { [string length $arg] ne "" } {
  2262.     if {![matchattr $hand o|o [lindex $arg 0]]} {
  2263.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2264.     return 0
  2265.     }
  2266.     foreach u [userlist] {
  2267.     if [matchattr $u o|o $chan] {
  2268.     if [isauth $u] {
  2269.          putserv "privmsg $nick :\0031\[\00314$u\0031\] \0031: \0036AUTH \0031: \0033YES"
  2270.     } else {
  2271.          putserv "privmsg $nick :\0031\[\00314$u\0031\] \0031: \0036AUTH \0031: \0034NO"
  2272.                 }
  2273.             }
  2274.         }
  2275.     }
  2276.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Auth-List\0036\] \0031par : \0034$hand"
  2277. }
  2278.          
  2279.     # Say/Me Msg #
  2280.  
  2281.     # Say #
  2282.  
  2283.     proc say { nick uhost hand text } {
  2284.          set chan [string tolower [lindex $text 0]]
  2285.     if {[channel get $chan GB]==0} { return; }
  2286.     if { [nick2hand $nick] eq "*" } {
  2287.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2288.     return 0
  2289.     }
  2290.     if {![isauth $hand]} {
  2291.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2292.     return 0
  2293.     }
  2294.     if {![string match #* [lindex $text 0]]} {
  2295.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick say <#salon> <text> ) !"
  2296.     return 0
  2297.     }
  2298.     if {![validchan [lindex $text 0]]} {
  2299.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  2300.     return 0
  2301.     }
  2302.     if {![matchattr $hand o|o $chan]} {
  2303.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2304.     return 0
  2305.     }
  2306.     if {![botonchan [lindex $text 0]]} {
  2307.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  2308.     return 0
  2309.     }
  2310.          set chann "[lindex [channels] [lsearch [string tolower [channels]] [string tolower [lindex $text 0]]]]"
  2311.          putserv "privmsg [lindex $text 0] :[join [lrange $text 1 end]]"
  2312.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Say\0036\] \0031par : \0034$hand"
  2313.     return
  2314. }
  2315.    
  2316.     # Me #
  2317.  
  2318.     proc me { nick uhost hand text } {
  2319.          set chan [string tolower [lindex $text 0]]
  2320.     if {[channel get $chan GB]==0} { return; }
  2321.     if { [nick2hand $nick] eq "*" } {
  2322.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2323.     return 0
  2324.     }
  2325.     if {![isauth $hand]} {
  2326.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(auth)]"
  2327.     return 0
  2328.     }
  2329.     if {![string match #* [lindex $text 0]]} {
  2330.          puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick me <#salon> <text> ) !"
  2331.     return 0
  2332.     }
  2333.     if {![validchan [lindex $text 0]]} {
  2334.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(salon)]"
  2335.     return 0
  2336.     }
  2337.     if {![matchattr $hand o|o $chan]} {
  2338.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2339.     return 0
  2340.     }
  2341.     if {![botonchan [lindex $text 0]]} {
  2342.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(nosalon)]"
  2343.     return 0
  2344.     }
  2345.          set chann "[lindex [channels] [lsearch [string tolower [channels]] [string tolower [lindex $text 0]]]]"
  2346.          putserv "privmsg [lindex $text 0] :\001ACTION [join [lrange $text 1 end]] \001"
  2347.          putserv "privmsg $GB::log :\00314Commande \0036\[\0033Me\0036\] \0031par : \0034$hand"
  2348.      return
  2349. }
  2350.    
  2351.     # Configuration d'aide en pv #
  2352.  
  2353.     proc conf { nick host hand arg } {
  2354.          set chan [string tolower [lindex $arg 0]]
  2355.     if { [nick2hand $nick] eq "*" } {
  2356.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(access)]"
  2357.     return 0
  2358.     }
  2359.     if {![matchattr $hand o|o $chan]} {
  2360.          puthelp "notice $nick :[subst -nocommands -nobackslashes $::GB::msg(level)]"
  2361.     return 0
  2362.     }
  2363.          putserv "privmsg $nick :Bonjour $nick Pour commencer veuillez taper la commande :"
  2364.          putserv "privmsg $nick :/msg $::botnick pass <unpass>"
  2365.          putserv "privmsg $nick :Ensuite pour vous authentifier veuillez taper :"
  2366.          putserv "privmsg $nick :/msg $::botnick auth $nick <votre-pass>"
  2367.          putserv "privmsg $nick :Une fois ceci fait, pour voir un aperçu de mes commandes disponibles auxquelles vous avez accès tapez :"
  2368.          putserv "privmsg $nick :/msg $::botnick help"
  2369.          putserv "privmsg $nick :Fin de l'aide."
  2370. }
  2371.        
  2372.     # Help #
  2373.  
  2374.     proc help { nick host hand arg } {
  2375.          set commande [lindex $arg 1]
  2376.          set commande [stripcodes abcu [lindex $arg 0]]
  2377.     if {$commande == ""} {
  2378.          puthelp "privmsg $nick :\00314Commande Help du Robot \002\0034$::botnick\002\0034"
  2379.     foreach c [channels] {
  2380.     if [matchattr $hand |o $c] {
  2381.          puthelp "privmsg $nick :\0031\037Level \002Opérateur\002 :\0037"
  2382.          puthelp "privmsg $nick :\00314Auth \0031: \0034Permet de vous identifier auprès du Robot Identifia en MSG !"
  2383.          puthelp "privmsg $nick :\00314Op \0031: \0034Permet de te mettre Opérateur \0031(\00312@\0031) \0034 sur le salon ou en Msg, et pour le faire sur quelqu'un aussi !"
  2384.          puthelp "privmsg $nick :\00314Deop \0031: \0034Permet de te mettre Deop \0031(\00312-@\0031) \0034 sur le salon ou en Msg, et pour le faire sur quelqu'un aussi !"
  2385.          puthelp "privmsg $nick :\00314Voice \0031: \0034Permet de te mettre voice \0031(\0033+v\0031) \0034 sur le salon ou en Msg, et pour le faire sur quelqu'un aussi !"
  2386.          puthelp "privmsg $nick :\00314Devoice \0031: \0034Permet de te mettre Devoice \0031(\0033-v\0031) \0034 sur le salon ou en Msg, et pour le faire sur quelqu'un aussi !"
  2387.          puthelp "privmsg $nick :\00314Kick \0031: \0034Permet de Kick quelqu'un sur un salon défini commande Chan ou Msg !"
  2388.          puthelp "privmsg $nick :\00314Kickban \0031: \0034Permet de Kickban quelqu'un sur un salon défini commande Chan ou Msg !"
  2389.          puthelp "privmsg $nick :\00314Ban \0031: \0034Permet de Ban quelqu'un sur un salon défini commande Chan ou Msg !"
  2390.          puthelp "privmsg $nick :\00314Unban \0031: \0034Permet de Unban quelqu'un sur un salon défini commande Chan ou Msg !"
  2391.          puthelp "privmsg $nick :\00314Access \0031: \0034Permet de regarder la liste d'acces command Msg !"
  2392.          puthelp "privmsg $nick :\00314Deauth \0031: \0034Permet de vous déauthentifier auprès du Robot $::botnick commande Msg !"
  2393.          puthelp "privmsg $nick :\00314Newpass \0031: \0034Permet de changer votre mot de passe auprès du Robot $::botnick commande Msg !"
  2394.          puthelp "privmsg $nick :\00314Infoline \0031: \0034Permet de vous mettre un texte à l'entrée d'un salon commande Msg !"
  2395.          puthelp "privmsg $nick :\00314Topic \0031: \0034Permet de mettre un topic sur un salon défini commande Chan ou Msg !"
  2396.          puthelp "privmsg $nick :\00314Authlist \0031: \0034Permet de regarder qui est authentifié auprès du Robot $::botnick commande Msg !"
  2397.          puthelp "privmsg $nick :\00314Say \0031: \0034Permet d'envoyer un message sous forme de /say sur un salon défini commande Msg !"
  2398.          puthelp "privmsg $nick :\00314Me \0031: \0034Permet d'envoyer un message sous forme de /me sur un salon défini commande en Msg !"        
  2399.      break
  2400.     }
  2401. }
  2402.     foreach c [channels] {
  2403.     if [matchattr $hand |m $c] {
  2404.          puthelp "privmsg $nick :\0031\037Level \002Master\002 :\037"
  2405.          puthelp "privmsg $nick :\00314Addop \0031: \0034Permet de mettre un user Opérateur sur un salon défini commande Chan ou Msg !"
  2406.          puthelp "privmsg $nick :\00314Delop \0031: \0034Permet de retirer le level Opérateur sur un salon défini commande Chan ou Msg !"
  2407.          puthelp "privmsg $nick :\00314Clearbans \0031: \0034Permet de Clearbans tout les bans sur le salon commande Chan ou Msg !"
  2408.          puthelp "privmsg $nick :\00314Mode \0031: \0034Permet de mettre ou retirer un Mode commande Chan ou Msg !"
  2409.          puthelp "privmsg $nick :\00314Opall \0031: \0034Permet de mettre tout le monde Op commande Chan ou Msg !"
  2410.          puthelp "privmsg $nick :\00314Deopall \0031: \0034Permet de mettre tout le monde Deop commande Chan ou Msg !"
  2411.          puthelp "privmsg $nick :\00314Voiceall \0031: \0034Permet de mettre tout le monde Voice commande Chan ou Msg !"
  2412.          puthelp "privmsg $nick :\00314Devoiceall \0031: \0034Permet de mettre tout le monde Devoice commande Chan ou Msg !"         
  2413.          break
  2414.     }
  2415. }
  2416.     foreach c [channels] {
  2417.     if [matchattr $hand |n $c] {
  2418.          puthelp "privmsg $nick :\0031\037Level \002Owner\002 :\037"
  2419.          puthelp "privmsg $nick :\00314Addmaster \0031: \0034Permet de mettre un user ou un Opérateur d'un salon le level Master commande Msg !"
  2420.          puthelp "privmsg $nick :\00314Delmaster \0031: \0034Permet de retirer le level Master sur un salon défini commande Msg !"
  2421.          puthelp "privmsg $nick :\00314Amsg \0031: \0034Permet de faire un Amsg sur tout les salons où se situe $::botnick commande Chan seulement sur $::GB::log Il faut taper la commande sinon cela ne fonctionne pas !"      
  2422.      break
  2423.     }
  2424. }
  2425.     foreach c [channels] {
  2426.     if [matchattr $hand o| $c] {
  2427.          puthelp "privmsg $nick :\0031\037Level \002SuperOp\002 :\037"
  2428.          puthelp "privmsg $nick :\00314Delowner \0031: \0034Permet de retirer le level Owner sur un salon défini commande Msg !"
  2429.          puthelp "privmsg $nick :\00314Exempt \0031: \0034Permet de mettre/retirer/regarder les pseudos protégés commande Chan !"
  2430.          puthelp "privmsg $nick :\00314Blacklist \0031: \0034Permet de mettre/retirer/regarder la Blacklist commande Chan !"
  2431.          puthelp "privmsg $nick :\00314Addsuspend \0031: \0034Permet de suspendre un accéss commande Msg !"
  2432.          puthelp "privmsg $nick :\00314Delsuspend \0031: \0034Permet de retirer un suspend commande Msg !"
  2433.          puthelp "privmsg $nick :\00314Addchan \0031: \0034Permet de rajouter un autojoin sur un salon au bot commande Msg !"
  2434.          puthelp "privmsg $nick :\00314Delchan \0031: \0034Permet de retirer un salon des autojoin au bot commande Msg !"
  2435.          puthelp "privmsg $nick :\00314Listchan \0031: \0034Permet de regarder la liste des chan en autojoin qu'il y a dans $::botnick commande Msg !"
  2436.          puthelp "privmsg $nick :\00314Addowner \0031: \0034Permet de mettre un user ou Opérateur ou un Master le level Owner commande Msg !"
  2437.          puthelp "privmsg $nick :\00314Addsuperop \0031: \0034Permet de mettre un user ou Opérateur ou Master ou Owner le level SuperOp commande Msg !"
  2438.          puthelp "privmsg $nick :\00314Delsuperop \0031: \0034Permet de retirer le level SuperOp commande Msg !"
  2439.          puthelp "privmsg $nick :\00314Gbon \0031: \0034Permet d'activer le TCL sur un salon défini commande Chan !"
  2440.          puthelp "privmsg $nick :\00314Gboff \0031: \0034Permet de désactiver le TCL sur un salon défini commande Chan !"          
  2441.      break
  2442.     }
  2443. }
  2444.          puthelp "privmsg $nick :\00314Exemple de commande à taper pour avoir de l'aide plus détaillée\00314"
  2445.          puthelp "privmsg $nick :\0034/msg $::botnick help op\0034"
  2446.          puthelp "privmsg $nick :\0031\[\0034Info\0031\] \00314Toutes les commandes sont a taper en \002\0031(Minuscules)\002"
  2447.          puthelp "privmsg $nick :\0031\037\002Fin du Help !\002"
  2448.          puthelp "privmsg $GB::log :\00314Commande \0036\[\0033Help\0036\] \0031par : \0034$hand"
  2449.     }
  2450.     switch -- $commande {
  2451. "op" {
  2452.          puthelp "privmsg $nick :\00314Commande Op Chan \0031: \0034$::GB::commande(choix)op \0031ou \0034$::GB::commande(choix)op <pseudo>"
  2453.          puthelp "privmsg $nick :\00314Commande Op Msg \0031: \0034/msg $::botnick op <#salon> \0031ou \0034/msg $::botnick op <#salon> <pseudo>"
  2454.     }
  2455. "deop" {
  2456.          puthelp "privmsg $nick :\00314Commande Deop Chan \0031: \0034$::GB::commande(choix)deop \0031ou \0034$::GB::commande(choix)deop <pseudo>"
  2457.          puthelp "privmsg $nick :\0031Commande Deop Chan \0031: \0034/msg $::botnick deop <#salon> \0031ou \0034/msg $::botnick deop <#salon> <pseudo>"
  2458.     }
  2459. "voice" {
  2460.          puthelp "privmsg $nick :\00314Commande Voice Chan \0031: \0034$::GB::commande(choix)voice \0031ou \0034$::GB::commande(choix)voice <pseudo>"
  2461.          puthelp "privmsg $nick :\00314Commande Voice Msg \0031: \0034/msg $::botnick <voice> <#salon> \0031ou \0034/msg $::botnick <voice> <#salon> <pseudo>"
  2462.     }
  2463. "devoice" {
  2464.          puthelp "privmsg $nick :\00314Commande Devoice Chan \0031: \0034$::GB::commande(choix)devoice \0031ou \0034$::GB::commande(choix)devoice <pseudo>"
  2465.          puthelp "privmsg $nick :\00314Commande Devoice Msg \0031: \0034/msg $::botnick <devoice> <#salon> \0031ou \0034/msg $::botnick devoice <#salon> <pseudo>"
  2466.     }
  2467. "kick" {
  2468.          puthelp "privmsg $nick :\00314Commande Kick Chan \0031: \0034$::GB::commande(choix)kick <pseudo> \0031ou \0034$::GB::commande(choix)kick <pseudo> <raison>"
  2469.          puthelp "privmsg $nick :\00314Commande Kick Msg \0031: \0034/msg $::botnick kick <#salon> <pseudo> \0031ou \0034/msg $::botnick kick <#salon> <pseudo> <raison>"
  2470.     }
  2471. "kickban" {
  2472.          puthelp "privmsg $nick :\00314Commande Kickban Chan \0031: \0034$::GB::commande(choix)kickban <pseudo> \0031ou \0034$::GB::commande(choix)kickban <pseudo> <raison>"
  2473.          puthelp "privmsg $nick :\00314Commande Kickban Msg \0031: \0034/msg $::botnick kickban <#salon> <pseudo> \0031ou \0034/msg $::botnick kickban <#salon> <pseudo> <raison>"
  2474.     }
  2475. "ban" {
  2476.          puthelp "privmsg $nick :\00314Commande Ban Chan \0031: \0034$::GB::commande(choix)ban <pseudo> \0031ou \0034$::GB::commande(choix)ban <host>"
  2477.          puthelp "privmsg $nick :\00314Commande Ban Msg \0031: \0034/msg $::botnick ban <#salon> <host>"
  2478.     }
  2479. "unban" {
  2480.          puthelp "privmsg $nick :\00314Commande Unban Chan \0031: \0034$::GB::commande(choix)unban <pseudo> \ou \0034$::GB::commande(choix)unban <host>"
  2481.          puthelp "privmsg $nick :\00314Commande Unban Msg \0031: \0034/msg $::botnick unban <#salon> <host>"
  2482.     }
  2483. "access" {
  2484.          puthelp "privmsg $nick :\00314Commande Access Msg \0031: \0034/msg $::botnick access <#salon> * \0031ou \0034/msg $::botnick access <#salon> al* \0037Ceci et un exemple le al* cherchera tout les access ayant dans le pseudo (al)"
  2485.     }
  2486. "addop" {
  2487.          puthelp "privmsg $nick :\00314Commande Addop Msg \0031: \0034/msg $::botnick addop <pseudo> <#salon>"
  2488.     }
  2489. "addmaster" {
  2490.          puthelp "privmsg $nick :\00314Commande Addmaster Msg \0031: \0034/msg $::botnick addmaster <pseudo> <#salon>"
  2491.     }
  2492. "addowner" {
  2493.          puthelp "privmsg $nick :\00314Commande Addowner Msg \0031: \0034/msg $::botnick addowner <pseudo> <#salon>"
  2494.     }
  2495. "delop" {
  2496.          puthelp "privmsg $nick :\00314Commande Delop Msg \0031: \0034 /msg $::botnick delop <pseudo> <#salon>"
  2497.     }
  2498. "delmaster" {
  2499.          puthelp "privmsg $nick :\00314Commande Delmaster Msg \0031: \0034/msg $::botnick delmaster <pseudo> <#salon>"
  2500.     }
  2501. "delowner" {
  2502.          puthelp "privmsg $nick :\00314Commande Delowner Msg \0031: \0034/msg $::botnick delowner <pseudo> <#salon>"
  2503.     }
  2504. "clearbans" {
  2505.          puthelp "privmsg $nick :\00314Commande Clearbans Chan \0031: \0034$::GB::commande(choix)clearbans"
  2506.          puthelp "privmsg $nick :\00314Commande Clearbans Msg \0031: \0034/msg $::botnick clearbans <#salon>"
  2507.     }
  2508. "mode" {
  2509.          puthelp "privmsg $nick :\00314Commande Mode Chan \0031: \0034$::GB::commande(choix)mode <le-mode>"
  2510.          puthelp "privmsg $nick :\00314Commande Mode Msg \0031: \0034/msg $::botnick mode <#salon> <mode>"
  2511.     }
  2512. "blacklist" {
  2513.          puthelp "privmsg $nick :\00314Commande Blacklist Chan \0031: \0034$::GB::commande(choix)blacklist"
  2514.          puthelp "privmsg $nick :\00314Commande Blacklist Chan \0031: \0034$::GB::commande(choix)+blacklist <pseudo>"
  2515.          puthelp "privmsg $nick :\00314Commande Blacklist Chan \0031: \0034$::GB::commande(choix)-blacklist <pseudo>"
  2516.     }
  2517. "exempt" {
  2518.          puthelp "privmsg $nick :\00314Commande Exempt Chan \0031: \0034$::GB::commande(choix)exempt"
  2519.          puthelp "privmsg $nick :\00314Commande Exempt Chan \0031: \0034$::GB::commande(choix)+exempt <pseudo>"
  2520.          puthelp "privmsg $nick :\00314Commande Exempt Chan \0031: \0034$::GB::commande(choix)-exempt <pseudo>"
  2521.     }
  2522. "newpass" {
  2523.          puthelp "privmsg $nick :\00314Commande Newpass Msg \0031: \0034/msg $::botnick newpass <ancien-pass> <nouveau-pass>"
  2524.     }
  2525. "opall" {
  2526.          puthelp "privmsg $nick :\00314Commande Opall Chan \0031: \0034$::GB::commande(choix)opall"
  2527.          puthelp "privmsg $nick :\00314Commande Opall Msg \0031: \0034/msg $::botnick opall <#salon>"
  2528.     }
  2529. "deopall" {
  2530.          puthelp "privmsg $nick :\00314Commande Deopall Chan \0031: \0034$::GB::commande(choix)deopall"
  2531.          puthelp "privmsg $nick :\00314Commande Deopall Msg \0031: \0034/msg $::botnick deopall <#salon>"
  2532.     }
  2533. "voiceall" {
  2534.          puthelp "privmsg $nick :\00314Commande Voiceall Chan \0031: \0034$::GB::commande(choix)voiceall"
  2535.          puthelp "privmsg $nick :\00314Commande Voiceall Msg \0031: \0034/msg $::botnick voiceall <#salon>"
  2536.     }
  2537. "devoiceall" {
  2538.          puthelp "privmsg $nick :\00314Commande Devoiceall Chan \0031: \0034$::GB::commande(choix)devoiceall"
  2539.          puthelp "privmsg $nick :\00314Commande Devoiceall Msg \0031: \0034/msg $::botnick devoiceall <#salon>"
  2540.     }
  2541. "addsuspend" {
  2542.          puthelp "privmsg $nick :\00314Commande Addsuspend Msg \0031: \0034/msg $::botnick addsuspend <pseudo>"
  2543.     }
  2544. "delsuspend" {
  2545.          puthelp "privmsg $nick :\00314Commande Delsuspend Msg \0031: \0034/msg $::botnick delsuspend <pseudo>"
  2546.     }
  2547. "addchan" {
  2548.          puthelp "privmsg $nick :\00314Commande Addchan Msg \0031: \0034/msg $::botnick addchan <#salon>"
  2549.     }
  2550. "delchan" {
  2551.          puthelp "privmsg $nick :\00314Commande Delchan Msg \0031: \0034/msg $::botnick delchan <#salon>"
  2552.     }
  2553. "listchan" {
  2554.          puthelp "privmsg $nick :\00314Commande Listchan Msg \0031: \0034/msg $::botnick listchan"
  2555.     }
  2556. "addsuperop" {
  2557.          puthelp "privmsg $nick :\00314Commande Addsuperop Msg \0031: \0034/msg $::botnick addsuperop <pseudo>"
  2558.     }
  2559. "delsuperop" {
  2560.          puthelp "privmsg $nick :\00314Commande Delsuperop Msg \0031: \0034/msg $::botnick delsuperop <pseudo>"
  2561.     }
  2562. "infoline" {
  2563.          puthelp "privmsg $nick :\00314Commande Infoline Msg \0031: \0034/msg $::botnick infoline <#salon> <text>"
  2564.     }
  2565. "amsg" {
  2566.          puthelp "privmsg $nick :\00314Commande Amsg Chan \0031: \0034$::GB::commande(choix)amsg <phrase>"
  2567.     }
  2568. "topic" {
  2569.          puthelp "privmsg $nick :\00314Commande Topic Chan \0031: \0034$::GB::commande(choix)topic <phrase>"
  2570.          puthelp "privmsg $nick :\00314Commande Topic Msg \0031: \0034/msg $::botnick topic <#salon> <text>"
  2571.     }
  2572. "authlist" {
  2573.          puthelp "privmsg $nick :\00314Commande Authlist Msg \0031: \0034/msg $::botnick authlist <#salon>"
  2574.     }
  2575. "gbon" {
  2576.          puthelp "privmsg $nick :\00314Commande Gbon Chan \0031: \0034$::GB::commande(choix)gbon"
  2577.     }
  2578. "gboff" {
  2579.          puthelp "privmsg $nick :\00314Commande Gboff Chan \0031: \0034$::GB::commande(choix)gboff"
  2580.     }
  2581. "say" {
  2582.          puthelp "privmsg $nick :\00314Commande Say Msg \0031: \0034/msg $::botnick say <#salon> <text>"
  2583.          
  2584.     }
  2585. "me" {
  2586.          puthelp "privmsg $nick :\00314Commande Me Msg \0031: \0034/msg $::botnick me <#salon> <text>"
  2587.         }
  2588.     }
  2589.     return
  2590. }
  2591.  
  2592. # Binds #
  2593.  
  2594. bind pub o "$::GB::commande(choix)+blacklist" [namespace current]::+blacklist
  2595. bind pub o "$::GB::commande(choix)-blacklist" [namespace current]::-blacklist
  2596. bind pub o "$::GB::commande(choix)blacklist" [namespace current]::.blacklist
  2597. bind pub o "$::GB::commande(choix)+exempt" [namespace current]::+exempt
  2598. bind pub o "$::GB::commande(choix)-exempt" [namespace current]::-exempt
  2599. bind pub o "$::GB::commande(choix)exempt" [namespace current]::.exempt
  2600. bind pub - "$::GB::commande(choix)op" [namespace current]::op
  2601. bind pub - "$::GB::commande(choix)deop" [namespace current]::deop
  2602. bind pub - "$::GB::commande(choix)voice" [namespace current]::voice
  2603. bind pub - "$::GB::commande(choix)devoice" [namespace current]::devoice
  2604. bind pub - "$::GB::commande(choix)opall" [namespace current]::opall
  2605. bind pub - "$::GB::commande(choix)deopall" [namespace current]::deopall
  2606. bind pub - "$::GB::commande(choix)voiceall" [namespace current]::voiceall
  2607. bind pub - "$::GB::commande(choix)devoiceall" [namespace current]::devoiceall
  2608. bind pub - "$::GB::commande(choix)ban" [namespace current]::ban
  2609. bind pub - "$::GB::commande(choix)kick" [namespace current]::kick
  2610. bind pub - "$::GB::commande(choix)unban" [namespace current]::unban
  2611. bind pub - "$::GB::commande(choix)kickban" [namespace current]::kickban
  2612. bind pub - "$::GB::commande(choix)clearbans" [namespace current]::clearbans
  2613. bind pub - "$::GB::commande(choix)mode" [namespace current]::mode
  2614. bind pub - "$::GB::commande(choix)topic" [namespace current]::topic
  2615. bind pub - "$::GB::commande(choix)amsg" [namespace current]::amsg
  2616. bind pub o "$::GB::commande(choix)gbon" [namespace current]::gbon
  2617. bind pub o "$::GB::commande(choix)gboff" [namespace current]::gboff
  2618. bind msg - "auth" [namespace current]::auth
  2619. bind msg - "deauth" [namespace current]::deauth
  2620. bind msg - "addsuspend" [namespace current]::addsuspend
  2621. bind msg - "delsuspend" [namespace current]::delsuspend
  2622. bind msg - "addchan" [namespace current]::addchan
  2623. bind msg - "delchan" [namespace current]::delchan
  2624. bind msg - "listchan" [namespace current]::listchan
  2625. bind msg - "access" [namespace current]::access
  2626. bind msg - "newpass" [namespace current]::newpass
  2627. bind msg - "addop" [namespace current]::addop
  2628. bind msg - "addmaster" [namespace current]::addmaster
  2629. bind msg - "addowner" [namespace current]::addowner
  2630. bind msg - "addsuperop" [namespace current]::addsuperop
  2631. bind msg - "delop" [namespace current]::delop
  2632. bind msg - "delmaster" [namespace current]::delmaster
  2633. bind msg - "delowner" [namespace current]::delowner
  2634. bind msg - "delsuperop" [namespace current]::delsuperop
  2635. bind msg - "op" [namespace current]::xop
  2636. bind msg - "deop" [namespace current]::xdeop
  2637. bind msg - "voice" [namespace current]::xvoice
  2638. bind msg - "devoice" [namespace current]::xdevoice
  2639. bind msg - "ban" [namespace current]::xban
  2640. bind msg - "kick" [namespace current]::xkick
  2641. bind msg - "unban" [namespace current]::xunban
  2642. bind msg - "kickban" [namespace current]::xkickban
  2643. bind msg - "clearbans" [namespace current]::xclearbans
  2644. bind msg - "mode" [namespace current]::xmode
  2645. bind msg - "infoline" [namespace current]::infoline
  2646. bind msg - "help" [namespace current]::help
  2647. bind msg - "authlist" [namespace current]::authlist
  2648. bind msg - "topic" [namespace current]::xtopic
  2649. bind msg - "opall" [namespace current]::xopall
  2650. bind msg - "deopall" [namespace current]::xdeopall
  2651. bind msg - "voiceall" [namespace current]::xvoiceall
  2652. bind msg - "devoiceall" [namespace current]::xdevoiceall
  2653. bind msg - "say" [namespace current]::say
  2654. bind msg - "me" [namespace current]::me
  2655. bind msg - "conf" [namespace current]::conf
  2656. bind chon - * [namespace current]::opco
  2657. bind chof - * [namespace current]::opdeco
  2658. bind part o|o "*" [namespace current]::partdeauth
  2659. bind sign o|o "*" [namespace current]::quitdeauth
  2660. bind join - "$::GB::log *" [namespace current]::joindeauth
  2661. bind join - "*" [namespace current]::xbl
  2662. bind notc - * [namespace current]::nonotice_chanoff
  2663. bind join - "*" [namespace current]::greet
  2664. }
  2665.  
  2666. putlog "Gestion.Bot V2.0 Final chargé alias_angelius 2011©"
  2667.  
  2668. # Robot Radio #
  2669.  
  2670. bind join - "*" infoline
  2671. proc infoline { nick uhost hand chan } {
  2672. set info1 "RnG-Radio"
  2673. if {$nick=="$info1"} {
  2674.   putserv "PRIVMSG $chan :\2\[$info1\]\2 \0034Robot-Radio !"
  2675.   pushmode $chan +v $nick
  2676.   return 0
  2677. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement