Compteur join
#1
Bonjour,

Je suis à la recherche d'un TCL qui compte les entrées sur un salon
J'ai bien trouvé un script mais il ne compte que les pseudo différent
et je voudrais qu'il compte toutes les entrées.

Avec un affichage en notice pour l'utilisateur qui entre sur le salon
et avec une commande !compteur a taper en salon

merci
Répondre Avertir
#2
Je pense que si tu avais un peu cherché sur le forum et le wiki, tu aurais trouvé comment faire ça.

Je viens de le mettre sur http://tools.eggdrop.fr/pasteme/view/d182ebd6 :
TCL
set jc "#toto"
set jcpt 0
 
bind join - * joinc
 
proc joinc {nick uhost handle chan} {
   if {[string tolower $chan] != [string tolower $::jc]} { return 0 }
   if {[string tolower $nick] == [string tolower $::botnick] } { return 0 }
   incr ::jcpt
   putserv "NOTICE $nick :Tu es le N°$::jcpt"
   return 1
}
 
bind pub - "!compteur" joindisp
proc joindisp {nick uhost handle chan args} {
   if {[string tolower $chan] != [string tolower $::jc]} { return 0 }
   putserv "PRIVMSG $chan :Il y a eu $::jcpt entrées sur $chan"
   return 1
}


Répondre
#3
(21/09/2014, 11:10)CrazyCat a écrit : Je pense que si tu avais un peu cherché sur le forum et le wiki, tu aurais trouvé comment faire ça.

Je viens de le mettre sur http://tools.eggdrop.fr/pasteme/view/d182ebd6 :
TCL
set jc "#toto"
set jcpt 0
 
bind join - * joinc
 
proc joinc {nick uhost handle chan} {
   if {[string tolower $chan] != [string tolower $::jc]} { return 0 }
   if {[string tolower $nick] == [string tolower $::botnick] } { return 0 }
   incr ::jcpt
   putserv "NOTICE $nick :Tu es le N°$::jcpt"
   return 1
}
 
bind pub - "!compteur" joindisp
proc joindisp {nick uhost handle chan args} {
   if {[string tolower $chan] != [string tolower $::jc]} { return 0 }
   putserv "PRIVMSG $chan :Il y a eu $::jcpt entrées sur $chan"
   return 1
}


Bonjour,
J'ai chercher dans le forum mais avec le mot clé "compteur" et non "counter"
Désolé

Merci pour ta réponse.
Répondre Avertir
#4
(21/09/2014, 11:25)Yakka a écrit :
(21/09/2014, 11:10)CrazyCat a écrit : Je pense que si tu avais un peu cherché sur le forum et le wiki, tu aurais trouvé comment faire ça.

Je viens de le mettre sur http://tools.eggdrop.fr/pasteme/view/d182ebd6 :
TCL
set jc "#toto"
set jcpt 0
 
bind join - * joinc
 
proc joinc {nick uhost handle chan} {
   if {[string tolower $chan] != [string tolower $::jc]} { return 0 }
   if {[string tolower $nick] == [string tolower $::botnick] } { return 0 }
   incr ::jcpt
   putserv "NOTICE $nick :Tu es le N°$::jcpt"
   return 1
}
 
bind pub - "!compteur" joindisp
proc joindisp {nick uhost handle chan args} {
   if {[string tolower $chan] != [string tolower $::jc]} { return 0 }
   putserv "PRIVMSG $chan :Il y a eu $::jcpt entrées sur $chan"
   return 1
}


Bonjour,
J'ai chercher dans le forum mais avec le mot clé "compteur" et non "counter"
Désolé

Merci pour ta réponse.

Sauf que quand je fais un rehash le compteur se remet à zéro
donc je pense avec une inscription dans une base de donnée serait le mieux
Merci
Répondre Avertir
#5
Voici une petite modification qui n'utilise non pas une base de données mais les informations internes du canal : http://tools.eggdrop.fr/pasteme/view/41cc5118
Répondre
#6
Si je veux remettre le compteur a zero je dois faire comment ?

Merci a toi
Répondre Avertir
#7
Code :
.tcl chanset #toncanal jcpt 0
Répondre
#8
une dernière chose si je veux que ça fonctionne sur plusieurs salon

set jc "#toto #toto2"
set jc "#toto, #toto2"

ne fonctionne pas

Merci
Répondre Avertir
#9
Normal, tu as demandé "sur un canal".
Mets en commentaire les lignes suivantes pour que le script fonctionne sur tous les canaux.
TCL
if {[string tolower $chan] != [string tolower $::jc]} { return 0 }


Répondre
#10
Merci
Répondre Avertir


Atteindre :


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