Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #************************************#
- # Gestion.Bot V3. #
- # #
- # Système de NameSpace. #
- # Message en msgcat. #
- # Chan-Log. #
- # Anti-Flood commandes. #
- # Si le salon de log et en +c le bot #
- # annonce quand même sans couleurs. #
- # Nouveau système de blacklist. #
- # Gestion de fichier plus simple. #
- # Système d'auto-voice. #
- # Les TCL sont en plusieurs parties. #
- # Système de welcome unique pour #
- # Chaque salon prédéfini. #
- # Plus de flag utilisation de level. #
- # Version spécial que pour FaNaTiC. #
- #************************************#
- namespace eval ::gestion {
- # Avant toutes configuration ci dessous veuillez lire le fichier : introduction.txt CECI ET TRES IMPORTANT.
- # A combien désire tu mettre l'anti-flood commandes.
- # Activé l'Auto-Voice si oui mettez 1 sinon 0.
- # Nous vérifions si ya le package requis pour le msgcat.
- package require msgcat
- # Nous mettons la langue de msgcat en français.
- ::msgcat::mclocale fr
- # Version du TCL.
- variable script_name "\037\0034Gestion.Bot V3.0\037\0034"
- # Commandes chars Exemple "." ou "!" Ce qui donnera par exemple : .op/!op.
- variable cmdschar "!"
- # Nom de l'admin du bot.
- variable admin "alias_angelius"
- # Nom du salon de log du Robot.
- variable chanlog "#back-geeks"
- # Port PL.
- variable port "3535"
- # Levels des accès.
- # /!\ Veuillez ne pas modifié ceci merci. /!\
- # Admin
- set level(admin) "1000"
- # Owner
- set level(owner) "500"
- # Master
- set level(master) "300"
- # Opérateur
- set level(operateur) "200"
- # Les Procédures.
- # Procédure XTRA.
- proc [namespace current]::isauth {hand} {
- if {[getuser $hand XTRA AUTH] eq "OFF"} {return 0}
- if {[getuser $hand XTRA AUTH] eq "ON"} {return 1}
- }
- # Système d'authentification.
- proc auth {nick host hand arg} {
- variable chanlog
- variable port
- set arg [gbfilter $arg]
- set pseudo [lindex $arg 0]
- set chan [lindex $arg 2]
- set pass [lindex $arg 1]
- set args [split $arg]
- if {[llength $args] != 2} {
- putserv "notice $nick :[::msgcat::mc ErrorAuth $::botnick]"
- return 0
- }
- if {[nick2hand $pseudo] eq "*"} {
- putserv "notice $nick :[::msgcat::mc NoAxx $nick]"
- retrun 0
- }
- if {![passwdok $pseudo $pass]} {
- putserv "notice $nick :[::msgcat::mc ErrorPass]"
- return 0
- }
- if {![string match -nocase [lindex [getuser $pseudo HOSTS] 0] "$nick!$host"]} {
- putserv "notice $nick :[::msgcat::mc ErrorHost]"
- return 0
- }
- if {[getuser $pseudo XTRA AUTH] eq "ON"} {
- putserv "notice $nick :[::msgcat::mc ErrorDejaAuth]"
- return 0
- }
- if {[getuser $hand XTRA SUSPEND] eq "ON"} {
- putserv "notice $nick :[::msgcat::mc SuspendOn $nick]"
- return 0
- }
- puthelp "notice $nick :[::msgcat::mc Auth $nick]"
- puthelp "privmsg $chanlog :[::msgcat::mc AuthLog $hand]"
- puthelp "privmsg $chanlog :[::msgcat::mc ChanLog] [::msgcat::mc AxxPl $nick]"
- setuser $pseudo XTRA AUTH ON;
- setuser $hand XTRA SEEN [clock format [clock seconds] -format "le %d/%m/%Y à %Hh%M"]
- #chattr $hand +p
- save
- #listen $port users
- puthelp "privmsg $nick :\001DCC CHAT chat [myip] $port\001"
- return
- }
- # Procédure déauthentification.
- proc deauth { nick host hand arg } {
- variable chanlog
- set arg [gbfilter $arg]
- set args [split $arg]
- set pseudo [lindex $arg 0]
- set pass [lindex $args 1]
- if {[llength $args] != 2} {
- putserv "notice $nick :[::msgcat::mc ErrorDeauth $::botnick]"
- return 0
- }
- if {[nick2hand $pseudo] eq "*"} {
- putserv "notice $nick :[::msgcat::mc NoAxx $nick]"
- return 0
- }
- if {![passwdok $pseudo $pass]} {
- putserv "notice $nick :[::msgcat::mc ErrorPass]"
- return 0
- }
- if {[getuser $hand XTRA auth] eq "ON"} {
- putserv "notice $nick :[::msgcat::mc AuthOff $nick]"
- putserv "privmsg $chanlog :[::msgcat::mc DeauthLog $hand]"
- setuser $pseudo XTRA AUTH OFF;
- #chattr $hand -p
- save
- #boot $hand "Vous êtes déauthentifié,vous ne pouvez rester en Party-Line."
- return
- }
- }
- # Procédure Filter.
- proc gbfilter {x {y ""} } {
- for {set i 0} {$i < [string length $x]} {incr i} {
- switch -- [string index $x $i] {
- "\"" {append y "\\\""}
- "\\" {append y "\\\\"}
- "\[" {append y "\\\["}
- "\]" {append y "\\\]"}
- "\} " {append y "\\\} "}
- "\{" {append y "\\\{"}
- default {append y [string index $x $i]}
- }
- }
- return $y
- }
- # Procédure réinitialisation des accès du Bot.
- proc joindeauth {nick host hand chan} {
- variable chanlog
- if {$nick=="$::botnick"} {
- putserv "privmsg $chanlog :[::msgcat::mc DeauthJoin]"
- putserv "privmsg $chanlog :[::msgcat::mc DeauthJoin2]"
- foreach user [userlist * $chan] {
- setuser $user XTRA AUTH OFF
- #boot $user "Vous êtes déauthentifié,vous ne pouvez rester en Party-Line."
- }
- }
- }
- # Déauthentification au quit d'une personnes ayant un accès.
- proc quitdeauth { nick uhost hand chan {msg ""}} {
- variable chanlog
- if {[matchattr $hand o|o $chan] && [isauth $hand]} {
- setuser $hand XTRA AUTH OFF
- putserv "privmsg $chanlog :[::msgcat::mc DeauthQuit $hand]"
- }
- }
- # Listes des binds.
- bind msg - "auth" [namespace current]::auth
- bind msg - "deauth" [namespace current]::deauth
- bind join - "$::gestion::chanlog *" [namespace current]::joindeauth
- bind sign o|o "*" [namespace current]::quitdeauth
- # Désinstallation du Script.
- #if {[info commands ::gestion::uninstall] eq "::gestion::uninstall"} { ::gestion::uninstall }
- #proc uninstall {args} {
- #variable script_name
- #putlog "\0031Désallocation des ressources de\0031 $script_name"
- #foreach binding [lsearch -inline -all -regexp [binds *[set gestion [string range [namespace current] 2 end]]*] " \{?(::)?$gestion"] {
- #unbind [lindex $binding 0] [lindex $binding 1] [lindex $binding 2] [lindex $binding 4]
- #}
- #namespace delete [namespace current]
- #}
- putlog "\002Chargement\002 $script_name"
- }
Add Comment
Please, Sign In to add comment