Guest User

Untitled

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