Communauté Eggdrop
nick list - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : nick list (/showthread.php?tid=776)



nick list - T4tou - 04/11/2010

bonjour merci pour pour l aide hier
j aurais bien voulus ameliorer ce code rajouter un fond de couleur et cganger la couleur des nick
plus afficher le status de luser si il est op voice owner ect...
voici le code
tcl
set canal "#bienvenue"
set fichier "/home/mandarin/domains/tchatweb.net/public_html/liste.html"
 
bind join - "$canal *" list:join
bind part - "$canal *" list:part
bind sign - "$canal *" list:quit
 
proc list:join {nick uhost handle chan} { list:log; }
proc list:part {nick uhost handle chan text} {
if {$nick != $::botnick} { list:log; }
}
proc list:quit {nick uhost handle chan text} {
if {$nick != $::botnick} { list:log; }
}
 
proc list:log {} {
set fp [open $::fichier w]
foreach cnick [chanlist $::canal] {
puts $fp "$cnick"
puts $fp "<br>"
 
}
close $fp
}


merci bcp de l aide

Edit: merci d'utiliser les balises [ tcl ]


RE: nick list - CrazyCat - 04/11/2010

Pour le statut des utilisateurs, il y a l'exemple dans chanrelay, voici ce que ça donne mis dans ton script:
tcl
set canal "#bienvenue"
set fichier "/home/mandarin/domains/tchatweb.net/public_html/liste.html"
 
bind join - "$canal *" list:join
bind part - "$canal *" list:part
bind sign - "$canal *" list:quit
 
proc list:join {nick uhost handle chan} { list:log; }
proc list:part {nick uhost handle chan text} {
    if {$nick != $::botnick} { list:log; }
}
proc list:quit {nick uhost handle chan text} {
    if {$nick != $::botnick} { list:log; }
}
 
proc list:log {} {
    set fp [open $::fichier w]
    foreach cnick [chanlist $::canal] {
        if { $cnick == $::botnick } { continue; }
        if { [isop $cnick $::canal] == 1 } {
            set st "@"
        } elseif { [ishalfop $cnick $::canal] == 1 } {
            set st "%"
        } elseif { [isvoice $cnick $::canal] == 1 } {
            set st "%"
        } else {
            set st ""
        }
        puts $fp "$st$cnick<br />"
    }
    close $fp
}


Pour le background et autres mises en page, je te conseille de plutôt faire une page qui incluera le liste.html (soit en php soit en SSI), ce sera bien plus souple

Edit: script corrigé


RE: nick list - T4tou - 04/11/2010

merci pour ta reponse mais j ai plus de nick qui s affiche
http://tchatweb.net/liste.html


RE: nick list - T4tou - 04/11/2010

T4tou a écrit :merci pour ta reponse mais j ai plus de nick qui s affiche
http://tchatweb.net/liste.html

j ai oublier voici l erreur
Tcl error [list:part]: can't read "::crelay::me(chan)": no such variable


RE: nick list - cestlemien - 04/11/2010

salut peut etre ajouter en debut de tcl un truc du style :

tcl
set crelay "#bienvenue"




cordialemement.


RE: nick list - CrazyCat - 04/11/2010

Arf non, copier/coller trop rapide.
Il faut remplacer $::crelay::me(chan) par $::canal