[Résolu]caractere [ ] Non reconnus..
#5
Sujet Résolu,

Suite à une discution avec CrazyCat,MenzAgitat via le relay.
RTFM.

Donc mes erreurs était stupide comme je faisait en gros du n'importe quoi.
compréhension du code et utile sinon ont se retrouve dans mon cas x)

Voici la version corrigé :

TCL
#************************************#
# 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"
    # 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
    # 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 args [split $arg]
    if {[llength $args] != 2} {
        putserv "notice $nick :[::msgcat::mc ErrorAuth $::botnick]"
        return 0
    }
    set pseudo [lindex $arg 0]
    putlog $pseudo
    set chan [lindex $args 2]
    set pass [lindex $args 1]
    set vhandle [nick2hand $pseudo]
    if {$vhandle eq "*"} {
        putserv "notice $nick :[::msgcat::mc NoAxx $nick]"
        return 0
    }
    if {![passwdok $vhandle $pass]} {
        putserv "notice $nick :[::msgcat::mc ErrorPass]"
        return 0
    }
    if {[string match -nocase [lindex [getuser $hand HOSTS] 0] $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 $hand 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]
        if {[llength $args] != 2} {
            putserv "notice $nick :[::msgcat::mc ErrorDeauth $::botnick]"
            return 0
        }
        set pseudo [gbfilter $arg]
        set pseudo [lindex $arg 0]
        set pass [lindex $args 1]
        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 {data} {
    regsub -all -- \\\\ $data \\\\\\\\ data
    regsub -all -- \\\[ $data \\\\\[ data
    regsub -all -- \\\] $data \\\\\] data
    regsub -all -- \\\} $data \\\\\} data
    regsub -all -- \\\{ $data \\\\\{ data
    regsub -all -- \\\" $data \\\\\" data
    regsub -all -- \\\' $data \\\\\' data
    return $data
    }
    # 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]"
        }
    }
    putlog "\002Chargement\002 $script_name"
}


Répondre Avertir


Messages dans ce sujet
RE: caractere [ ] Non reconnus.. - par CrazyCat - 02/10/2012, 21:57
RE: caractere [ ] Non reconnus.. - par CrazyCat - 02/10/2012, 22:26
RE: caractere [ ] Non reconnus.. - par aliasangelius - 03/10/2012, 00:12

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté