Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace eval GB {
- # Salon de log #
- set ::log "#Op-Trip"
- # Auteur TCL #
- set ::auteur "alias_angelius"
- # Version TCL #
- set ::GBversion "Gestion.Bot 1.2"
- # Raison kick Blacklist #
- set ::bl "\0034Tu es banni du salon. \00314( \0031Blackliste\00314 )"
- # Raison kick Protect Kick #
- set ::protectk "\00314Anti-Kick\00314 \0034Attention \0031le Pseudo et dans la liste des \0034Protégés.\0034"
- # Raison kick Protect Devoice #
- set ::protectv "\00314Anti-Devoice\00314 \0034Attention \0031le Pseudo et dans la liste des \0034Protégés.\0034"
- # Raison kick Protect Deop #
- set ::protectd "\00314Anti-Deop\00314 \0034Attention \0031le Pseudo et dans la liste des \0034Protégés.\0034"
- # Raison Kick par défault #
- set ::kick "Vous venez d'être kické par"
- # Raison kick Notice-Chan #
- set ::nt "~ Exp/Notice-Chan ~ Pas de notice salon svp"
- # PL #
- bind chon - * [namespace current]::opco
- proc opco {hand idx} {
- global auth
- putquick "privmsg $::log :\0031\[\00312Connection\0031\] \0034$hand \0033vien de se connecter a la \0036Party-Line.\0036"
- dccbroadcast "\00312Connection PL Autorisé pour \0034$hand\0034"
- }
- bind chof - * [namespace current]::opdeco
- proc opdeco {hand idx} {
- global auth
- putquick "privmsg $::log :\0031\[\00312Déconection\0031\] \0034$hand \0033vien de se déconecter de la \0036Part-Line.\0036"
- dccbroadcast "\00312Déconnection PL pour \0034$hand\0034"
- }
- # Auth #
- bind MSG - "auth" [namespace current]::auth
- proc auth { nick host hand text } {
- set args [split $text]
- if {[llength $args] != 2} {
- puthelp "notice $nick :\002Erreur :\002 /msg $::botnick auth <pseudo> <pass>"
- return
- }
- set pseudo [lindex $args 0]
- set password [lindex $args 1]
- if {![validuser $pseudo]} {
- puthelp "notice $nick :\002Erreur :\002 $pseudo n'a aucun access sur le robot."
- return
- }
- if {![passwdok $pseudo $password]} {
- puthelp "notice $nick :\002Erreur :\002 Votre mot de pass ou/et votre pseudo est/sont incorrect(s) !"
- return
- }
- if {![string match -nocase [finduser $nick!$host] $pseudo]} {
- puthelp "notice $nick :\002Erreur :\002 Votre host ne correspond pas avec votre access !"
- return
- }
- if {[getuser $pseudo XTRA AUTH] eq "ON"} {
- puthelp "notice $nick :\002Erreur :\002 Vous êtes déjà authentifier !"
- return
- }
- if {[getuser $hand XTRA SUSPEND] eq "ON"} {
- puthelp "notice $nick :\002Erreur :\002 Vous êtes suspendu !"
- return
- }
- puthelp "notice $nick :\0031\[AUTHENTIFICATION REUSSIE\]\0031 Vous êtes maintenant authentifié !"
- putserv "privmsg $::log :\00314Commande \0036Auth par \0031: \0034$hand"
- putquick "INVITE $nick $::log"
- setuser $pseudo XTRA AUTH ON;
- setuser $hand XTRA SEEN [clock format [clock seconds] -format "le %d/%m/%Y à %Hh%M"]
- save
- return
- }
- # Deauth #
- bind MSG - "deauth" [namespace current]::deauth
- proc deauth { nick host hand arg } {
- if {[getuser $hand XTRA auth] eq "ON"} {
- puthelp "notice $nick :\0031\[DEAUTHENTIFICATION REUSSIE\]\0031 Vous êtes maintenant deauthentifié !"
- putserv "privmsg $::log :\00314Commande \0036Deauth par \0031: \0034$hand"
- setuser $hand XTRA AUTH OFF;
- save
- return
- }}
- # Isauth #
- proc [namespace current]::isauth {hand} {
- if {[getuser $hand XTRA AUTH] eq "OFF"} {return 0}
- if {[getuser $hand XTRA AUTH] eq "ON"} {return 1}
- }
- # Addsuspend #
- bind msg - "addsuspend" [namespace current]::addsuspend
- proc addsuspend {nick host hand arg} {
- global auth
- if {![matchattr $hand o|]} {
- putquick "PRIVMSG $::log :\0033\[ADDSUSPEND\]\0033 \002$hand\002 a essayé d'utiliser cette commande mais il n'a pas les flags nécessaire."
- putserv "NOTICE $nick :\002Accès refusé\002 Vous n'avez pas access à cette commande."
- return 0
- }
- set arg [split $arg]
- set login [lindex $arg 0]
- if {$login==""} {
- puthelp "notice $nick :\002/msg $botnick addsuspend\002<login>"
- puthelp "notice $nick :\002Exemple :\002/msg $botnick addsuspend alias_angelius"
- return 0
- }
- if {![validuser $login]} {
- puthelp "notice $nick :\002ADDSUSPEND\002: Le login \002$login\002 a aucun accès."
- return 0
- }
- if {[getuser $login XTRA suspend]=="ON"} {
- puthelp "notice $nick :\002ADDSUSPEND\002: Le login \002$login\002 est déjà suspendu."
- return 0
- }
- setuser $login XTRA SUSPEND ON
- puthelp "notice $nick :\002ADDSUSPEND\002: \002$login\002 a été suspendu."
- putserv "privmsg $::log :\00314Commande \0036Addsuspend ajouté par \0031: \0034$hand pour $login"
- }
- # Delsuspend #
- bind msg - "delsuspend" [namespace current]::delsuspend
- proc delsuspend {nick host hand arg} {
- global botnick
- if {![matchattr $hand o|]} {
- putquick "PRIVMSG $::log :\0033\[DELSUSPEND\]\0036 \002$hand\002 a essayé d'utiliser cette commande mais il n'a pas les flags nécessaire."
- puthelp "notice $nick :\002Accès refusé\002 Vous n'avez pas access à cette commande."
- return 0
- }
- set arg [split $arg]
- set login [lindex $arg 0]
- if {$login==""} {
- puthelp "notice $nick :\002/msg $botnick delsuspend\002<login>"
- puthelp "notice $nick :\002Exemple :\002/msg $botnick delsuspend alias_angelius"
- return 0
- }
- if {![validuser $login]} {
- puthelp "notice $nick :\002DELSUSPEND\002 : Le login \002$login\002 a aucun accès."
- return 0
- }
- if {[getuser $login XTRA suspend]=="OFF"} {
- puthelp "notice $nick :\002DELSUSPEND\002 : Le login \002$login\002 n'est pas suspendu."
- return 0
- }
- setuser $login XTRA SUSPEND OFF
- puthelp "notice $nick :\002DELSUSPEND\002 : \002$login\002 n'est plus suspendu."
- putserv "privmsg $::log :\00314Commande \0036Delsuspend retiré par \0031: \0034$hand pour $login"
- }
- # Deauth Part #
- bind part o|o "partdeauth *" [namespace current]::partdeauth
- proc partdeauth { nick uhost hand chan {msg ""}} {
- if [matchattr $hand o|o $chan] && [isauth $hand] {
- setuser $hand XTRA AUTH OFF
- puthelp "notice $nick :Déauthentification suite a votre part du salon.."
- putserv "privmsg $::log :\00314Déauthentification \0036suite au part de \0031: \0034$hand"
- }}
- # Deauth Quit #
- bind sign o|o "quitdeauth *" [namespace current]::quitdeauth
- proc quitdeauth { nick uhost hand chan {msg ""}} {
- if [matchattr $hand o|o $chan] && [isauth $hand] {
- setuser $hand XTRA AUTH OFF
- putserv "privmsg $::log :\00314Déauthentification \0036suit au quit de \0031: \0034$hand"
- }}
- # Deauth Join #
- bind join - "$::log*" [namespace current]::joindeauth
- proc joindeauth {nick host hand chan} {
- if {$nick=="$::botnick"} {
- putserv "PRIVMSG $::log :\0034Réinitialisation des accès, tous les authentifiés ont été deauth par sécurité.\0034"
- foreach user [userlist * $chan] {
- setuser $user XTRA AUTH OFF
- }}}
- # Blacklist #
- # Création et Gestion Db #
- if {![file exist database/blacklist.db]} {
- set load [open database/blacklist.db w+]
- close fcreate
- putlog "\2Je créé le blacklist.db\2"
- }
- if {![file exist database/exempt.db]} {
- set load [open database/exempt.db w+]
- close fcreate
- putlog "\2Je créé le exempt.db\2"
- }
- proc progfile {file action arg} {
- set return 0
- set dbr [open database/$file.db r+]
- set dbw [open tmp.tmp w+]
- while {![eof $dbr]} {
- set r [gets $dbr]
- if {$r!=""} {puts $dbw $r}
- }
- close $dbr
- close $dbw
- set dbr [open tmp.tmp r+]
- set dbw [open database/$file.db w+]
- while {![eof $dbr]} {
- set r [gets $dbr]
- if {$action=="add"} {
- if {$r!=""} {
- puts $dbw $r
- } else {
- puts $dbw $arg
- }
- set return 1
- }
- if {$action=="del"} {
- if {$r!=""} {
- if {![string match -nocase $arg [lindex $r 0]] && ![string match -nocase $arg [lindex $r 1]]} {
- puts $dbw $r
- } else {
- set return 1
- }
- }
- }
- if {$action=="chk"} {
- if {$r!=""} {
- puts $dbw $r
- if [string match -nocase [lindex $arg 0] [lindex $r 1]] {
- set return [lindex $r 0]
- if ![string match -nocase [lindex $arg 1] [lindex $r 2]] {set return 2}
- if ![string match [lindex $arg 2] [lindex $r 3]] {set return 3}
- }
- }
- }
- if {$action=="icr"} {
- if {$r!=""} {
- puts $dbw $r
- if [string match -nocase $arg [lindex $r 0]] {
- set return 1
- }
- }
- }
- if {$action=="cf"} {
- if {$r!=""} {
- puts $dbw $r
- if [string match -nocase [lindex $r 0] $arg] {
- set return 1
- }
- }
- }
- if {$action=="ibr"} {
- if {$r!=""} {
- puts $dbw $r
- if [string match -nocase $arg [lindex $r 1]] {
- set return 1
- }
- }
- }
- }
- close $dbr
- close $dbw
- return $return
- }
- # Add blacklist #
- bind pub o| ".+blacklist" [namespace current]::+blacklist
- proc +blacklist {nick uhost hand chan args} {
- set verifexempt "[split [lindex $args 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {[lindex $args 0]!=""} {
- if {[progfile blacklist icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2$nickverife\2 est déjà dans la Blacklist ou ne peux etre Blackliste."
- return 0
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2$nickverife\2 Ne peux être ajouter a la Blackliste."
- return 0
- }
- progfile blacklist add $nickverife
- putserv "notice $nick :Le Nick: \2$nickverife\2 a bien été ajouté à la blacklist."
- putquick "PRIVMSG $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était ajouter au pseudo des (\0034Blackliste\00314)"
- putserv "privmsg $::log :\00314Commande \0036Blacklist ajouté par \0031: \0034$hand"
- return
- } else {
- puthelp "PRIVMSG $chan :Il faut une victime"
- return
- }}
- # Del Blacklist #
- bind pub o| ".-blacklist" [namespace current]::-blacklist
- proc -blacklist {nick uhost hand chan args} {
- set verifexempt "[split [lindex $args 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {[lindex $args 0]!=""} {
- if {[progfile blacklist del $nickverife]!="1"} {
- putserv "notice $nick :Attention le Nick: \2$nickverife\2 n'est pas dans la Blacklist."
- return 0
- }
- progfile blacklist del $nickverife
- putserv "notice $nick :Le Nick: \2$nickverife\2 a bien été supprimé de la blacklist."
- putquick "PRIVMSG $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était retiré au pseudo des (\0034Blackliste\00314)"
- putserv "privmsg $::log :\00314Commande \0036Blacklist retiré par \0031: \0034$hand"
- return
- } else {
- puthelp "PRIVMSG $chan :Il faut une victime"
- return
- }}
- # List Blacklist #
- bind pub o| ".blacklist" [namespace current]::.blacklist
- proc .blacklist {nick uhost hand chan args} {
- set nickb [lindex $args 0]
- set blusers [open database/blacklist.db r]
- putserv "notice $nick :\2Voici la Blacklist:\2"
- putserv "notice $nick :\2\2"
- while {![eof $blusers]} {
- set bluser [gets $blusers]
- if {$bluser!="" && $nickb==""} {
- putserv "notice $nick :\2Nick:\2 $bluser"
- } elseif [string match -nocase $nickb $bluser] {
- putserv "notice $nick :\2Nick:\2 $bluser."
- }
- }
- putserv "notice $nick :\2Fin de la Blacklist\2."
- putserv "privmsg $::log :\00314Commande \0036Blacklist par \0031: \0034$hand"
- close $blusers
- putserv "notice $nick :\2\2"
- }
- # Add Exempt #
- bind pub o| ".+exempt" [namespace current]::+exempt
- proc +exempt {nick uhost hand chan args} {
- set verifexempt "[split [lindex $args 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {[lindex $args 0]!=""} {
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2$nickverife\2 est déjà dans la liste des protégés."
- return 0
- }
- progfile exempt add $nickverife
- putserv "notice $nick :Le Nick: \2$nickverife\2 a bien été ajouté à la liste des protégés."
- putquick "PRIVMSG $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était ajouter au pseudo des (\0034Protégés\00314)"
- putserv "privmsg $::log :\00314Commande \0036Exempt ajouté par \0031: \0034$hand"
- return
- } else {
- puthelp "PRIVMSG $chan :Il faut une victime"
- return
- }}
- # Del Exempt #
- bind pub o| ".-exempt" [namespace current]::-exempt
- proc -exempt {nick uhost hand chan args} {
- set verifexempt "[split [lindex $args 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {[lindex $args 0]!=""} {
- if {[progfile exempt del $nickverife]!="1"} {
- putserv "notice $nick :Attention le Nick: \2$nickverife\2 n'est pas dans la liste des protégés."
- return 0
- }
- progfile exempt del $nickverife
- putserv "notice $nick :Le Nick: \2$nickverife\2 a bien été supprimé de la listes des protégés."
- putquick "PRIVMSG $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était retiré au pseudo des (\0034Protégés\00314)"
- putserv "privmsg $::log :\00314Commande \0036Exempt retiré par \0031: \0034$hand"
- return
- } else {
- puthelp "PRIVMSG $chan :Il faut une victime"
- return
- }}
- # List Exempt #
- bind pub o| ".exempt" [namespace current]::.exempt
- proc .exempt {nick uhost hand chan args} {
- set nickb [lindex $args 0]
- set blusers [open database/exempt.db r]
- putserv "notice $nick :\2Voici la ExemptList:\2"
- putserv "notice $nick :\2\2"
- while {![eof $blusers]} {
- set bluser [gets $blusers]
- if {$bluser!="" && $nickb==""} {
- putserv "notice $nick :\2Nick:\2 $bluser"
- } elseif [string match -nocase $nickb $bluser] {
- putserv "notice $nick :\2Nick:\2 $bluser."
- }
- }
- putserv "notice $nick :\2Fin de la ExemptList\2."
- putserv "privmsg $::log :\00314Commande \0036Exempt par \0031: \0034$hand"
- close $blusers
- putserv "notice $nick :\2\2"
- }
- # Join #
- bind join - "*" [namespace current]::xbl
- proc xbl {n u h c} {
- set k [lindex [split $n |] 0]
- if {[progfile blacklist cf $k]=="1"} {
- set vnick $n
- set hostmask "[split [getchanhost $vnick $c] @]"
- set hostmask "!*@*[lindex $hostmask 1]"
- putquick "MODE $c +bbb $hostmask $k!*@* $k|*!*@*"
- putquick "KICK $c $vnick : $::bl"
- }}
- # Protection #
- # Kick Protection #
- bind kick - * [namespace current]::kickpro
- proc kickpro { nick uhost hand chan target reason } {
- global auth
- set verifexempt "[split [lindex $target 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- set host [lindex [split $uhost @] 1]
- set vnick [lindex $target 0]
- set chrch [lindex [split $nick |] 0]
- if {[progfile exempt cf $chrch]=="0"} {
- if {[progfile exempt icr $nickverife]!="0"} {
- putquick "mode $chan +b *!*@$host"
- putserv "kick $chan $nick :$::protectk"
- }
- pushmode $chan +o $vnick
- }}
- # Devoice Protection #
- bind mode - "* -v" [namespace current]::prodev
- proc prodev { nick uhost hand chan mc target } {
- set verifexempt "[split [lindex $target 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- set host [lindex [split $uhost @] 1]
- set vnick [lindex $target 0]
- set chrch [lindex [split $nick |] 0]
- if {[progfile exempt cf $chrch]=="0"} {
- if {[progfile exempt icr $nickverife]!="0"} {
- putquick "mode $chan +b *!*@$host"
- putserv "kick $chan $nick :$::protectv"
- }
- pushmode $chan +v $vnick
- return 0
- }}
- # Deop Protection #
- bind mode - "* -o" [namespace current]::prodeop
- proc prodeop { nick uhost hand chan mc target } {
- set verifexempt "[split [lindex $target 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- set host [lindex [split $uhost @] 1]
- set vnick [lindex $target 0]
- set chrch [lindex [split $nick |] 0]
- if {[progfile exempt cf $chrch]=="0"} {
- if {[progfile exempt icr $nickverife]!="0"} {
- putquick "mode $chan +b *!*@$host"
- putserv "kick $chan $nick :$::protectd"
- pushmode $chan +o $target
- return 0
- }}}
- # AddChan/DelChan/ListChan Msg #
- bind msg - "addchan" [namespace current]::addchan
- proc addchan { nick host hand text } {
- global auth
- set chan [lindex $text 0]
- set chans [join [lrange [split $text] 0 0]]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {$text==""} {
- puthelp "notice $nick :Addchan incorrect ! Veuillez respecter la syntaxe suivante : /msg $::botnick addchan <#salon> !"
- }
- if ![matchattr $hand o| [lindex $text 0]] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (SuperOp sur $::botnick requis) !"
- return
- }
- if {[string match -nocase $chans $chan]} {
- putserv "privmsg $::log :\00314Commande \0036Addchan par \0031: \0034$hand"
- putserv "notice $nick :$chans Rajouter au Addchan !"
- channel add $chans
- savechannels
- return
- }
- if {[lsearch [channels] $chans]==-1} {
- puthelp "notice $nick :$chans existe déja dans la liste des addchan"
- return
- }}
- # Delchan #
- bind msg - "delchan" [namespace current]::delchan
- proc delchan { nick host hand text } {
- global auth
- set chan [lindex $text 0]
- set chans [join [lrange [split $text] 0 0]]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {$text==""} {
- puthelp "notice $nick :Addchan incorrect ! Veuillez respecter la syntaxe suivante : /msg $::botnick delchan <#salon> !"
- }
- if ![matchattr $hand o| [lindex $text 0]] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (SuperOp sur $::botnick requis) !"
- return
- }
- if {[lsearch [channels] $chans]==-1} {
- puthelp "notice $nick :Je ne suis pas sur $chans !"
- return
- }
- if {[string match -nocase $chans $chan]} {
- putserv "privmsg $::log :\00314Commande \0036Delchan par \0031: \0034$hand"
- putserv "notice $nick :$chans Retiré des Addchan !"
- channel remove $chans
- savechannels
- return
- }}
- # ListChan #
- bind msg - "listchan" [namespace current]::listchan
- proc listchan { nick host hand text } {
- global auth
- set chan [lindex $text 0]
- set chans [join [lrange [split $text] 0 0]]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if ![matchattr $hand o| [lindex $text 0]] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (SuperOp sur $::botnick requis) !"
- return
- }
- if {[string match -nocase $chans $chan]} {
- set voir 1
- putquick "privmsg $nick :\0034\[Liste Salons\]"
- foreach liste [channels] {
- putquick "privmsg $nick :\0037=>\0032 $voir \0037<= \0033 $liste"
- incr voir 1
- }
- putquick "privmsg $nick :\0036\[Fin De Liste\]"
- putserv "privmsg $::log :\00314Commande \0036Listchan par \0031: \0034$hand"
- return
- }
- if {[lsearch [channels] $chans]==-1} {
- puthelp "notice $nick :Je ne suis pas sur $chan !"
- return
- }}
- # Access/Newpass #
- bind MSG - "access" [namespace current]::access
- proc access { nick host hand text } {
- global auth
- set chan [lindex $text 0]
- set pseudo [split $nick |]
- set mask [lindex $text 1]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if ![string match #* $chan] {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick access <#channel> <mask> )"
- return
- }
- if {$mask==""} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick access <#channel> <mask> )"
- return
- }
- if ![validchan $chan] {
- puthelp "notice $nick :Désolé, ce salon n'est pas enregistré !"
- return
- }
- if ![matchattr $hand o|o [lindex $text 0]] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Opérateur sur [lindex $text 0] requis) !"
- return
- }
- putserv "PRIVMSG $nick :Liste des access de $chan correspondant à \0031\[ \0034$mask \0031\] :"
- foreach user [userlist |n $chan] {
- if [string match -nocase $mask $user] {
- putserv "PRIVMSG $nick :Owner $user"
- }}
- foreach user [userlist |m $chan] {
- if ![matchattr $user |n $chan]&&[string match -nocase $mask $user] {
- putserv "PRIVMSG $nick :Master $user"
- }}
- foreach user [userlist |o $chan] {
- if ![matchattr $user |m $chan]&&[string match -nocase $mask $user] {
- putserv "PRIVMSG $nick :Operateur $user"
- }}
- foreach user [userlist o|] {
- if [string match -nocase $mask $user] {
- putserv "privmsg $nick :SuperOp $user"
- }}
- putserv "PRIVMSG $nick :Fin de la liste d'access."
- putserv "privmsg $::log :\00314Commande \0036Access par \0031: \0034$hand"
- return
- }
- # Newpass #
- bind msg - "newpass" [namespace current]::newpass
- proc newpass { nick uhost hand text } {
- global auth
- set pseudo [split $nick |]
- set pseudo [lindex $pseudo 0]
- if {![validuser $pseudo]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {$text==""} {
- puthelp "notice $nick :Ancien mot de passe incorrect ! Veuillez respecter la syntaxe suivante : /msg $::botnick newpass <ancien-pass> <nouveau-pass> !"
- }
- if {[getuser $hand PASS]==""} {
- setuser $hand PASS [lindex $text 0]
- puthelp "notice $nick :Mot de passe défini : [lindex $text 0] !"
- return
- }
- if {[passwdok $hand [lindex $text 0]]} {
- if {[llength $text]>1} {
- setuser $hand PASS [lindex $text 1]
- puthelp "notice $nick :Nouveau mot de passe défini : [lindex $text 1] !"
- putserv "privmsg $::log :\00314Commande \0036Newpass par \0031: \0034$hand"
- return
- }}}
- # Addop/Addmaster/Addowner/Addsuperop Msg #
- bind MSG - "addop" [namespace current]::addop
- proc addop { nick host hand text } {
- global auth chan
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- if ![validuser $pseudo] {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if ![isauth $hand] {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* $chan]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick addop <pseudo> <#channel> )"
- return
- }
- if ![validchan $chan] {
- puthelp "notice $nick :Désolé, ce salon n'est pas enregistré !"
- return
- }
- if ![matchattr $hand o|m $chan] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (Master sur $chan requis) !"
- return
- }
- if [matchattr $vhand |n $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
- return
- }
- if [matchattr $vhand |m $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
- return
- }
- if [matchattr $vhand |o $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Opérateurs sur $chan !"
- return
- }
- if [matchattr $vhand |m $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
- return
- }
- adduser $vhand $vhand!*@*
- setuser $vhand HOSTS $vhand|*!*@*
- chattr $vhand -h|+o $chan
- puthelp "notice $nick :$vhand a bien été ajouté(e) en tant qu'opérateur sur $chan !"
- putserv "privmsg $::log :\00314Commande \0036Addop par \0031: \0034$hand"
- }
- # Addmaster #
- bind MSG - "addmaster" [namespace current]::addmaster
- proc addmaster { nick uhost hand text } {
- global auth
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* $chan]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick addmaster <pseudo> <#channel> )"
- return
- }
- if ![validchan $chan] {
- puthelp "notice $nick :Désolé, ce salon n'est pas enregistré !"
- return
- }
- if ![matchattr $hand o|n $chan] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (Owner sur $chan requis) !"
- return
- }
- if [validuser [lindex $text 0]] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List"
- return
- }
- adduser $vhand [lindex $text 0]!*@*
- setuser $vhand HOSTS [lindex $text 0]|*!*@*
- chattr $vhand -h|+om [lindex $text 1]
- puthelp "notice $nick :[lindex $text 0] a bien été ajouté(e) en tant que Master sur [lindex $text 1] !"
- putserv "privmsg $::log :\00314Commande \0036Addmaster par \0031: \0034$hand"
- return
- }
- # Addowner #
- bind MSG - "addowner" [namespace current]::addowner
- proc addowner { nick uhost hand text } {
- global auth
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* $chan]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick addowner <pseudo> <#channel> )"
- return
- }
- if ![validchan $chan] {
- puthelp "notice $nick :Désolé, ce salon n'est pas enregistré !"
- return
- }
- if ![matchattr $hand o| $chan] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (Superop sur $chan requis) !"
- return
- }
- if {![validuser [lindex $text 0]]} {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List"
- return
- }
- adduser $vhand [lindex $text 0]!*@*
- setuser $vhand HOSTS [lindex $text 0]|*!*@*
- chattr $vhand -h|+on [lindex $text 1]
- puthelp "notice $nick :[lindex $text 0] a bien été ajouté(e) en tant que Owner sur [lindex $text 1] !"
- putserv "privmsg $::log :\00314Commande \0036Addowner par \0031: \0034$hand"
- return
- }
- # Addsuperop #
- bind MSG - "addsuperop" [namespace current]::addsuperop
- proc addsuperop { nick host hand text } {
- global auth chan
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- if ![validuser $pseudo] {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if ![isauth $hand] {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if ![matchattr $hand o|] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (SuperOp sur $::botnick requis) !"
- return
- }
- adduser $vhand $vhand!*@*
- setuser $vhand HOSTS $vhand|*!*@*
- chattr $vhand +o|
- chattr $vhand -h|
- puthelp "notice $nick :$vhand a bien été ajouté(e) en tant que SuperOp sur $::botnick !"
- putserv "privmsg $::log :\00314Commande \0036Addsuperop par \0031: \0034$hand"
- }
- # Delop/Delmaster/Delowner/Delsuperop #
- # Delop #
- bind MSG - "delop" [namespace current]::delop
- proc delop { nick uhost hand text } {
- global auth chan
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* $chan]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick delop <pseudo> <#channel> )"
- return
- }
- if ![validchan $chan] {
- puthelp "notice $nick :Désolé, ce salon n'est pas enregistré !"
- return
- }
- if ![matchattr $hand o|m $chan] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (Master sur $chan requis) !"
- return
- }
- if ![matchattr $vhand |o $chan] {
- puthelp "notice $nick :Ce pseudo ne figure pas dans l'Access-List de $chan !"
- return
- }
- if [matchattr $vhand |n $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
- return
- }
- if [matchattr $vhand |m $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
- return
- }
- delchanrec $vhand $chan
- puthelp "notice $nick :[lindex $text 0] a bien été supprimé(e) de l'Access-List Opérateurs sur [lindex $text 1] !"
- putserv "privmsg $::log :\00314Commande \0036Delop par \0031: \0034$hand"
- foreach c [channels] {
- if [haschanrec $vhand $c] {
- return
- }}
- deluser $vhand
- }
- # Delmaster #
- bind MSG - "delmaster" [namespace current]::delmaster
- proc delmaster { nick uhost hand text } {
- global auth chan
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* $chan]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick delmaster <pseudo> <#channel> )"
- return
- }
- if ![validchan $chan] {
- puthelp "notice $nick :Désolé, ce salon n'est pas enregistré !"
- return
- }
- if ![matchattr $hand o|n $chan] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (Owner sur $chan requis) !"
- return
- }
- if ![matchattr $vhand |o $chan] {
- puthelp "notice $nick :Ce pseudo ne figure pas dans l'Access-List de $chan !"
- return
- }
- if [matchattr $vhand |n $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
- return
- }
- if ![matchattr $vhand |m $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Masters sur $chan !"
- return
- }
- delchanrec $vhand $chan
- puthelp "notice $nick :[lindex $text 0] a bien été supprimé(e) de l'Access-List Master sur [lindex $text 1] !"
- putserv "privmsg $::log :\00314Commande \0036Delmaster par \0031: \0034$hand"
- foreach c [channels] {
- if [haschanrec $vhand $c] {
- return
- }}
- deluser $vhand
- }
- # Delowner #
- bind MSG - "delowner" [namespace current]::delowner
- proc delowner { nick uhost hand text } {
- global auth chan
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* $chan]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick delowner <pseudo> <#channel> )"
- return
- }
- if ![validchan $chan] {
- puthelp "notice $nick :Désolé, ce salon n'est pas enregistré !"
- return
- }
- if ![matchattr $hand o| $chan] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (SuperOp sur $chan requis) !"
- return
- }
- if ![matchattr $vhand |o $chan] {
- puthelp "notice $nick :Ce pseudo ne figure pas dans l'Access-List de $chan !"
- return
- }
- if ![matchattr $vhand |n $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Owners sur $chan !"
- return
- }
- if ![matchattr $vhand |m $chan] {
- puthelp "notice $nick :Ce pseudo figure dans l'Access-List Master sur $chan !"
- return
- }
- delchanrec $vhand $chan
- puthelp "notice $nick :[lindex $text 0] a bien été supprimé(e) de l'Access-List Owner sur [lindex $text 1] !"
- putserv "privmsg $::log :\00314Commande \0036Delowner par \0031: \0034$hand"
- foreach c [channels] {
- if [haschanrec $vhand $c] {
- return
- }}
- deluser $vhand
- }
- # Delsuperop #
- bind MSG - "delsuperop" [namespace current]::delsuperop
- proc delsuperop { nick host hand text } {
- global auth chan
- set vhand [lindex [split [lindex $text 0] |] 0]
- set chan [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- if ![validuser $pseudo] {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if ![isauth $hand] {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if ![matchattr $hand o|] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande (SuperOp sur $::botnick requis) !"
- return
- }
- deluser $vhand
- puthelp "notice $nick :$vhand a bien été supprimé en tant que superop sur $::botnick !"
- putserv "privmsg $::log :\00314Commande \0036Delsuperop par \0031: \0034$hand"
- }
- # op/deop/voice/devoice Chan #
- # op #
- bind pub - ".op" [namespace current]::op
- proc op { nick host hand chan text } {
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {$text!=""} {
- if ![matchattr $hand o|o $chan] {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- putquick "mode $chan +oooooo [join $text]"
- putserv "privmsg $::log :\00314Commande \0036Op par \0031: \0034$hand"
- return
- }
- if [isop [join $nick] $chan] {
- putserv "NOTICE $nick :Vous êtes déjà @ sur $chan !"
- return
- }
- putquick "mode $chan +o [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Op par \0031: \0034$hand"
- }
- # Deop #
- bind PUB - ".deop" [namespace current]::deop
- proc deop { nick host hand chan text } {
- global auth
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $text 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {$text!=""} {
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
- return
- }
- putquick "mode $chan -oooooo [join $text]"
- putserv "privmsg $::log :\00314Commande \0036Deop par \0031: \0034$hand"
- return
- }
- if {![isop [join $nick] $chan]} {
- putserv "NOTICE $nick :Vous n'êtes pas @ sur $chan !"
- return
- }
- putquick "mode $chan -o [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Deop par \0031: \0034$hand"
- }
- # Voice #
- bind PUB - ".voice" [namespace current]::voice
- proc voice { nick host hand chan text } {
- global auth
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {$text!=""} {
- putquick "mode $chan +vvvvvv [join $text]"
- putserv "privmsg $::log :\00314Commande \0036Voice par \0031: \0034$hand"
- return
- }
- if [isvoice [join $nick] $chan] {
- putserv "NOTICE $nick :Vous êtes déjà voice sur $chan !"
- return
- }
- putquick "mode $chan +v [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Voice par \0031: \0034$hand"
- }
- # Devoice #
- bind PUB - ".devoice" [namespace current]::devoice
- proc devoice { nick host hand chan text } {
- global auth
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $text 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
- return 0
- }
- if {$text!=""} {
- putquick "mode $chan -vvvvvv [join $text]"
- putserv "privmsg $::log :\00314Commande \0036Devoice par \0031: \0034$hand"
- return
- }
- if {![isvoice [join $nick] $chan]} {
- putserv "NOTICE $nick :Vous êtes déjà devoice sur $chan !"
- return
- }
- putquick "mode $chan -v [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Devoice par \0031: \0034$hand"
- }
- # Opall/Deopall/Voiceall/Devoiceall Chan #
- # Opall #
- bind pub - ".opall" [namespace current]::opall
- proc opall {nick host hand chan arg} {
- global auth
- set arg [split $arg]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|m $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Master sur $chan requis.) !"
- return
- }
- foreach opall [chanlist $chan] { if [isop $opall $chan] continue; pushmode $chan +o $opall }
- putserv "privmsg $::log :\00314Commande \0036Opall par \0031: \0034$hand"
- return
- }
- # Deopall #
- bind pub - ".deopall" [namespace current]::deopall
- proc deopall { nick host hand chan arg } {
- global auth
- set arg [split $arg]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|m $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Master sur $chan requis.) !"
- return
- }
- foreach deopall [chanlist $chan] { if [isvoice $deopall $chan] continue; pushmode $chan -o $deopall }
- putserv "privmsg $::log :\00314Commande \0036Deopall par \0031: \0034$hand"
- return
- }
- # voiceall #
- bind pub - ".voiceall" [namespace current]::voiceall
- proc voiceall { nick host hand chan arg } {
- global auth
- set arg [split $arg]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|m $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Master sur $chan requis.) !"
- return
- }
- foreach voiceall [chanlist $chan] { if [isop $voiceall $chan] continue; pushmode $chan +v $voiceall }
- putserv "privmsg $::log :\00314Commande \0036Voiceall par \0031: \0034$hand"
- return
- }
- # Devoiceall #
- bind pub - ".devoiceall" [namespace current]::devoiceall
- proc devoiceall { nick host hand chan arg } {
- global auth
- set arg [split $arg]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|m $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Master sur $chan requis.) !"
- return
- }
- foreach devoiceall [chanlist $chan] { if [isop $devoiceall $chan] continue; pushmode $chan -v $devoiceall }
- putserv "privmsg $::log :\00314Commande \0036Devoiceall par \0031: \0034$hand"
- return
- }
- # op/deop/voice/devoice Msg #
- # Op #
- bind MSG - "op" [namespace current]::xop
- proc xop { nick host hand text } {
- global auth
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $text 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick op #channel (pseudo(s)) )"
- return
- }
- if {![validchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé le salon demandé n'est pas enregistré !"
- return
- }
- if {![matchattr $hand o|o [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Opérateur sur [lindex $text 0] requis) !"
- return
- }
- if {![botonchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je ne peux te mettre op je suis deop !"
- return
- }
- if {[lindex $text 1]!=""} {
- putquick "mode [lindex $text 0] +oooooo [join [lrange $text 1 end]]"
- putserv "privmsg $::log :\00314Commande \0036Op par \0031: \0034$hand"
- return
- }
- if {![onchan $nick [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'êtes pas sur [lindex $text 0] !"
- return
- }
- if {[isop [join $nick] [lindex $text 0]]} {
- puthelp "notice $nick :Vous êtes déjà @ sur [lindex $text 0] !"
- return
- }
- putquick "mode [lindex $text 0] +o [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Op par \0031: \0034$hand"
- }
- # Deop #
- bind MSG - "deop" [namespace current]::xdeop
- proc xdeop { nick host hand text } {
- global auth
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $text 1] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $text 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick deop #channel (pseudo(s)) )"
- return
- }
- if {![validchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![matchattr $hand o|o [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Opérateur sur [lindex $text 0] requis) !"
- return
- }
- if {![onchan $nick [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'êtes pas sur [lindex $text 0] !"
- return
- }
- if {![botonchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je ne peux te mettre deop je suis deop !"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2$nickverife\2 est dans la liste des protégés."
- return 0
- }
- if {[lindex $text 1] !=""} {
- putquick "mode [lindex $text 0] -oooooo [join [lrange $text 1 end]]"
- putserv "privmsg $::log :\00314Commande \0036Deop par \0031: \0034$hand"
- return
- }
- if ![isop [join $nick] [lindex $text 0]] {
- puthelp "notice $nick :Vous êtes déjà deop sur [lindex $text 0] !"
- return
- }
- putquick "mode [lindex $text 0] -o [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Deop par \0031: \0034$hand"
- }
- # Voice #
- bind MSG - "voice" [namespace current]::xvoice
- proc xvoice { nick uhost hand text } {
- global auth
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $text 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick voice #channel (pseudo(s)) )"
- return
- }
- if {![validchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![matchattr $hand o|o [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Opérateur sur [lindex $text 0] requis) !"
- return
- }
- if {![onchan $nick [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'êtes pas sur [lindex $text 0] !"
- return
- }
- if {![botonchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je ne peux te mettre voice je suis deop !"
- return
- }
- if {[lindex $text 1] !=""} {
- putquick "mode [lindex $text 0] +vvvvvv [join [lrange $text 1 end]]"
- putserv "privmsg $::log :\00314Commande \0036Voice par \0031: \0034$hand"
- return
- }
- if {![isop [join $nick] [lindex $text 0]]} {
- puthelp "notice $nick :Vous êtes déjà voice sur [lindex $text 0] !"
- return
- }
- putquick "mode [lindex $text 0] +v [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Voice par \0031: \0034$hand"
- }
- # Devoice #
- bind MSG - "devoice" [namespace current]::xdevoice
- proc xdevoice { nick host hand text } {
- global auth
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $text 1] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $text 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick devoice #channel (pseudo(s)) )"
- return
- }
- if {![validchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![matchattr $hand o|o [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Opérateur sur [lindex $text 0] requis) !"
- return
- }
- if {![onchan $nick [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'êtes pas sur [lindex $text 0] !"
- return
- }
- if {![botonchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je ne peux te mettre devoice je suis deop !"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2$nickverife\2 est dans la liste des protégés."
- return 0
- }
- if {[lindex $text 1] !=""} {
- putquick "mode [lindex $text 0] -vvvvvv [join [lrange $text 1 end]]"
- putserv "privmsg $::log :\00314Commande \0036Devoice par \0031: \0034$hand"
- return
- }
- if ![isop [join $nick] [lindex $text 0]] {
- puthelp "notice $nick :Vous êtes déjà devoice sur [lindex $text 0] !"
- return
- }
- putquick "mode [lindex $text 0] -v [join $nick]"
- putserv "privmsg $::log :\00314Commande \0036Devoice par \0031: \0034$hand"
- }
- # Ban/Kick/Unban/Kickban Chan #
- # Ban #
- bind pub - ".ban" [namespace current]::ban
- proc ban { nick host hand chan text } {
- global auth
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $text 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {$text == ""} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( .ban pseudo/host )"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
- return
- }
- if {[string match *!*@* [lindex $text 0]]} {
- putquick "mode $chan +b [lindex $text 0]"
- putserv "privmsg $::log :\00314Commande \0036Ban par \0031: \0034$hand"
- return
- }
- if {[llength [getchanhost [lindex $text 0]]]!=0} {
- set host [lindex [split [getchanhost [lindex $text 0]] @] 1]
- putquick "mode $chan +b *!*@$host"
- putserv "privmsg $::log :\00314Commande \0036Ban par \0031: \0034$hand"
- return
- }
- puthelp "notice $nick :Le pseudo [lindex $text 0] n'est pas sur un de mes salons, je ne peux récupérer son host !"
- }
- # Kick #
- bind pub - ".kick" [namespace current]::kick
- proc kick { nick uhost hand chan text } {
- global auth
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $text 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {$text == ""} {
- puthelp "notice $nick :Syntaxe : .kick <pseudo> <raison>"
- return
- }
- if {$text != ""} {
- if {![onchan [lindex $text 0]]} {
- puthelp "notice $nick :Le pseudo [lindex $text 0] n'est pas sur $chan"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
- return 0
- }
- if {[lindex $text 1] != ""} {
- putquick "kick $chan [lindex $text 0] :[join [lrange $text 1 end]]"
- putserv "privmsg $::log :\00314Commande \0036Kick par \0031: \0034$hand"
- return
- }
- if {[lindex $text 1] == ""} {
- putquick "kick $chan [lindex $text 0] :$::kick $nick !"
- putserv "privmsg $::log :\00314Commande \0036Kick par \0031: \0034$hand"
- return
- }}}
- # Unban #
- bind pub - ".unban" [namespace current]::unban
- proc unban { nick uhost hand chan text } {
- global auth
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {$text == ""} {
- puthelp "notice $nick :Syntaxe : .unban <host>"
- return
- }
- if {[string match *!*@* [lindex $text 0]]} {
- putquick "mode $chan -b [lindex $text 0]"
- putserv "privmsg $::log :\00314Commande \0036Unban par \0031: \0034$hand"
- return
- }
- if {[llength [getchanhost [lindex $text 0]]]!=0} {
- set host [lindex [split [getchanhost [lindex $text 0]] @] 1]
- putquick "mode $chan -b *!*@$host"
- putserv "privmsg $::log :\00314Commande \0036Unban par \0031: \0034$hand"
- return
- }}
- # Kickban #
- bind pub - ".kickban" [namespace current]::kickban
- proc kickban { nick uhost hand chan text } {
- global auth
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $text 0] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {$text == ""} {
- puthelp "notice $nick :Syntaxe : .kickban <pseudo>"
- return
- }
- if {![onchan [lindex $text 0] $chan]} {
- puthelp "notice $nick :Le pseudo [lindex $text 0] n'est pas sur $chan"
- return
- }
- if {![botisop [lindex $chan]]} {
- puthelp "notice $nick :Désolé je ne peux kickban je suis deop !"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2[lindex $text 0]\2 est dans la liste des protégés."
- return 0
- }
- set host [lindex [split [getchanhost [lindex $text 0]] @] 1]
- putquick "mode $chan +b *!*@$host"
- putquick "kick $chan [lindex $text 0] :[join [lrange $text 1 end]] (Exclu(e) de $chan"
- putserv "privmsg $::log :\00314Commande \0036Kickban par \0031: \0034$hand"
- return
- }
- # Ban/Kick/Unban/Kickban MSG #
- # Ban #
- bind msg - "ban" [namespace current]::xban
- proc xban { nick uhost hand arg } {
- global auth
- set pseudo [lindex [split $nick |] 0]
- set chan [lindex $arg 0]
- set cible [lindex $arg 1]
- set verifexempt "[split [lindex $arg 1] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser $pseudo]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if ("[llength $arg]"!="2")||![string match -nocase #* $chan] {
- puthelp "notice $nick :Syntaxe incorrect ( /msg $::botnick ban <#salon> <pseudo/host> )"
- return
- }
- if {![validchan [lindex $arg 0]]} {
- puthelp "notice $nick :Désolé le salon n'est pas un salon enregistré !"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {![botonchan [lindex $arg 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $arg 0]]} {
- puthelp "notice $nick :Désolé je ne suis pas op sur $chan !"
- return
- }
- if {[string match *!*@* $cible]} {
- putquick "mode $chan +b $cible"
- putserv "privmsg $::log :\00314Commande \0036Ban par \0031: \0034$hand"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- putserv "notice $nick :Attention le Nick: \2$cible\2 est dans la liste des protégés."
- return 0
- }
- if {[llength [getchanhost $cible]]!=0} {
- set host [lindex [split [getchanhost $cible] @] 1]
- putquick "mode $chan +b *!*@$host"
- putserv "privmsg $::log :\00314Commande \0036Ban par \0031: \0034$hand"
- return
- }
- puthelp "notice $nick :Le pseudo $cible n'est pas sur un de mes salons, je ne peux récupérer son host !"
- }
- # kick #
- bind msg - "kick" [namespace current]::xkick
- proc xkick { nick uhost hand text } {
- global auth
- set chan [lindex $text 0]
- set cible [lindex $text 1]
- set pseudo [lindex [split $nick |] 0]
- set verifexempt "[split [lindex $text 1] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser $pseudo]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $text 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick kick <#salon> (pseudo(s)) )"
- return
- }
- if {![validchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé le salon n'est pas un salon enregistré !"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {![onchan $nick [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'êtes pas sur [lindex $text 0] !"
- return
- }
- if {![botonchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je ne suis pas op sur $chan !"
- return
- }
- if {![onchan $cible $chan]} {
- puthelp "notice $nick :Le pseudo [lindex $text 1] n'est pas sur [lindex $text 0] !"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- puthelp "notice $nick :Attention le Nick: \2[lindex $text 1]\2 est dans la liste des protégés."
- return 0
- }
- if {[lindex $text 2] !=""} {
- putquick "kick [lindex $text 0] [lindex $text 1] :[join [lrange $text 2 end]]"
- putserv "privmsg $::log :\00314Commande \0036Kick par \0031: \0034$hand"
- return
- }
- if {[onchan [join [lindex $text 1]] [lindex $text 0]]} {
- putquick "kick [lindex $text 0] [lindex $text 1] :$::kick $nick !"
- putserv "privmsg $::log :\00314Commande \0036Kick par \0031: \0034$hand"
- return
- }}
- # Unban #
- bind msg - "unban" [namespace current]::xunban
- proc xunban { nick uhost hand arg } {
- global auth
- set chan [lindex $arg 0]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {![string match #* [lindex $arg 0]]} {
- puthelp "notice $nick :Syntaxe : /msg $::botnick unban <#salon> <host>"
- return
- }
- if {[string match *!*@* [lindex $arg 1]]} {
- putquick "mode $chan -b [lindex $arg 1]"
- putserv "privmsg $::log :\00314Commande \0036Unban par \0031: \0034$hand"
- return
- }
- if {[llength [getchanhost [lindex $arg 0]]]!=0} {
- set host [lindex [split [getchanhost [lindex $arg 0]] @] 1]
- putquick "mode $chan -b *!*@$host"
- putserv "privmsg $::log :\00314Commande \0036Unban par \0031: \0034$hand"
- return
- }}
- # Kickban #
- bind msg - "kickban" [namespace current]::xkickban
- proc xkickban { nick uhost hand arg } {
- global auth
- set chan [lindex $arg 0]
- set pseudo [split $nick |]
- set verifexempt "[split [lindex $arg 1] |]"
- set nickverife "[lindex $verifexempt 0]"
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|o $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Opérateur sur $chan requis.) !"
- return
- }
- if {![string match #* [lindex $arg 0]]} {
- puthelp "notice $nick :Syntaxe : /msg $::botnick kickban <#salon> <pseudo> <raison>"
- return
- }
- if {[progfile exempt icr $nickverife]!="0"} {
- puthelp "notice $nick :Attention le Nick: \2[lindex $arg 1]\2 est dans la liste des protégés."
- return 0
- }
- if {[llength [getchanhost [lindex $arg 1]]]!=0} {
- set host [lindex [split [getchanhost [lindex $arg 1]] @] 1]
- putquick "mode $chan +b *!*@$host"
- putquick "kick [lindex $arg 0] [lindex $arg 1] :[join [lrange $arg 2 end]] (Exclu(e) de $chan"
- putserv "privmsg $::log :\00314Commande \0036Kickban par \0031: \0034$hand"
- return
- }}
- # Clearban/Mode Chan #
- # Clearban #
- bind pub - ".clearbans" [namespace current]::clearbans
- proc clearbans { nick host hand chan text } {
- global auth
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|m $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Master sur [lindex $text 0] requis.) !"
- return
- }
- foreach bsyntaxe [chanbans $chan] {
- putquick "mode $chan -b [lindex $bsyntaxe 0]"
- }
- putserv "privmsg $::log :\00314Commande \0036Clearbans par \0031: \0034$hand"
- }
- # Mode #
- bind pub - ".mode" [namespace current]::mode
- proc mode { nick uhost hand chan text } {
- global auth
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {$text!=""} {
- if {![matchattr $hand o|m $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Master sur $chan requis.) !"
- return
- }
- putquick "mode $chan $text"
- putserv "privmsg $::log :\00314Commande \0036Mode par \0031: \0034$hand"
- }}
- # Clearbans/Mode Msg #
- # Clearbans #
- bind msg - "clearbans" [namespace current]::xclearbans
- proc xclearbans { nick host hand text } {
- global auth
- set chan [lindex $text 0]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $text 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick clearbans <#salon>)"
- return
- }
- if {![validchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![matchattr $hand o|m [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Master sur [lindex $text 0] requis) !"
- return
- }
- if {![botonchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je ne peux clearbans je suis deop !"
- return
- }
- foreach bsyntaxe [chanbans $chan] {
- putquick "mode $chan -b [lindex $bsyntaxe 0]"
- }
- putserv "privmsg $::log :\00314Commande \0036Clearbans par \0031: \0034$hand"
- }
- # Mode #
- bind msg - "mode" [namespace current]::xmode
- proc xmode { nick host hand text } {
- global auth
- set chan [lindex $text 0]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $text 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $botnick mode <#salon> <mode(s)>)"
- return
- }
- if {![validchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {$text!=""} {
- if {![matchattr $hand o|m [lindex $text 0]]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Master sur [lindex $text 0] requis) !"
- return
- }
- if {![botonchan [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if {![botisop [lindex $text 0]]} {
- puthelp "notice $nick :Désolé je ne peux Mode je suis deop !"
- return
- }
- putquick "mode $chan [lindex $text 1]"
- putserv "privmsg $::log :\00314Commande \0036Mode par \0031: \0034$hand"
- }}
- # Topic #
- bind pub - ".topic" [namespace current]::topic
- proc topic { nick host hand chan arg} {
- global auth
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![matchattr $hand o|m $chan]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'exécution de cette commande ( Master sur $chan requis.) !"
- return
- }
- putquick "TOPIC $chan :$arg"
- putserv "privmsg $::log :\00314Commande \0036Topic par \0031: \0034$hand"
- }
- # Infoline #
- bind msg - "infoline" [namespace current]::infoline
- proc infoline { nick host hand arg } {
- set chan [lindex $arg 0]
- set pseudo [split $nick |]
- if {![validuser [lindex $pseudo 0]]} {
- puthelp "notice $nick :Vous n'avez aucun access dans $::botnick !"
- return
- }
- if {![isauth $hand]} {
- puthelp "notice $nick :Veuillez vous identifier au préalable ! ( /msg $::botnick auth <pseudo> <pass> )"
- return
- }
- if {![string match #* [lindex $arg 0]]} {
- puthelp "notice $nick :Syntaxe incorrecte ! ( /msg $::botnick infoline <#salon> <text>)"
- return
- }
- if {![validchan [lindex $arg 0]]} {
- puthelp "notice $nick :Désolé je me trouve actuellement pas sur le salon demandé !"
- return
- }
- if { [string length $arg] ne 0 } {
- if {![matchattr $hand |o [lindex $arg 0]]} {
- puthelp "notice $nick :Vous n'avez pas les droits nécessaires à l'utilisation de cette commande (Opérateur sur [lindex $arg 0] requis) !"
- return
- } else {
- setchaninfo $hand $chan $arg
- puthelp "notice $nick :Infoline définie :$arg"
- putserv "privmsg $::log :\00314Commande \0036Infoline par \0031: \0034$hand"
- }
- }
- }
- bind notc - * nonotice_chanoff
- proc nonotice_chanoff { nick uhost hand text dest } {
- global botnick
- if ("$nick"=="")||("$dest"=="$botnick") {return 0}
- if [validuser [finduser $nick!*@*]]&&[matchattr $hand o|o $dest] {return 0}
- if [isop $nick $dest]||[isvoice $nick $dest] {return 0}
- if ![botisop $dest] {return 0}
- if [string match -nocase niubot?? $nick] {return 0}
- set host [lindex [split $uhost @] 1]
- putquick "mode $dest +b *!*@$host"
- putquick "kick $dest $nick :$::nt"
- }
- # Help #
- bind msg - "help" [namespace current]::help
- proc help { nick host hand arg } {
- set commande [lindex $arg 1]
- set commande [stripcodes abcu [lindex $arg 0]]
- if {$commande == ""} {
- puthelp "privmsg $nick :\00314Commande Help du Robot \002\0034$::botnick\002\0034"
- puthelp "privmsg $nick :"
- foreach c [channels] {
- if [matchattr $hand |o $c] {
- puthelp "privmsg $nick :\0031\037Level \002Opérateur\002 :\0037"
- puthelp "privmsg $nick :"
- puthelp "privmsg $nick :\00314Auth \0031: \0034Permet de vous identifer auprès du Robot $::botnick en MSG !"
- puthelp "privmsg $nick :\00314Op \0031: \0034Permet de te mettre Opérateur \0031(\00312@\0031) \0034 ou de deop sur le salon ou en Msg. et pour le faire sur quelqun aussi !"
- 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 quelqun aussi !"
- 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 quelqun aussi !"
- 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 quelqun aussi !"
- puthelp "privmsg $nick :\00314Kick \0031: \0034Permet de Kick quelqun sur un salon défini commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Kickban \0031: \0034Permet de Kickban quelqun sur un salon défini commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Ban \0031: \0034Permet de Ban quelqun sur un salon défini commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Unban \0031: \0034Permet de Unban quelqun sur un salon défini commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Access \0031: \0034Permet de regarder la liste d'acces command Msg !"
- puthelp "privmsg $nick :\00314Deauth \0031: \0034Permet de vous déauthentifer auprès du Robot $::botnick commande Msg !"
- puthelp "privmsg $nick :\00314Newpass \0031: \0034Permet de changer votre mot de pass auprès du Robot $::botnick commande Msg !"
- puthelp "privmsg $nick :\00314Infoline \0031: \0034Permet de vous mettre un text a l'entrée d'un salon commande Msg !"
- puthelp "privmsg $nick :"
- break
- }}
- foreach c [channels] {
- if [matchattr $hand |m $c] {
- puthelp "privmsg $nick :\0031\037Level \002Master\002 :\037"
- puthelp "privmsg $nick :"
- puthelp "privmsg $nick :\00314Addop \0031: \0034Permet de mettre un user Opérateur sur un salon défini commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Delop \0031: \0034Permet de retiré le level Opérateur sur un salon défini commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Clearbans \0031: \0034Permet de Clearbans tout les ban sur le salon commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Mode \0031: \0034Permet de mettre ou retirer un Mode commande Chan ou Msg !"
- puthelp "privmsg $nick :\00314Opall \0031: \0034Permet de mettre tout le mondes Op commande Chan !"
- puthelp "privmsg $nick :\00314Deopall \0031: \0034Permet de mettre tout le mondes Deop commande Chan !"
- puthelp "privmsg $nick :\00314Voiceall \0031: \0034Permet de mettre tout le mondes Voice commande Chan !"
- puthelp "privmsg $nick :\00314Devoiceall \0031: \0034Permet de mettre tout le mondes Devoice commande Chan !"
- puthelp "privmsg $nick :"
- break
- }}
- foreach c [channels] {
- if [matchattr $hand |n $c] {
- puthelp "privmsg $nick :\0031\037Level \002Owner\002 :\037"
- puthelp "privmsg $nick :\00314Addmaster \0031: \0034Permet de mettre un user ou un Opérateur d'un salon le level Master commande Msg !"
- puthelp "privmsg $nick :\00314Delmaster \0031: \0034Permet de retiré le level Master sur un salon défini commande Msg !"
- break
- }}
- foreach c [channels] {
- if [matchattr $hand o| $c] {
- puthelp "privmsg $nick :\0031\037Level \002SuperOp\002 :\037"
- puthelp "privmsg $nick :\00314Delowner \0031: \0034Permet de retiré le level Owner sur un salon défini commande Msg !"
- puthelp "privmsg $nick :\00314Exempt \0031: \0034Permet de mettre/retirer/regarder les pseudos protégés commande Chan !"
- puthelp "privmsg $nick :\00314Blacklist \0031: \0034Permet de mettre/retirer/regarder la Blacklist commande Chan !"
- puthelp "privmsg $nick :\00314Addsuspend \0031: \0034Permet de suspendre un accéss commande Msg !"
- puthelp "privmsg $nick :\00314Delsuspend \0031: \0034Permet de retiré un suspend commande Msg !"
- puthelp "privmsg $nick :\00314Addchan \0031: \0034Permet de rajouter un autojoin sur un salon au bot commande Msg !"
- puthelp "privmsg $nick :\00314Delchan \0031: \0034Permet de retiré un salon des autojoin au bot commande Msg !"
- puthelp "privmsg $nick :\00314Listchan \0031: \0034Permet de regarder la liste des chan en autojoin qui ya dans $::botnick commande Msg !"
- puthelp "privmsg $nick :\00314Addowner \0031: \0034Permet de mettre un user ou Opérateur ou un Master le level Owner commande Msg !"
- puthelp "privmsg $nick :\0031Addsuperop \0031: \Permet de mettre un user ou Opérateur ou Master ou Owner le level SuperOp commande Msg !"
- puthelp "privmsg $nick :\00314Delsuperop \0031: \0034Permet de retiré le level SuperOp commande Msg !"
- break
- }}
- puthelp "privmsg $nick :"
- puthelp "privmsg $nick :\00314Exemple de commande a taper pour avoir de l'aide plus detailler\00314"
- puthelp "privmsg $nick :\0034/msg $::botnick help op\0034"
- puthelp "privmsg $nick :"
- puthelp "privmsg $nick :\0031\037\002Fin du Help !\002"
- puthelp "privmsg $::log :\00314Commande \0036Help par \0031: \0034$hand"
- }
- switch -- $commande {
- "op" {
- puthelp "privmsg $nick :\00314Commande Op Chan \0031: \0034.op \0031ou \0034.op <pseudo>"
- puthelp "privmsg $nick :\00314Commande Op Msg \0031: \0034/msg $::botnick op <#salon> \0031ou \0034/msg $::botnick op <#salon> <pseudo>"
- }
- "deop" {
- puthelp "privmsg $nick :\00314Commande Deop Chan \0031: \0034.deop \0031ou \0034.deop <pseudo>"
- puthelp "privmsg $nick :\0031Commande Deop Chan \0031: \0034/msg $::botnick deop <#salon> \0031ou \0034/msg $::botnick deop <#salon> <pseudo>"
- }
- "voice" {
- puthelp "privmsg $nick :\00314Commande Voice Chan \0031: \0034.voice \0031ou \0034.voice <pseudo>"
- puthelp "privmsg $nick :\00314Commande Voice Msg \0031: \0034/msg $::botnick <voice> <#salon> \0031ou \0034/msg $::botnick <voice> <#salon> <pseudo>"
- }
- "devoice" {
- puthelp "privmsg $nick :\00314Commande Devoice Chan \0031: \0034.devoice \0031ou \0034.devoice <pseudo>"
- puthelp "privmsg $nick :\00314Commande Devoice Msg \0031: \0034/msg $::botnick <devoice> <#salon> \0031ou \0034/msg $::botnick devoice <#salon> <pseudo>"
- }
- "kick" {
- puthelp "privmsg $nick :\00314Commande Kick Chan \0031: \0034.kick <pseudo> \0031ou \0034.kick <pseudo> <raison>"
- puthelp "privmsg $nick :\00314Commande Kick Msg \0031: \0034/msg $::botnick kick <#salon> <pseudo> \0031ou \0034/msg $::botnick kick <#salon> <pseudo> <raison>"
- }
- "kickban" {
- puthelp "privmsg $nick :\00314Commande Kickban Chan \0031: \0034.kickban <pseudo> \0031ou \0034.kickban <pseudo> <raison>"
- puthelp "privmsg $nick :\00314Commande Kickban Msg \0031: \0034/msg $::botnick kickban <#salon> <pseudo> \0031ou \0034/msg $::botnick kickban <#salon> <pseudo> <raison>"
- }
- "ban" {
- puthelp "privmsg $nick :\00314Commande Ban Chan \0031: \0034.ban <pseudo> \0031ou \0034.ban <host>"
- puthelp "privmsg $nick :\00314Commande Ban Msg \0031: \0034/msg $::botnick ban <#salon> <host>"
- }
- "unban" {
- puthelp "privmsg $nick :\00314Commande Unban Chan \0031: \0034.unban <pseudo> \ou \0034.unban <host>"
- puthelp "privmsg $nick :\00314Commande Unban Msg \0031: \0034/msg $::botnick unban <#salon> <host>"
- }
- "access" {
- 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)"
- }
- "addop" {
- puthelp "privmsg $nick :\00314Commande Addop Msg \0031: \0034/msg $::botnick addop <pseudo> <#salon>"
- }
- "addmaster" {
- puthelp "privmsg $nick :\00314Commande Addmaster Msg \0031: \0034/msg $::botnick addmaster <pseudo> <#salon>"
- }
- "addowner" {
- puthelp "privmsg $nick :\00314Commande Addowner Msg \0031: \0034/msg $::botnick addowner <pseudo> <#salon>"
- }
- "delop" {
- puthelp "privmsg $nick :\00314Commande Delop Msg \0031: \0034 /msg $::botnick delop <pseudo> <#salon>"
- }
- "delmaster" {
- puthelp "privmsg $nick :\00314Commande Delmaster Msg \0031: \0034/msg $::botnick delmaster <pseudo> <#salon>"
- }
- "delowner" {
- puthelp "privmsg $nick :\00314Commande Delowner Msg \0031: \0034/msg $::botnick delowner <pseudo> <#salon>"
- }
- "clearbans" {
- puthelp "privmsg $nick :\00314Commande Clearbans Chan \0031: \0034.clearbans"
- puthelp "privmsg $nick :\00314Commande Clearbans Msg \0031: \0034/msg $::botnick clearbans <#salon>"
- }
- "mode" {
- puthelp "privmsg $nick :\00314Commande Mode Chan \0031: \0034.mode <le-mode>"
- puthelp "privmsg $nick :\00314Commande Mode Msg \0031: \0034/msg $::botnick mode <#salon> <mode>"
- }
- "blacklist" {
- puthelp "privmsg $nick :\00314Commande Blacklist Chan \0031: \0034.blacklist"
- puthelp "privmsg $nick :\00314Commande Blacklist Chan \0031: \0034.+blacklist <pseudo>"
- puthelp "privmsg $nick :\00314Commande Blacklist Chan \0031: \0034.-blacklist <pseudo>"
- }
- "exempt" {
- puthelp "privmsg $nick :\00314Commande Exempt Chan \0031: \0034.exempt"
- puthelp "privmsg $nick :\00314Commande Exempt Chan \0031: \0034.+exempt <pseudo>"
- puthelp "privmsg $nick :\00314Commande Exempt Chan \0031: \0034.-exempt <pseudo>"
- }
- "newpass" {
- puthelp "privmsg $nick :\00314Commande Newpass Msg \0031: \0034/msg $::botnick newpass <ancien-pass> <nouveau-pass>"
- }
- "opall" {
- puthelp "privmsg $nick :\00314Commande Opall Chan \0031: \0034.opall"
- }
- "deopall" {
- puthelp "privmsg $nick :\00314Commande Deopall Chan \0031: \0034.deopall"
- }
- "voiceall" {
- puthelp "privmsg $nick :\00314Commande Voiceall Chan \0031: \0034.voiceall"
- }
- "devoiceall" {
- puthelp "privmsg $nick :\00314Commande Devoiceall Chan \0031: \0034.devoiceall"
- }
- "addsuspend" {
- puthelp "privmsg $nick :\00314Commande Addsuspend Msg \0031: \0034/msg $::botnick addsuspend <pseudo>"
- }
- "delsuspend" {
- puthelp "privmsg $nick :\00314Commande Delsuspend Msg \0031: \0034/msg $::botnick delsuspend <pseudo>"
- }
- "addchan" {
- puthelp "privmsg $nick :\00314Commande Addchan Msg \0031: \0034/msg $::botnick addchan <#salon>"
- }
- "delchan" {
- puthelp "privmsg $nick :\00314Commande Delchan Msg \0031: \0034/msg $::botnick delchan <#salon>"
- }
- "listchan" {
- puthelp "privmsg $nick :\00314Commande Listchan Msg \0031: \0034/msg $::botnick listchan"
- }
- "addsuperop" {
- puthelp "privmsg $nick :\00314Commande Addsuperop Msg \0031: \0034/msg $::botnick addsuperop <pseudo>"
- }
- "delsuperop" {
- puthelp "privmsg $nick :\00314Commande Delsuperop Msg \0031: \0034/msg $::botnick delsuperop <pseudo>"
- }
- "infoline" {
- puthelp "privmsg $nick :\00314Commande Infoline Msg \0031: \0034/msg $::botnick infoline <#salon> <text>"
- }}}}
- putlog "$::GBversion chargé by $::auteur 2010©"
- # Elyia #
- bind join - "*" ::GB::xinfoline
- proc ::GB::xinfoline { nick uhost hand chan } {
- set info1 "Elyia"
- if {$nick=="$info1"} {
- putserv "PRIVMSG $chan :\2\[$info1\]\2 \0037if string match \0036*sex* return \00313/query coquine hello!\00313"
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement