Advertisement
Guest User

Untitled

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