REDIRE LES 5 DERNIERES LIGNES (LOG) POUR BOT ET USER

Kerrigan Messages postés 708 Date d'inscription lundi 15 juillet 2002 Statut Membre Dernière intervention 17 mars 2005 - 25 avril 2004 à 03:19
Kerrigan Messages postés 708 Date d'inscription lundi 15 juillet 2002 Statut Membre Dernière intervention 17 mars 2005 - 25 avril 2004 à 03:19
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/22144-redire-les-5-dernieres-lignes-log-pour-bot-et-user

Kerrigan Messages postés 708 Date d'inscription lundi 15 juillet 2002 Statut Membre Dernière intervention 17 mars 2005
25 avril 2004 à 03:19
msg $chan $read(log5_ [ $+ [ $chan ] $+ ] .txt,$calc(%comptlignelog_ [ $+ [ $chan ] ] -4))
msg $chan $read(log5_ [ $+ [ $chan ] $+ ] .txt,$calc(%comptlignelog_ [ $+ [ $chan ] ] -3))
msg $chan $read(log5_ [ $+ [ $chan ] $+ ] .txt,$calc(%comptlignelog_ [ $+ [ $chan ] ] -2))
msg $chan $read(log5_ [ $+ [ $chan ] $+ ] .txt,$calc(%comptlignelog_ [ $+ [ $chan ] ] -1))
msg $chan $read(log5_ [ $+ [ $chan ] $+ ] .txt,%comptlignelog_ [ $+ [ $chan ] ])


tu repete 5 fois la meme chose ... pas terrible , remplace par tout ça:

var %itr = 5
while ( %itr >= 0 ) { $mess($chan,%itr) | inc %itr } }

et tu colles ça qque part
alias -l mess { msg $1 $read(log5_ [ $+ [ $1 ] $+ ] .txt,$calc(%comptlignelog_ [ $+ [ $1 ] ] - $2)) }

wala c'est tout ce que j'ai a dire
Rejoignez-nous