Communauté Eggdrop
animation a heure precise - 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 : animation a heure precise (/showthread.php?tid=109)



animation a heure precise - caline012 - 23/11/2007

tcl
# animation2 v1
# caline
# par caline
# 22/11/2007
 
bind pub - animation2 pub_animation
proc pub_animation2 { nick uhost handle channel arg } {
global animation2 animation2
set animation2 [lindex $arg 0]
if {[lindex [ctime [unixtime]] 3] == "12:00:00"}{
puthelp "privmsg $channel :blabla"
}
}
 
putlog "animation2.tcl v1 par caline - Date: 22-11-07"


voila ceci marche pas lol


RE: animation a heure precise - CrazyCat - 23/11/2007

sans vouloir te vexer, il existe Bind time qui est très pratique...


RE: animation a heure precise - caline012 - 24/11/2007

oui ca me parai logique mais jai u deja un soucis a la base jetai parti sur un simple !heure qui dit nous somme a hh:mm le jour mois annee et en fr mais rien ne marche jai en anglais.c'est pas compliquer l heu're et la date mais en fr je c'est pas le coter.jessayerais le time a la place de pub


RE: animation a heure precise - CrazyCat - 24/11/2007

Pour formater la date/heure, tu as strftime qui est très pratique
tcl
strftime %H:%M %d/%m/%Y


te renvoit par exemple 01:34 24/11/2007


RE: animation a heure precise - caline012 - 11/12/2007

tcl
bind time - animation2 time_animation
proc time_animation2 { nick uhost handle channel arg } {
global animation2 animation2
set animation2 [lindex $arg 0]
if {[lindex [ctime [unixtime]] 0] == "08:00:00"}{
puthelp "privmsg $channel :~~~~ La team pacifique vous souhaite une bonne journee parmis nous ~~~~"
}
}


jai essayer ainsi sans reulstat lol


RE: animation a heure precise - CrazyCat - 11/12/2007

tu n'as pas lu la doc...
tcl
bind time - "00 08 * * *" time_animation
proc time_animation {min hour day month year } {
   puthelp "PRIVMSG $channel :\002La team pacifique\002 vous souhaite une bonne journee parmis nous"
}





RE: animation a heure precise - caline012 - 11/12/2007

je veux bien mais toujours rien lol jai des idees mais ji toujours des soucis a les appliquer moi Sad


RE: animation a heure precise - caline012 - 12/12/2007

crzaycat ca ne va tjr pas la je desespere


RE: animation a heure precise - CrazyCat - 13/12/2007

sans ton code, je ne peux pas t'aider.
Le code que je t'ai donné et fait pour lancer le message à 08h du matin. Tu peux le tester en allant en party-line et en faisant:
Code :
.tcl time_animation 00 00 00 00 00

Et il y a bien sûr une énorme erreur: $channel n'est définit nulle part, tu dois donc le mettre en dur:
tcl
puthelp "PRIVMSG #toncanal :\002La team pacifique\002 vous souhaite une bonne journee parmis nous"





RE: animation a heure precise - caline012 - 13/12/2007

oui c vrai mais jetaireparti a chake fois dez different code et j'ai reussi.merci :