[Résolu]caractere [ ] Non reconnus..
#1
Bonsoir,

Je post pour un soucis sur les [pseudo]..
Sujet bien aborder sur le forum..

J'ai regardez un peut les post et essayer de faire pareil.
Mais apparament sa ne veut pas avec moi.

Donc voici le soucis :
J'ai [test] en pseudo.
En pl je .+user [test]...

tout et Ok.
Lorsque je me auth j'ai ceci en message de l'eggdrop :

Citation :[21:09:16] -> *ShoW* auth [test] *******
[21:09:16] Notice ShoW ~¤~ Erreur ! Mot de pas incorrect veuillez tapez le bon mot de pass merci. ~¤~

En Pl le putlog :
Citation :[21:09:16] <ShoW> [21:09:26] [test]
[21:09:16] <ShoW> [21:09:26] [test]

sachant que le pass et le bon.. je penche sur un soucis niveau des [ ]
Voici le code tcl :

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"
    # 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]
    if {[nick2hand $pseudo] eq "*"} {
        putserv "notice $nick :[::msgcat::mc NoAxx $nick]"
        putlog "$pseudo"
        return 0
    }
    if {[passwdok $pseudo $pass]} {
        putserv "notice $nick :[::msgcat::mc ErrorPass]"
        putlog "$pseudo"
        return 0
    }
    if {![string match -nocase [lindex [getuser $pseudo HOSTS] 0] "$nick!$host"]} {
        putserv "notice $nick :[::msgcat::mc ErrorHost]"
        putlog "$nick!$host"
        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]
        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]"
        }
    }
    # 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"
}



Répondre Avertir
#2
Moi, j'inclinerais à penser que c'est un problème qui est dans passwdok. Mais comme on ne connait pas cette procédure, je ne peux pas en dire plus.

Ah si, je vais dire plus: si vous voulez de l'aide, mettez le script complet. Très souvent, un bug, c'est la vérité. Et elle est ailleurs.
Répondre
#3
passwdok c'est pour la vérifications des mot de pass mis dans l'eggdrop.

script complet ? il et complet manque juste les msgcat..

Les voici :

TCL
#******************************************#
# msgcat.tcl.                              #
# Tcl ou sont stocker les messages msgcat. #
#******************************************#
    ::msgcat::mcset fr ChanLog "\0031\[\0034Chan-Log\0031\]\0031"
    ::msgcat::mcset fr ErrorDejaAuth "\0034Erreur ! \037\0031Vous êtes déjà identifié.\037\0031"
    ::msgcat::mcset fr ErrorAuth "\0034Erreur ! \037\0031Veuillez tapez /msg %s auth <votre-pseudo> <votre-pass>\037\0031"
    ::msgcat::mcset fr ErrorSalon "\0034Erreur ! \037\0031Salon non valide veuillez mettre le bon salon merci.\037\0031"
    ::msgcat::mcset fr ErrorPseudo "\0034Erreur ! \037\0034Pseudo non correct veuillez mettre un pseudo valide merci.\037\0031"
    ::msgcat::mcset fr ErrorPass "\0034Erreur ! \037\0031Mot de pas incorrect veuillez tapez le bon mot de pass merci.\037\0031"
    ::msgcat::mcset fr ErrorHost "\0034Erreur ! \037\0031Host inconus."
    ::msgcat::mcset fr NoAxx "\0034Erreur ! \037\0031Vous n'avez aucun accèss %s.\037\0031"
    ::msgcat::mcset fr Auth "\0033Félicitations ! \037\0031Vous êtes maintenant identifié %s.\037\0031"
    ::msgcat::mcset fr AuthLog "\0031\[\0033Auth\0031\] \037\0031Effectué par\037 \0034%s\0034" 
    ::msgcat::mcset fr SaveLog "\0034Info ! \037\0031Sauvegarde des dossiers/fichiers effectuée.\037\0031"
    ::msgcat::mcset fr NoLevel "\0034Erreur ! \037\0031Votre Level et inférieur à la commande.\037\0031"
    ::msgcat::mcset fr SuspendOn "\0034Erreur ! \037\0031Votre accès et actuellement suspendu %s.\037\0031"
    ::msgcat::mcset fr AxxPl "\0033Autorisation ! \0034%s peut désormer entrée en PL.\0034"
    ::msgcat::mcset fr AuthOff "\0033Félicitations ! \037\0031Vous êtes maintenant déauthentifié %s."
    ::msgcat::mcset fr DeauthLog "\0031\[\0034Deauth\0031\] \037\0031Effectué par\037 \0034%s\0034"
    ::msgcat::mcset fr ErrorDeauth "\0034Erreur ! \037\0031Veuillez tapez /msg %s deauth <votre-pseudo> <votre-pass>\037\0031"
    ::msgcat::mcset fr DeauthJoin "\037\0031Réinitialisation des accès, tous les authentifiés ont été deauth par sécurité\037\0031"
    ::msgcat::mcset fr DeauthJoin2 "\0031\[\0034Version Spécialement faite pour FaNaTiC\0031\]\0031"
    ::msgcat::mcset fr DeauthQuit "\037\0031Déauthentification suite au quit de\037 \[\0034%s\0031\]\0031"
 
    putlog "\002Chargement\002 \037\0034msgcat.tcl\037\0034"


Répondre Avertir
#4
Oui, désolé, je suis un peu fatigué.
Bon, je pense que tu fais une petite erreur:
TCL
if {[passwdok $pseudo $pass]} {


Or, la doc tcl-commands dit bien:
Citation :passwdok <handle> <pass>
Description: checks the password given against the user's password.
Check against the password "" (a blank string) or "-" to find out
if a user has no password set.
Returns: 1 if the password matches for that user; 0 otherwise
Module: core
Tu n'envois pas le handle mais le nick.
Je corrigerais donc ton script en remplaçant:
TCL
if {[nick2hand $pseudo] eq "*"} {
        putserv "notice $nick :[::msgcat::mc NoAxx $nick]"
        putlog "$pseudo"
        return 0
    }
    if {[passwdok $pseudo $pass]} {


par:
TCL
set vhandle [nick2hand $pseudo]
if {$vhandle eq "*"} {
        putserv "notice $nick :[::msgcat::mc NoAxx $nick]"
        return 0
    }
    if {![passwdok $vhandle $pass]} {


Répondre
#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


Atteindre :


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