VDM.tcl qui publie toutes les X minutes
#1
Bonjour, je débute un peu dans le tcl...
J'aurais voulu savoir si c'est possible de lancer une VDM toutes les 20 minutes par exemple sur un salon... je pense qu'il faut mettre un timer... mais où ? that is the question ^^

Le code :
Code PHP :
###############################################
#                                               #
#             V i e D e M e r d e               #
#  v1.1 (12/03/2009) par Galdinx et MenzAgitat  #
#                                               #
#          http://www.boulets-roxx.com          #
#        IRC:  irc.teepi.net    #boulets        #
#              irc.epiknet.org  #boulets        #
#                                               #
#         Les scripts de MenzAgitat sont        #
#  téléchargeables sur  http://www.egghelp.org  #
#                   ou  http://www.eggdrop.fr   #
#                                               #
 ###############################################

#
# Description
# Script permettant d'afficher une citation au hasard pris sur le site 
# http://www.viedemerde.fr/ grâce a une commande publique, "!vdm" par exemple
#

#
# Changelog
#
# 1.0 - 1ère version
# 1.1 - Correction suite à un changement de payload du site + simplification des regsub
#

#
# LICENCE:
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#

if { [lindex [split $version1] < 1061800 } { putloglev o "\00304\002\[VDM - ERREUR\]\002\003 La version de votre eggdrop est \00304\002[lindex [split $version] 0]\002\003; vdm.tcl ne fonctionnera correctement que sur les eggdrops version 1.6.18 ou supérieure." ; return }
if { 
$tcl_version 8.4 } { putloglev o "\00304\002\[VDM - ERREUR\]\002\003 vdm.tcl nécessite que Tcl 8.4 (ou plus) soit installé pour fonctionner. Votre version actuelle de Tcl est \00304\002$tcl_version\002\003." ; return }
package require Tcl 8.4
if {[info commands vdm::uninstalleq "::vdm::uninstall"} { vdm::uninstall }

namespace eval 
vdm {



###########################
#          PARAMETRES      #
###########################

    # Chans sur lesquels le script sera actif (séparés par un espace)
    # Remarque : attention aux majuscules, le nom du chan est sensible à la casse
    
variable allowed_chans "#Accueil"
    
    
    
#### COMMANDES PUBLIQUES ET AUTORISATIONS
    
    # Commande utilisée pour afficher une citation
    # ex. : "!vdm"
    
variable vdmcmd "!vdm"
    
# autorisations pour la commande !vdm
    
variable vdmauth "-|-"
    
    
    
#### PARAMETRES DE L'ANTI-FLOOD
    
    # Anti-flood (0 = désactivé, 1 = activé)
    
variable antiflood 1
    
# Combien de commandes sont autorisées en combien de temps ?
    # exemple : "4:45" = 4 commandes maximum en 45 secondes;
    # les suivantes seront ignorées.
    
variable cmdflood_vdm "4:45"
    
# Intervalle de temps minimum entre l'affichage de 2 messages
    # avertissant que l'anti-flood a été déclenché (ne réglez pas
    # cette valeur trop bas afin de ne pas être floodé par les messages
    # d'avertissement de l'anti-flood...)
    
variable antiflood_msg_interval 20




####################################################################
#                                                                  #
# NE MODIFIEZ RIEN APRES CE CADRE SI VOUS NE CONNAISSEZ PAS LE TCL #
#                                                                  #
#   DO NOT MODIFY ANYTHING BELOW THIS BOX IF YOU DON'T KNOW TCL    #
#                                                                  #
####################################################################

    
variable scriptname "VieDeMerde"
    
variable version "1.1.20090312"
    
    
# inutilisé, conservé au cas où
    
variable cmdflood_global "5:120"
        
    
variable floodsettingsstring [split "global $cmdflood_global vdm $cmdflood_vdm"]
    
variable floodsettings ; array set floodsettings $floodsettingsstring
    variable instance 
; array set instance {}
    
variable antiflood_msg ; array set antiflood_msg {}
    
bind evnt prerehash [namespace current]::uninstall
    bind pub $vdmauth $vdmcmd 
[namespace current]::pub_disp_vdm
    proc uninstall 
{args} {
        
putlog "Désallocation des ressources de \002$vdm::scriptname...\002"
        
unbind evnt prerehash [namespace current]::uninstall
        
catch { unbind pub $vdm::vdmauth $vdm::vdmcmd [namespace current]::pub_disp_vdm }
        namespace 
delete ::vdm
    
}

}


proc vdm::pub_disp_vdm {nick host handle chan args} {
    if {[
lsearch -exact [split $vdm::allowed_chans$chan] != -1} {
        if {(
$vdm::antiflood == 1) && ([vdm::antiflood $chan "vdm"] == "flood")} { return }

        
set useragent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
        
set url "http://www.viedemerde.fr/aleatoire"
        
        
::http::config -useragent $useragent
        set token 
[::http::geturl "$url-timeout 6000]
        
        if {[::
http::status $token] == "ok"} {
            
regexp {<div class="post">(.+?)</p>} [::http::data $tokenres
            regsub 
{\n$res "" res
            regsub 
-all {<[^>]+>} $res "" res
            regsub 
{VDM$} $res "\002VDM\002" res
            set result 
[vdm::string_filter $res]
            
puthelp "privmsg $chan :$result"
        
} else {
            
puthelp "privmsg $chan :\00314La connexion à \002Vie de merde\002 n'a pu être établie. Peut-être le site rencontre-t-il des difficultés techniques. Veuillez réessayer plus tard.\003"
        
}
    }
}


##### Conversion des caractères html spéciaux et filtrage des balises HTML
proc vdm::string_filter str } {
    
set str [string map -nocase {
        
"&agrave;"            "à"        "&agrave;"            "à"        "&aacute;"            "á"        "&acirc;"            "â"
        "&atilde;"            "ã"        "&auml;"            "ä"        "&aring;"            "å"        "&aelig;"            "æ"
        "&ccedil;"            "ç"        "&egrave;"            "è"        "&eacute;"            "é"        "&ecirc;"            "ê"
        "&euml;"            "ë"        "&igrave;"            "ì"        "&iacute;"            "í"        "&icirc;"            "î"
        "&iuml;"            "ï"        "&eth;"                "ð"        "&ntilde;"            "ñ"        "&ograve;"            "ò"
        "&oacute;"            "ó"        "&ocirc;"            "ô"        "&otilde;"            "õ"        "&ouml;"            "ö"
        "&divide;"            "÷"        "&oslash;"            "ø"        "&ugrave;"            "ù"        "&uacute;"            "ú"
        "&ucirc;"            "û"        "&uuml;"            "ü"        "&yacute;"            "ý"        "&thorn;"            "þ"
        "&yuml;"            "ÿ"        "&quot;"            "\""    "&amp;"                "&"        "&euro;"            "€"
        "&oelig;"            "Å“"        "&Yuml;"            "Ÿ"        "&nbsp;"            " "        "&iexcl;"            "¡"
        "&cent;"            "¢"        "&pound;"            "£"        "&curren;"            "¤"        "&yen;"                "Â¥"
        "&brvbar;"            "¦"        "&brkbar;"            "¦"        "&sect;"            "§"        "&uml;"                "¨"
        "&die;"                "¨"        "&copy;"            "©"        "&ordf;"            "ª"        "&laquo;"            "«"
        "&not;"                "¬"        "&shy;"                "­-"    "&reg;"                "®"        "&macr;"            "¯"
        "&hibar;"            "¯"        "&deg;"                "°"        "&plusmn;"            "±"        "&sup2;"            "²"
        "&sup3;"            "³"        "&acute;"            "´"        "&micro;"            "µ"        "&para;"            "¶"
        "&middot;"            "·"        "&cedil;"            "¸"        "&sup1;"            "¹"        "&ordm;"            "º"
        "&raquo;"            "»"        "&frac14;"            "¼"        "&frac12;"            "½"        "&frac34;"            "¾"
        "&iquest;"            "¿"        "&Agrave;"            "À"        "&Aacute;"            "Á"        "&Acirc;"            "Â"
        "&Atilde;"            "Ã"        "&Auml;"            "Ä"        "&Aring;"            "Å"        "&AElig;"            "Æ"
        "&Ccedil;"            "Ç"        "&Egrave;"            "È"        "&Eacute;"            "É"        "&Ecirc;"            "Ê"
        "&Euml;"            "Ë"        "&Igrave;"            "í"        "&Iacute;"            "Í"        "&Icirc;"            "Î"
        "&Iuml;"            "Ï"        "&ETH;"                "Ð"        "&Dstrok;"            "Ð"        "&Ntilde;"            "Ñ"
        "&Ograve;"            "Ò"        "&Oacute;"            "Ó"        "&Ocirc;"            "Ô"        "&Otilde;"            "Õ"
        "&Ouml;"            "Ö"        "&times;"            "×"        "&Oslash;"            "Ø"        "&Ugrave;"            "Ù"
        "&Uacute;"            "Ê"        "&Ucirc;"            "Û"        "&Uuml;"            "í"        "&Yacute;"            "Ý"
        "&THORN;"            "Î"        "&szlig;"            "ß"        "\r"                ""        "\t"                ""
        "'"            "\'"    "'"                "\'"    "&gt;"                ">"        "&lt;"                "<"
        """                "
\'"    "&"                "&"        "#91;"                "\("    "\"                "\/"
        "]"                ")"        "{"            "("        "}"            ")"        "£"            "£"
        "¨"            "¨"        "©"            "©"        "«"            "«"        "­"            "­"
        "®"            "®"        "´"            "´"        "·"            "·"        "¹"            "¹"
        "»"            "»"        "¼"            "¼"        "½"            "½"        "¾"            "¾"
        "À"            "À"        "Á"            "Á"        "Â"            "Â"        "Ã"            "Ã"
        "Ä"            "Ä"        "Å"            "Å"        "Æ"            "Æ"        "Ç"            "Ç"
        "È"            "È"        "É"            "É"        "Ê"            "Ê"        "Ë"            "Ë"
        "í"            "í"        "Í"            "Í"        "Î"            "Î"        "Ï"            "Ï"
        "Ð"            "Ð"        "Ñ"            "Ñ"        "Ò"            "Ò"        "Ó"            "Ó"
        "Ô"            "Ô"        "Õ"            "Õ"        "Ö"            "Ö"        "×"            "×"
        "Ø"            "Ø"        "Ù"            "Ù"        "Ê"            "Ê"        "Û"            "Û"
        "í"            "í"        "Ý"            "Ý"        "Î"            "Î"        "ß"            "ß"
        "à"            "à"        "á"            "á"        "â"            "â"        "ã"            "ã"
        "ä"            "ä"        "å"            "å"        "æ"            "æ"        "ç"            "ç"
        "è"            "è"        "é"            "é"        "ê"            "ê"        "ë"            "ë"
        "ì"            "ì"        "í"            "í"        "î"            "î"        "ï"            "ï"
        "ð"            "ð"        "ñ"            "ñ"        "ò"            "ò"        "ó"            "ó"
        "ô"            "ô"        "õ"            "õ"        "ö"            "ö"        "÷"            "÷"
        "ø"            "ø"        "ù"            "ù"        "ú"            "ú"        "û"            "û"
        "ü"            "ü"        "ý"            "ý"        "þ"            "þ"        
        
    } $str]
    regsub -all "<br />" $str " " str
     set str [encoding convertfrom "utf-8" $str ]
    return "${str}"
}


proc vdm::antiflood {chan type} {
    variable antiflood_msg
    if {![info exists antiflood_msg($chan$type)]} { set antiflood_msg($chan$type) 0 }
    variable instance
    if {![info exists instance($chan$type)]} { set instance($chan$type) 0 }
    set max_instances [lindex [split $vdm::floodsettings($type) ":"] 0]
    set instance_length [lindex [split $vdm::floodsettings($type) ":"] 1]
    if { $instance($chan$type) >= $max_instances } {
        if { $antiflood_msg($chan$type) == 0 } {
            set antiflood_msg($chan$type) 1
            if {$type != "global"} {
                putquick "privmsg $chan :\0037:::\00314 Contrôle de flood activé pour la commande \002!$type\002 : pas plus de $max_instances requête(s) toutes les $instance_length secondes.\003"
            } else {
                putquick "privmsg $chan :\0037:::\00314 Contrôle de flood sur les commandes de \002Vie De Merde\002 : pas plus de $max_instances commandes toutes les $instance_length secondes.\003"
            }
            utimer $vdm::antiflood_msg_interval "vdm::antiflood_msg_reset $chan $type"
        }
        return "flood"
    } else {
        incr instance($chan$type)
        utimer $instance_length "vdm::antiflood_close_instance $chan $type"
        return "no flood"
    }
}

proc vdm::antiflood_close_instance {chan type} {
    variable instance
    if { $instance($chan$type) > 0 } { incr instance($chan$type) -1 }
}

proc vdm::antiflood_msg_reset {chan type} {
    variable antiflood_msg
    set antiflood_msg($chan$type) 0
}


putlog "\002*$vdm::scriptname v$vdm::version*\002 par Galdinx et MenzAgitat ( \037\00312http://www.boulets-roxx.com\003\037 ) a été chargé." 

Merci par avance de votre aide.
Répondre Avertir
#2
Il y a pas mal d'exemples sur ce forum pour les timers. Jette un oeil sur ce post par exemple.
Répondre
#3
J'ai compris le concept mais je ne vois pas où placer le timer.
Répondre Avertir
#4
A mon avis il faut le placer en dehors, faire un truc a part quoi.

Genre,
- Rajouter un paramètre pour la procédure pub pour ne pas prendre en compte l'antiflood, en modifiant les lignes suivantes :
TCL
proc vdm::pub_disp_vdm {pantiflood nick host handle chan args} {


TCL
if {!$pantiflood && ($vdm::antiflood == 1) && ([vdm::antiflood $chan "vdm"] == "flood")} { return }


TCL
bind pub $vdmauth $vdmcmd {vdm::pub_disp_vdm 0}


TCL
catch { unbind pub $vdm::vdmauth $vdm::vdmcmd {vdm::pub_disp_vdm 0}}



- Faire une proc à l'arrache à côté pour s'occuper de l'annonce :
TCL
utimer <TEMPS> vdm::timerAnnounce
proc ::vdm::timerAnnounce {} {
vdm::pub_disp_vdm 0 - - - <CHAN>
utimer <TEMPS> vdm::timerAnnounce


}
Répondre Avertir
#5
Merci de la réponse, alors voici la tcl modifiée :

Code PHP :
###############################################
#                                               #
#             V i e D e M e r d e               #
#  v1.1 (12/03/2009) par Galdinx et MenzAgitat  #
#                                               #
#          http://www.boulets-roxx.com          #
#        IRC:  irc.teepi.net    #boulets        #
#              irc.epiknet.org  #boulets        #
#                                               #
#         Les scripts de MenzAgitat sont        #
#  téléchargeables sur  http://www.egghelp.org  #
#                   ou  http://www.eggdrop.fr   #
#                                               #
 ###############################################

#
# Description
# Script permettant d'afficher une citation au hasard pris sur le site 
# http://www.viedemerde.fr/ grâce a une commande publique, "!vdm" par exemple
#

#
# Changelog
#
# 1.0 - 1ère version
# 1.1 - Correction suite à un changement de payload du site + simplification des regsub
#

#
# LICENCE:
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#

if { [lindex [split $version1] < 1061800 } { putloglev o "\00304\002\[VDM - ERREUR\]\002\003 La version de votre eggdrop est \00304\002[lindex [split 

$version] 0]\002\003; vdm.tcl ne fonctionnera correctement que sur les eggdrops version 1.6.18 ou supérieure." ; return }
if { 
$tcl_version 8.4 } { putloglev o "\00304\002\[VDM - ERREUR\]\002\003 vdm.tcl nécessite que Tcl 8.4 (ou plus) soit installé pour fonctionner. Votre 

version actuelle de Tcl est \00304\002
$tcl_version\002\003." ; return }
package require Tcl 8.4
if {[info commands vdm::uninstalleq "::vdm::uninstall"} { vdm::uninstall }

namespace eval 
vdm {



###########################
#          PARAMETRES      #
###########################

    # Chans sur lesquels le script sera actif (séparés par un espace)
    # Remarque : attention aux majuscules, le nom du chan est sensible à la casse
    
variable allowed_chans "#Accueil"
    
    
    
#### COMMANDES PUBLIQUES ET AUTORISATIONS
    
    # Commande utilisée pour afficher une citation
    # ex. : "!vdm"
    
variable vdmcmd "!vdm"
    
# autorisations pour la commande !vdm
    
variable vdmauth "-|-"
    
    
    
#### PARAMETRES DE L'ANTI-FLOOD
    
    # Anti-flood (0 = désactivé, 1 = activé)
    
variable antiflood 1
    
# Combien de commandes sont autorisées en combien de temps ?
    # exemple : "4:45" = 4 commandes maximum en 45 secondes;
    # les suivantes seront ignorées.
    
variable cmdflood_vdm "4:45"
    
# Intervalle de temps minimum entre l'affichage de 2 messages
    # avertissant que l'anti-flood a été déclenché (ne réglez pas
    # cette valeur trop bas afin de ne pas être floodé par les messages
    # d'avertissement de l'anti-flood...)
    
variable antiflood_msg_interval 20




####################################################################
#                                                                  #
# NE MODIFIEZ RIEN APRES CE CADRE SI VOUS NE CONNAISSEZ PAS LE TCL #
#                                                                  #
#   DO NOT MODIFY ANYTHING BELOW THIS BOX IF YOU DON'T KNOW TCL    #
#                                                                  #
####################################################################

        
utimer 10 vdm::timerAnnounce
        proc 
::vdm::timerAnnounce {} {
        
vdm::pub_disp_vdm 0 - - - <CHAN>
        
utimer 10 vdm::timerAnnounce

    variable scriptname 
"VieDeMerde"
    
variable version "1.1.20090312"
    
    
# inutilisé, conservé au cas où
    
variable cmdflood_global "5:120"
        
    
variable floodsettingsstring [split "global $cmdflood_global vdm $cmdflood_vdm"]
    
variable floodsettings ; array set floodsettings $floodsettingsstring
    variable instance 
; array set instance {}
    
variable antiflood_msg ; array set antiflood_msg {}
    
bind evnt prerehash [namespace current]::uninstall
    bind pub $vdmauth $vdmcmd 
{vdm::pub_disp_vdm 0}
    
proc uninstall {args} {
        
putlog "Désallocation des ressources de \002$vdm::scriptname...\002"
        
unbind evnt prerehash [namespace current]::uninstall
        
catch { unbind pub $vdm::vdmauth $vdm::vdmcmd {vdm::pub_disp_vdm 0}}
        namespace 
delete ::vdm
    
}

}


proc vdm::pub_disp_vdm {pantiflood nick host handle chan args} {
    if {[
lsearch -exact [split $vdm::allowed_chans$chan] != -1} {
        if {!
$pantiflood && ($vdm::antiflood == 1) && ([vdm::antiflood $chan "vdm"] == "flood")} { return }

        
set useragent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
        
set url "http://www.viedemerde.fr/aleatoire"
        
        
::http::config -useragent $useragent
        set token 
[::http::geturl "$url-timeout 6000]
        
        if {[::
http::status $token] == "ok"} {
            
regexp {<div class="post">(.+?)</p>} [::http::data $tokenres
            regsub 
{\n$res "" res
            regsub 
-all {<[^>]+>} $res "" res
            regsub 
{VDM$} $res "\002VDM\002" res
            set result 
[vdm::string_filter $res]
            
puthelp "privmsg $chan :$result"
        
} else {
            
puthelp "privmsg $chan :\00314La connexion à \002Vie de merde\002 n'a pu être établie. Peut-être le site rencontre-t-il des 

difficultés techniques. Veuillez réessayer plus tard.\003"
        
}
    }
}


##### Conversion des caractères html spéciaux et filtrage des balises HTML
proc vdm::string_filter str } {
    
set str [string map -nocase {
        
"&agrave;"            "à"        "&agrave;"            "à"        "&aacute;"            "á"        

"&acirc;"            "â"
        "&atilde;"            "ã"        "&auml;"            "ä"        "&aring;"            "å"        

"&aelig;"            "æ"
        "&ccedil;"            "ç"        "&egrave;"            "è"        "&eacute;"            "é"        

"&ecirc;"            "ê"
        "&euml;"            "ë"        "&igrave;"            "ì"        "&iacute;"            "í"        

"&icirc;"            "î"
        "&iuml;"            "ï"        "&eth;"                "ð"        "&ntilde;"            "ñ"        

"&ograve;"            "ò"
        "&oacute;"            "ó"        "&ocirc;"            "ô"        "&otilde;"            "õ"        

"&ouml;"            "ö"
        "&divide;"            "÷"        "&oslash;"            "ø"        "&ugrave;"            "ù"        

"&uacute;"            "ú"
        "&ucirc;"            "û"        "&uuml;"            "ü"        "&yacute;"            "ý"        

"&thorn;"            "þ"
        "&yuml;"            "ÿ"        "&quot;"            "\""    "&amp;"                "&"        

"&euro;"            "€"
        "&oelig;"            "Å“"        "&Yuml;"            "Ÿ"        "&nbsp;"            " "        

"&iexcl;"            "¡"
        "&cent;"            "¢"        "&pound;"            "£"        "&curren;"            "¤"        

"&yen;"                "Â¥"
        "&brvbar;"            "¦"        "&brkbar;"            "¦"        "&sect;"            "§"        

"&uml;"                "¨"
        "&die;"                "¨"        "&copy;"            "©"        "&ordf;"            "ª"        

"&laquo;"            "«"
        "&not;"                "¬"        "&shy;"                "­-"    "&reg;"                "®"        

"&macr;"            "¯"
        "&hibar;"            "¯"        "&deg;"                "°"        "&plusmn;"            "±"        

"&sup2;"            "²"
        "&sup3;"            "³"        "&acute;"            "´"        "&micro;"            "µ"        

"&para;"            "¶"
        "&middot;"            "·"        "&cedil;"            "¸"        "&sup1;"            "¹"        

"&ordm;"            "º"
        "&raquo;"            "»"        "&frac14;"            "¼"        "&frac12;"            "½"        

"&frac34;"            "¾"
        "&iquest;"            "¿"        "&Agrave;"            "À"        "&Aacute;"            "Á"        

"&Acirc;"            "Â"
        "&Atilde;"            "Ã"        "&Auml;"            "Ä"        "&Aring;"            "Å"        

"&AElig;"            "Æ"
        "&Ccedil;"            "Ç"        "&Egrave;"            "È"        "&Eacute;"            "É"        

"&Ecirc;"            "Ê"
        "&Euml;"            "Ë"        "&Igrave;"            "í"        "&Iacute;"            "Í"        

"&Icirc;"            "Î"
        "&Iuml;"            "Ï"        "&ETH;"                "Ð"        "&Dstrok;"            "Ð"        

"&Ntilde;"            "Ñ"
        "&Ograve;"            "Ò"        "&Oacute;"            "Ó"        "&Ocirc;"            "Ô"        

"&Otilde;"            "Õ"
        "&Ouml;"            "Ö"        "&times;"            "×"        "&Oslash;"            "Ø"        

"&Ugrave;"            "Ù"
        "&Uacute;"            "Ê"        "&Ucirc;"            "Û"        "&Uuml;"            "í"        

"&Yacute;"            "Ý"
        "&THORN;"            "Î"        "&szlig;"            "ß"        "\r"                ""        

"\t"                ""
        "'"            "\'"    "'"                "\'"    "&gt;"                ">"        "&lt;"        

        "<"
        """                "\'"    "&"                "&"        "#91;"                "\("    "\"        

        "\/"
        "]"                ")"        "{"            "("        "}"            ")"        

"£"            "£"
        "¨"            "¨"        "©"            "©"        "«"            "«"        

"­"            "­"
        "®"            "®"        "´"            "´"        "·"            "·"        

"¹"            "¹"
        "»"            "»"        "¼"            "¼"        "½"            "½"        

"¾"            "¾"
        "À"            "À"        "Á"            "Á"        "Â"            "Â"        

"Ã"            "Ã"
        "Ä"            "Ä"        "Å"            "Å"        "Æ"            "Æ"        

"Ç"            "Ç"
        "È"            "È"        "É"            "É"        "Ê"            "Ê"        

"Ë"            "Ë"
        "Ì"            "í"        "Í"            "Í"        "Î"            "Î"        

"Ï"            "Ï"
        "Ð"            "Ð"        "Ñ"            "Ñ"        "Ò"            "Ò"        

"Ó"            "Ó"
        "Ô"            "Ô"        "Õ"            "Õ"        "Ö"            "Ö"        

"×"            "×"
        "Ø"            "Ø"        "Ù"            "Ù"        "Ú"            "Ê"        

"Û"            "Û"
        "Ü"            "í"        "Ý"            "Ý"        "Þ"            "Î"        

"ß"            "ß"
        "à"            "à"        "á"            "á"        "â"            "â"        

"ã"            "ã"
        "ä"            "ä"        "å"            "å"        "æ"            "æ"        

"ç"            "ç"
        "è"            "è"        "é"            "é"        "ê"            "ê"        

"ë"            "ë"
        "ì"            "ì"        "í"            "í"        "î"            "î"        

"ï"            "ï"
        "ð"            "ð"        "ñ"            "ñ"        "ò"            "ò"        

"ó"            "ó"
        "ô"            "ô"        "õ"            "õ"        "ö"            "ö"        

"÷"            "÷"
        "ø"            "ø"        "ù"            "ù"        "ú"            "ú"        

"û"            "û"
        "ü"            "ü"        "ý"            "ý"        "þ"            "þ"        
        
    
$str]
    
regsub -all "<br />" $str " " str
     set str 
[encoding convertfrom "utf-8" $str ]
    return 
"${str}"
}


proc vdm::antiflood {chan type} {
    
variable antiflood_msg
    
if {![info exists antiflood_msg($chan$type)]} { set antiflood_msg($chan$type}
    
variable instance
    
if {![info exists instance($chan$type)]} { set instance($chan$type}
    
set max_instances [lindex [split $vdm::floodsettings($type":"0]
    
set instance_length [lindex [split $vdm::floodsettings($type":"1]
    if { 
$instance($chan$type) >= $max_instances } {
        if { 
$antiflood_msg($chan$type) == } {
            
set antiflood_msg($chan$type1
            
if {$type != "global"} {
                
putquick "privmsg $chan :\0037:::\00314 Contrôle de flood activé pour la commande \002!$type\002 : pas plus de 

$max_instances requête(s) toutes les $instance_length secondes.\003"
            
} else {
                
putquick "privmsg $chan :\0037:::\00314 Contrôle de flood sur les commandes de \002Vie De Merde\002 : pas plus de 

$max_instances commandes toutes les $instance_length secondes.\003"
            
}
            
utimer $vdm::antiflood_msg_interval "vdm::antiflood_msg_reset $chan $type"
        
}
        return 
"flood"
    
} else {
        
incr instance($chan$type)
        
utimer $instance_length "vdm::antiflood_close_instance $chan $type"
        
return "no flood"
    
}
}

proc vdm::antiflood_close_instance {chan type} {
    
variable instance
    
if { $instance($chan$type) > } { incr instance($chan$type) -}
}

proc vdm::antiflood_msg_reset {chan type} {
    
variable antiflood_msg
    set antiflood_msg
($chan$type0
}



putlog "\002*$vdm::scriptname v$vdm::version*\002 par Galdinx et MenzAgitat ( \037\00312http://www.boulets-roxx.com\003\037 ) a été chargé." 

Après le rehash, j'ai cette erreur :

Code PHP :
[08:48:07] <athena> [08:48missing close-brace
[08:48:07] <athena>     while executing
[08:48:07] <athena"namespace eval vdm {
[08:48:07] <athena> 
[08:48:07] <athena> 
[08:48:07] <athena> 
[08:48:07] <athena> ###########################
[08:48:07] <athena> #  PARAMETRES      #
[08:48:07] <athena> ###########################
[08:48:07] <athena> 
[08:48:07] <athena> # Chans sur lesquels le script sera actif (s..."
[08:48:07] <athena>     (file "TCL/vdm.tcl" line 47)
[
08:48:07] <athena>     invoked from within
[08:48:07] <athena"source TCL/vdm.tcl"
[08:48:07] <athena>     (file "eggdrop.conf" line 118)
[
08:48:07] <athena> [08:48] * FICHIER DE CONFIGURATION NON CHARGE (INTROUVABLE OU ERREUR)
-
Session DCC fermée 
Répondre Avertir
#6
bonjour,

pour le VDM,j'avais fait ceci pour qui affiche une citation toutes les 10mn

TCL
bind time -|- {?0 *} ::AutoMsgVdm
 
proc ::AutoMsgVdm {mn h args} {
global botnick
 
foreach chan $vdm::allowed_chans {
 
		set useragent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
		set url "http://www.viedemerde.fr/aleatoire"
 
		::http::config -useragent $useragent
		set token [::http::geturl "$url" -timeout 6000]
 
		if {[::http::status $token] == "ok"} {
			regexp {<div class="post">(.+?)</p>} [::http::data $token] res
			regsub {<div class="post"><p>} $res "" res
			regsub "<img src=\"http://cdn.betacie.com/viedemerde/images/new.png\" align=\"absmiddle\" /> " $res "" res
			regsub {</p>} $res "" res
			regsub {\n} $res "" res
			regsub -all {<a href="[^\ ]+" class="lienvdm">} $res "" res
            regsub -all {</a>} $res "" res
			regsub {VDM$} $res "\002VDM\002" res
			set result [vdm::string_filter $res]
			puthelp "privmsg $chan :(\002Vie De Merde\002) $result"
		} else {
			puthelp "privmsg $chan :\00314La connexion à \002Vie de merde\002 n'a pu être établie. Peut-être le site rencontre-t-il des difficultés techniques. Veuillez réessayer plus tard.\003"
		}
	}
  }



Cordialement DnS
[font=Times New Roman]La différence entre Linux et Windows ,c'est que Linux c'est comme une belle fille , il faut l'apprivoiser , la comprendre , la séduire tandis que Windows , c'est comme une prostitué , il faut payer et surtout bien se protéger.[/font]
Répondre Avertir
#7
Merci de cette réponse rapide, je ne met que ceci dans la tcl ?
Répondre Avertir
#8
oui tu l'ajoute dans le TCL puis tu rehash ton bot et enjoy lol.

Cordialement
[font=Times New Roman]La différence entre Linux et Windows ,c'est que Linux c'est comme une belle fille , il faut l'apprivoiser , la comprendre , la séduire tandis que Windows , c'est comme une prostitué , il faut payer et surtout bien se protéger.[/font]
Répondre Avertir
#9
Après avoir mis :

Code PHP :
bind time -|- {?*} ::AutoMsgVdm
 
proc 
::AutoMsgVdm {mn h args} {
global 
botnick
 
foreach chan $vdm::allowed_chans {
 
      
set useragent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
      
set url "http://www.viedemerde.fr/aleatoire"
      
      
::http::config -useragent $useragent
      set token 
[::http::geturl "$url-timeout 6000]
      
      if {[::
http::status $token] == "ok"} {
         
regexp {<div class="post">(.+?)</p>} [::http::data $tokenres
         regsub 
{<div class="post"><p>} $res "" res
         regsub 
"<img src=\"http://cdn.betacie.com/viedemerde/images/new.png\" align=\"absmiddle\" /> " $res "" res
         regsub 
{</p>} $res "" res
         regsub 
{&#92;n} $res "" res
         
regsub -all {<a href="[^\ ]+" class="lienvdm">} $res "" res
            regsub 
-all {</a>} $res "" res
         regsub 
{VDM$} $res "\002VDM\002" res
         set result 
[vdm::string_filter $res]
         
puthelp "privmsg $chan :(\002Vie De Merde\002) $result"
      
} else {
         
puthelp "privmsg $chan :\00314La connexion à \002Vie de merde\002 n'a pu être établie. Peut-être le site rencontre-t-il des difficultés techniques. Veuillez réessayer plus tard.\003"
      
}
   }
  } 

J'ai cette erreur en pl :

Code PHP :
[11:49:56] <AtHeNa> [11:50Tcl error [::AutoMsgVdm]: extra characters after close-quote 
Répondre Avertir
#10
normal ces parceue tu a cela:
Citation :regsub {\n} $res "" res
[font=Times New Roman]La différence entre Linux et Windows ,c'est que Linux c'est comme une belle fille , il faut l'apprivoiser , la comprendre , la séduire tandis que Windows , c'est comme une prostitué , il faut payer et surtout bien se protéger.[/font]
Répondre Avertir
#11
Je rajoute cette ligne ? car j'ai essayé, mais rien ne se passe maintenant.
Répondre Avertir
#12
Code PHP :
bind time -|- {** * * *} ::AutoMsgVdm

proc 
::AutoMsgVdm {min hour args} {
global 
botnick

foreach chan $vdm::allowed_chans {

        
set useragent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
        
set url "http://www.viedemerde.fr/aleatoire"
        
        
::http::config -useragent $useragent
        set token 
[::http::geturl "$url-timeout 6000]
        
        if {[::
http::status $token] == "ok"} {
            
regexp {<div class="post">(.+?)</p>} [::http::data $tokenres
            regsub 
{<div class="post"><p>} $res "" res
            regsub 
"<img src=\"http://cdn.betacie.com/viedemerde/images/new.png\" align=\"absmiddle\" /> " $res "" res
            regsub 
{</p>} $res "" res
            regsub 
{\n$res "" res
            regsub 
-all {<a href="[^\ ]+" class="lienvdm">} $res "" res
            regsub 
-all {</a>} $res "" res
            regsub 
{VDM$} $res "\002VDM\002" res
            set result 
[vdm::string_filter $res]
            
puthelp "privmsg $chan :(\002Vie De Merde\002) $result"
        
} else {
            
puthelp "privmsg $chan :\00314La connexion à \002Vie de merde\002 n'a pu être établie. Peut-être le site rencontre-t-il des difficultés techniques. Veuillez réessayer plus tard.\003"
        
}
    }
  } 

Cordialement DnS
[font=Times New Roman]La différence entre Linux et Windows ,c'est que Linux c'est comme une belle fille , il faut l'apprivoiser , la comprendre , la séduire tandis que Windows , c'est comme une prostitué , il faut payer et surtout bien se protéger.[/font]
Répondre Avertir
#13
Super fedora, ça marche bien, seulement, quand mon eggdrop parle sur le salon ça fait ceci :

[09:31:42] <@AtHeNa> (Vie De Merde) <a href="/amour/1104918" class="lievdm">Aujourd'hui, je montre fièrement à mon copain le système que j'ai inventé pour trier mes cours. Tout ce qu'il a trouvé à me dire, c'est : "C'est ça que j'adore chez toi. T'as l'air vraiment con mais, des fois, t'as des petits pics d'intelligence. On sait pas d'où ils viennent, mais ça arrive..." VDM
Répondre Avertir
#14
faut rajouter un regsub dans le code alors

regsub {^<a href=.+?>} $res "" res
Répondre Avertir
#15
moi sa me donne sa Surprised !


Eggdrop v1.6.19 © 1997 Robey Pointer © 2008 Eggheads
[05:04] --- Loading eggdrop v1.6.19 (Sat May 15 2010)
[05:04] Module loaded: dns
[05:04] Module loaded: channels
[05:04] Module loaded: server
[05:04] Module loaded: ctcp
[05:04] Module loaded: irc
[05:04] Module loaded: console (with lang support)
[05:04] Module loaded: blowfish
[05:04] Listening at telnet port 3339 (all).
[05:04] Oper by Dragon061 à bien étais ajouter à votre EggDrop
[05:04] Tcl error in file 'eggdrop.conf':
[05:04] can't read "vdm::scriptname": no such variable
while executing
"putlog "\002*$vdm::scriptname v$vdm::version*\002 par Galdinx et MenzAgitat ( \037\00312http://www.boulets-roxx.com\003\037 ) a été chargé." "
(file "scripts/animation.tcl" line 484)
invoked from within
"source scripts/animation.tcl"
(file "eggdrop.conf" line 99)
[05:04] * FICHIER DE CONFIGURATION NON CHARGE (INTROUVABLE OU ERREUR)


et regarde le code que j'ai ajouté
TCL
########################
##### VIE DE MERDE #####
########################

 
###############################################
#                                               #
#             V i e D e M e r d e               #
#  v1.1 (12/03/2009) par Galdinx et MenzAgitat  #
#                                               #
#          http://www.boulets-roxx.com          #
#        IRC:  irc.teepi.net    #boulets        #
#              irc.epiknet.org  #boulets        #
#                                               #
#         Les scripts de MenzAgitat sont        #
#  téléchargeables sur  http://www.egghelp.org  #
#                   ou  http://www.eggdrop.fr   #
#                                               #
 ###############################################

#
# Description
# Script permettant d'afficher une citation au hasard pris sur le site 
# http://www.viedemerde.fr/ grâce a une commande publique, "!vdm" par exemple
#

#
# Changelog
#
# 1.0 - 1ère version
# 1.1 - Correction suite à un changement de payload du site + simplification des regsub
#

#
# LICENCE:
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
 
if { [lindex [split $version] 1] < 1061800 } { putloglev o * "\00304\002\[VDM - ERREUR\]\002\003 La version de votre eggdrop est \00304\002[lindex [split 
 
$version] 0]\002\003; vdm.tcl ne fonctionnera correctement que sur les eggdrops version 1.6.18 ou supérieure." ; return }
if { $tcl_version < 8.4 } { putloglev o * "\00304\002\[VDM - ERREUR\]\002\003 vdm.tcl nécessite que Tcl 8.4 (ou plus) soit installé pour fonctionner. Votre 
 
version actuelle de Tcl est \00304\002$tcl_version\002\003." ; return }
package require Tcl 8.4
if {[info commands vdm::uninstall] eq "::vdm::uninstall"} { vdm::uninstall }
 
namespace eval vdm {
 
 
 
###########################
#          PARAMETRES      #
###########################

    # Chans sur lesquels le script sera actif (séparés par un espace)
    # Remarque : attention aux majuscules, le nom du chan est sensible à la casse
    variable allowed_chans "#Accueil"
    
 
    #### COMMANDES PUBLIQUES ET AUTORISATIONS
    
    # Commande utilisée pour afficher une citation
    # ex. : "!vdm"
    variable vdmcmd "!vdm"
    # autorisations pour la commande !vdm
    variable vdmauth "-|-"
    
 
    #### PARAMETRES DE L'ANTI-FLOOD
    
    # Anti-flood (0 = désactivé, 1 = activé)
    variable antiflood 1
    # Combien de commandes sont autorisées en combien de temps ?
    # exemple : "4:45" = 4 commandes maximum en 45 secondes;
    # les suivantes seront ignorées.
    variable cmdflood_vdm "4:45"
    # Intervalle de temps minimum entre l'affichage de 2 messages
    # avertissant que l'anti-flood a été déclenché (ne réglez pas
    # cette valeur trop bas afin de ne pas être floodé par les messages
    # d'avertissement de l'anti-flood...)
    variable antiflood_msg_interval 20

 
 
 
####################################################################
#                                                                  #
# NE MODIFIEZ RIEN APRES CE CADRE SI VOUS NE CONNAISSEZ PAS LE TCL #
#                                                                  #
#   DO NOT MODIFY ANYTHING BELOW THIS BOX IF YOU DON'T KNOW TCL    #
#                                                                  #
####################################################################
 
        utimer 10 vdm::timerAnnounce
        proc ::vdm::timerAnnounce {} {
        vdm::pub_disp_vdm 0 - - - <CHAN>
        utimer 10 vdm::timerAnnounce
 
    variable scriptname "VieDeMerde"
    variable version "1.1.20090312"
    
    # inutilisé, conservé au cas où
    variable cmdflood_global "5:120"
 
    variable floodsettingsstring [split "global $cmdflood_global vdm $cmdflood_vdm"]
    variable floodsettings ; array set floodsettings $floodsettingsstring
    variable instance ; array set instance {}
    variable antiflood_msg ; array set antiflood_msg {}
    bind evnt - prerehash [namespace current]::uninstall
    bind pub $vdmauth $vdmcmd {vdm::pub_disp_vdm 0}
    proc uninstall {args} {
        putlog "Désallocation des ressources de \002$vdm::scriptname...\002"
        unbind evnt - prerehash [namespace current]::uninstall
        catch { unbind pub $vdm::vdmauth $vdm::vdmcmd {vdm::pub_disp_vdm 0}}
        namespace delete ::vdm
    }
 
}
 
 
bind time -|- {*0 * * * *} ::AutoMsgVdm
 
proc ::AutoMsgVdm {min hour args} {
global botnick
 
foreach chan $vdm::allowed_chans {
 
        set useragent "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"
        set url "http://www.viedemerde.fr/aleatoire"
 
        ::http::config -useragent $useragent
        set token [::http::geturl "$url" -timeout 6000]
 
        if {[::http::status $token] == "ok"} {
            regexp {<div class="post">(.+?)</p>} [::http::data $token] res
            regsub {<div class="post"><p>} $res "" res
            regsub "<img src=\"http://cdn.betacie.com/viedemerde/images/new.png\" align=\"absmiddle\" /> " $res "" res
            regsub {</p>} $res "" res
            regsub {n} $res "" res
            regsub -all {<a href="[^\ ]+" class="lienvdm">} $res "" res
            regsub -all {</a>} $res "" res
            regsub {VDM$} $res "\002VDM\002" res
            regsub {^<a href=.+?>} $res "" res
            set result [vdm::string_filter $res]
            puthelp "privmsg $chan :(\002Vie De Merde\002) $result"
        } else {
            puthelp "privmsg $chan :\00314La connexion à \002Vie de merde\002 n'a pu être établie. Peut-être le site rencontre-t-il des difficultés techniques. Veuillez réessayer plus tard.\003"
        }
    }
  } 
} 

##### Conversion des caractères html spéciaux et filtrage des balises HTML
proc vdm::string_filter { str } {
    set str [string map -nocase {
        "&agrave;"            "à"        "&agrave;"            "à"        "&aacute;"            "á"        
 
"&acirc;"            "â"
        "&atilde;"            "ã"        "&auml;"            "ä"        "&aring;"            "å"        
 
"&aelig;"            "æ"
        "&ccedil;"            "ç"        "&egrave;"            "è"        "&eacute;"            "é"        
 
"&ecirc;"            "ê"
        "&euml;"            "ë"        "&igrave;"            "ì"        "&iacute;"            "í"        
 
"&icirc;"            "î"
        "&iuml;"            "ï"        "&eth;"                "ð"        "&ntilde;"            "ñ"        
 
"&ograve;"            "ò"
        "&oacute;"            "ó"        "&ocirc;"            "ô"        "&otilde;"            "õ"        
 
"&ouml;"            "ö"
        "&divide;"            "÷"        "&oslash;"            "ø"        "&ugrave;"            "ù"        
 
"&uacute;"            "ú"
        "&ucirc;"            "û"        "&uuml;"            "ü"        "&yacute;"            "ý"        
 
"&thorn;"            "þ"
        "&yuml;"            "ÿ"        "&quot;"            "\""    "&amp;"                "&"        
 
"&euro;"            "€"
        "&oelig;"            "œ"        "&Yuml;"            "Ÿ"        "&nbsp;"            " "        
 
"&iexcl;"            "¡"
        "&cent;"            "¢"        "&pound;"            "£"        "&curren;"            "¤"        
 
"&yen;"                "Â¥"
        "&brvbar;"            "¦"        "&brkbar;"            "¦"        "&sect;"            "§"        
 
"&uml;"                "¨"
        "&die;"                "¨"        "&copy;"            "©"        "&ordf;"            "ª"        
 
"&laquo;"            "«"
        "&not;"                "¬"        "&shy;"                " -"    "&reg;"                "®"        
 
"&macr;"            "¯"
        "&hibar;"            "¯"        "&deg;"                "°"        "&plusmn;"            "±"        
 
"&sup2;"            "²"
        "&sup3;"            "³"        "&acute;"            "´"        "&micro;"            "µ"        
 
"&para;"            "¶"
        "&middot;"            "·"        "&cedil;"            "¸"        "&sup1;"            "¹"        
 
"&ordm;"            "º"
        "&raquo;"            "»"        "&frac14;"            "¼"        "&frac12;"            "½"        
 
"&frac34;"            "¾"
        "&iquest;"            "¿"        "&Agrave;"            "À"        "&Aacute;"            "Á"        
 
"&Acirc;"            "Â"
        "&Atilde;"            "Ã"        "&Auml;"            "Ä"        "&Aring;"            "Å"        
 
"&AElig;"            "Æ"
        "&Ccedil;"            "Ç"        "&Egrave;"            "È"        "&Eacute;"            "É"        
 
"&Ecirc;"            "Ê"
        "&Euml;"            "Ë"        "&Igrave;"            "í"        "&Iacute;"            "Í"        
 
"&Icirc;"            "Î"
        "&Iuml;"            "Ï"        "&ETH;"                "Ð"        "&Dstrok;"            "Ð"        
 
"&Ntilde;"            "Ñ"
        "&Ograve;"            "Ò"        "&Oacute;"            "Ó"        "&Ocirc;"            "Ô"        
 
"&Otilde;"            "Õ"
        "&Ouml;"            "Ö"        "&times;"            "×"        "&Oslash;"            "Ø"        
 
"&Ugrave;"            "Ù"
        "&Uacute;"            "Ê"        "&Ucirc;"            "Û"        "&Uuml;"            "í"        
 
"&Yacute;"            "Ý"
        "&THORN;"            "Î"        "&szlig;"            "ß"        "\r"                ""        
 
"\t"                ""
        "'"            "\'"    "'"                "\'"    ">"                ">"        "<"        
 
        "<"
        """                "\'"    "&"                "&"        "#91;"                "\("    "\"        
 
        "\/"
        "]"                ")"        "{"            "("        "}"            ")"        
 
"£"            "£"
        "¨"            "¨"        "©"            "©"        "«"            "«"        
 
" "            " "
        "®"            "®"        "´"            "´"        "·"            "·"        
 
"¹"            "¹"
        "»"            "»"        "¼"            "¼"        "½"            "½"        
 
"¾"            "¾"
        "À"            "À"        "Á"            "Á"        "Â"            "Â"        
 
"Ã"            "Ã"
        "Ä"            "Ä"        "Å"            "Å"        "Æ"            "Æ"        
 
"Ç"            "Ç"
        "È"            "È"        "É"            "É"        "Ê"            "Ê"        
 
"Ë"            "Ë"
        "í"            "í"        "Í"            "Í"        "Î"            "Î"        
 
"Ï"            "Ï"
        "Ð"            "Ð"        "Ñ"            "Ñ"        "Ò"            "Ò"        
 
"Ó"            "Ó"
        "Ô"            "Ô"        "Õ"            "Õ"        "Ö"            "Ö"        
 
"×"            "×"
        "Ø"            "Ø"        "Ù"            "Ù"        "Ê"            "Ê"        
 
"Û"            "Û"
        "í"            "í"        "Ý"            "Ý"        "Î"            "Î"        
 
"ß"            "ß"
        "à"            "à"        "á"            "á"        "â"            "â"        
 
"ã"            "ã"
        "ä"            "ä"        "å"            "å"        "æ"            "æ"        
 
"ç"            "ç"
        "è"            "è"        "é"            "é"        "ê"            "ê"        
 
"ë"            "ë"
        "ì"            "ì"        "í"            "í"        "î"            "î"        
 
"ï"            "ï"
        "ð"            "ð"        "ñ"            "ñ"        "ò"            "ò"        
 
"ó"            "ó"
        "ô"            "ô"        "õ"            "õ"        "ö"            "ö"        
 
"÷"            "÷"
        "ø"            "ø"        "ù"            "ù"        "ú"            "ú"        
 
"û"            "û"
        "ü"            "ü"        "ý"            "ý"        "þ"            "þ"        
 
    } $str]
    regsub -all "<br />" $str " " str
     set str [encoding convertfrom "utf-8" $str ]
    return "${str}"
}
 
 
proc vdm::antiflood {chan type} {
    variable antiflood_msg
    if {![info exists antiflood_msg($chan$type)]} { set antiflood_msg($chan$type) 0 }
    variable instance
    if {![info exists instance($chan$type)]} { set instance($chan$type) 0 }
    set max_instances [lindex [split $vdm::floodsettings($type) ":"] 0]
    set instance_length [lindex [split $vdm::floodsettings($type) ":"] 1]
    if { $instance($chan$type) >= $max_instances } {
        if { $antiflood_msg($chan$type) == 0 } {
            set antiflood_msg($chan$type) 1
            if {$type != "global"} {
                putquick "privmsg $chan :\0037:::\00314 Contrôle de flood activé pour la commande \002!$type\002 : pas plus de 
 
$max_instances requête(s) toutes les $instance_length secondes.\003"
            } else {
                putquick "privmsg $chan :\0037:::\00314 Contrôle de flood sur les commandes de \002Vie De Merde\002 : pas plus de 
 
$max_instances commandes toutes les $instance_length secondes.\003"
            }
            utimer $vdm::antiflood_msg_interval "vdm::antiflood_msg_reset $chan $type"
        }
        return "flood"
    } else {
        incr instance($chan$type)
        utimer $instance_length "vdm::antiflood_close_instance $chan $type"
        return "no flood"
    }
}
 
proc vdm::antiflood_close_instance {chan type} {
    variable instance
    if { $instance($chan$type) > 0 } { incr instance($chan$type) -1 }
}
 
proc vdm::antiflood_msg_reset {chan type} {
    variable antiflood_msg
    set antiflood_msg($chan$type) 0
}
 
 
 
putlog "\002*$vdm::scriptname v$vdm::version*\002 par Galdinx et MenzAgitat ( \037\00312http://www.boulets-roxx.com\003\037 ) a été chargé."



Je connais l'erreur... mais j'ignore quoi mettre comme variable et pour la fermeture je c'est pas c'est où. Alors merci de m'aider moi aussi avec ceci :$
Le meuilleur du Web www.zet-land.org
Répondre Avertir


Atteindre :


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