je recherche un tcl qui remettrais le topic défini par mon bot , lors des rehash des bot ircop du serveur orange.
afin d'eviter d'aller sur la page d'accueil etc etc
Je viens de trouver le tcl randomtopic.tcl dans la partie telechargement, j'aimerais savoir si s'etait possible qu'il mette en topic une quote toute les x heures qu'il irait cherchait dans le dossier quote.tcl par exemple plutot que des phrases pre-defini
pk ne pas prendre directement un tcl de quote aléatoire et modifié simple le putserv "PRIVMSG $chan ...." par Putserv "TOPIC ... " non ?
[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]
montre nous le TCL de quote aléatoire et ont regardera ce qu'ont peut faire pour le timer qui pose souci
[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]
Voici le tcl de quote ci joint.
C'est celui dont je me sert actuellement, ( que j'ai d'ailleurs dl ici :p ) si on pouvais y inclure que toutes les x heures il met une quote en topic se serait pas mal ( si cela est possible bien entendu )
14/09/2009, 18:48 (Modification du message : 14/09/2009, 18:49 par fedora.)
essaye ce TCL stp pour voir.aparament il changerais le topic tous les X minutes ça peut etre pas mal dans ce que tu voudrais.
tcl
# tcl.randtopic# based on tcl.topic by Brian_C## 02-08-96 cmw!cmwagner@gate.net Added random_topic array, to allow random# topics to be set every hour.# 03-02-96 cmw!cmwagner@gate.net Added load/write/add/delete/show routines,# to allow masters to remotely maintain the# topics list# 03-04-96 cmw!cmwagner@gate.net Added set command and added help command.# 03-06-96 cmw!cmwagner@gate.net Added refresh command.
# topic file# set topicfile "topics"
# topic refresh time, in minutesset topic_refresh_rate 30
bind msg - topic msg_topic
proc set_topic {}{global channel random_topic topics_changed topic_refresh_rate
if{$topics_changed == 1}{
putlog "Writing topics file..."
topic_write
}set topic [lindex$random_topic[rand [llength$random_topic]]]
putserv "TOPIC $channel :$topic"
timer $topic_refresh_rate set_topic
}proc sync_topic {}{set time_ending [string range [time]24]if{$time_ending == ":00"}{
set_topic
}{
timer 1 sync_topic
}}proc topic_show {nick uhost hand arg}{global channel random_topic botnick
putserv "NOTICE $nick :Topics for \002$channel\002:"set ctr 0foreach i $random_topic{incr ctr 1
putserv "NOTICE $nick :\002${ctr}.\002 $i"}
putserv "PRIVMSG $nick :---- \002end\002 ----"if{$hand!= "*"&&[matchattr $hand m]}{
putserv "PRIVMSG $nick :To add a topic type \002/msg $botnick TOPIC HELP\002 for help."}return1}proc topic_add {nick uhost hand arg}{global channel random_topic topics_changed
if{![matchattr $hand m]}{
putserv "PRIVMSG $nick :Sorry, you are not authorized to use this command."return0}if{[lindex$arg1] == ""}{
putserv "PRIVMSG $nick :Usage: TOPIC ADD <new topic>"return0}
putserv "PRIVMSG $nick :Topic list has been updated, thanks."
putserv "PRIVMSG $nick :[lrange $arg 1 end]"lappend random_topic [lrange$arg1 end]set topics_changed 1return1}proc topic_erase {nick uhost hand arg}{global random_topic topics_changed
if{![matchattr $hand m]}{
putserv "PRIVMSG $nick :Sorry, you are not authorized to use this command."return0}if{[lindex$arg1] == ""}{
putserv "PRIVMSG $nick :Usage: TOPIC DEL <topic#>"return0}set i [expr[lindex$arg1] - 1]if{$i>=0&&[lindex$random_topic$i]!= ""}{
putserv "PRIVMSG $nick :Entry [lindex $arg 1] erased."
putserv "PRIVMSG $nick :[lindex $random_topic $i]"set random_topic [lreplace$random_topic$i$i]set topics_changed 1return1}{
putserv "PRIVMSG $nick :That number is out of range!"return0}}proc topic_set {nick uhost hand arg}{global channel random_topic
if{![matchattr $hand m]}{
putserv "PRIVMSG $nick :Sorry, you are not authorized to use this command."return0}if{[lindex$arg1] == ""}{
putserv "PRIVMSG $nick :Usage: TOPIC SET <topic#>"return0}set i [expr[lindex$arg1] - 1]if{$i>=0&&[lindex$random_topic$i]!= ""}{
putserv "PRIVMSG $nick :Setting current topic to entry [lindex $arg 1]."
putserv "TOPIC $channel :[lindex $random_topic $i]"return1}{
putserv "PRIVMSG $nick :That number is out of range!"return0}}proc topic_refresh {nick uhost hand arg}{global topic_refresh_rate
if{![matchattr $hand m]}{
putserv "PRIVMSG $nick :Sorry, you are not authorized to use this command."return0}if{[lindex$arg1] == ""}{
putserv "PRIVMSG $nick :Usage: TOPIC REF <minutes>"return0}set i [lindex$arg1]if{$i<30 || $i>240}{
putserv "PRIVMSG $nick :Refresh rate must be 30 - 240 minutes."return0}{set topic_refresh_rate $i
putserv "PRIVMSG $nick :Refresh rate has been changed to \002$topic_refresh_rate\002 minutes, this change"
putserv "PRIVMSG $nick :will be effective after the next topic change."return1}}proc topic_help {nick uhost hand arg}{
putserv "PRIVMSG $nick :Usage: TOPIC - show topics"if{[matchattr $hand m]}{
putserv "PRIVMSG $nick : TOPIC ADD <new topic> - add topic entry"
putserv "PRIVMSG $nick : TOPIC DEL <topic#> - delete topic entry"
putserv "PRIVMSG $nick : TOPIC SET <topic#> - set current topic to topic#"
putserv "PRIVMSG $nick : TOPIC REF <minutes> - change topic refresh rate"}return1}proc topic_load {}{global random_topic topicfile
set random_topic ""set fd [open$topicfile r]while{![eof$fd]}{set inp [gets$fd]if{[eof$fd]}{break}if{[string trim $inp" "] == ""}{continue}lappend random_topic [lrange$inp0 end]}close$fdreturn1}proc topic_write {}{global topicfile random_topic topics_changed
set fd [open$topicfile w]foreach i $random_topic{puts$fd"$i"}close$fdset topics_changed 0return1}proc msg_topic {nick uhost hand arg}{switch[string tolower [lindex$arg0]]{"add"{set r [topic_add $nick$uhost$hand$arg]}"del"{set r [topic_erase $nick$uhost$hand$arg]}"delete"{set r [topic_erase $nick$uhost$hand$arg]}"set"{set r [topic_set $nick$uhost$hand$arg]}"ref"{set r [topic_refresh $nick$uhost$hand$arg]}"refresh"{set r [topic_refresh $nick$uhost$hand$arg]}"help"{set r [topic_help $nick$uhost$hand$arg]}default{set r [topic_show $nick$uhost$hand$arg]}}return$r}if{![info exists set_topic_running]&&![info exists random_topic]}{
sync_topic
set set_topic_running 1}set topics_changed 0
topic_load
par contre je te garantit pas qu'il n'y à pas des beug hein! je peut pas tester le TCL ,donc à toi de corriger si y en a, ou nous remontrer les erreurs.
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]
En faite j'avais trouver un tcl dans la partie du telechargement qui avait l'air sympa, mais ce que je voulais en fait c'est qu'il me sorte aléatoirement en topic les quotes qui sont enregistrer dans un fichier.
Après de la a savoir si c'est possible ...
14/09/2009, 19:50 (Modification du message : 14/09/2009, 19:55 par fedora.)
bah si tu lis le TCL tu verra qu'il enregistre topic ds un fichier donc il est fort possible que tu puisse y mettre des quotes dedans.à savoir que dans un topic le nombres de caractère et limiter donc vois aussi cela.
[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]
22/09/2009, 10:07 (Modification du message : 22/09/2009, 10:15 par fedora.)
bonjour,
A tu lus le TCL ?
ensuite à tu essayer de dé commenter cette ligne ?
Citation :# topic file
# set topicfile "topics"
ps: essayer SVP de lire le TCL et de comprendre l'erreur s'il y a .
[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]
normal que tu est cette erreur cet ligne là n'est pas à décommenter
Citation :# topic file
[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]
utilise alors celui ci que j'ai tester et qui fonctionne très bien. tu ajoute le topic que tu veut puis toutes le X minute que toi tu aura définie il changera le topic !! j'ai tester et aucune erreur en pl ect ... il fonctionne parfaitement ! tu peut aussi choisir sur quel salon tu veut que le topic soit changer ect ... mais là je te laisse lire le TCL
je joint le TCL :
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]