Redire les 5 dernieres lignes (log) pour bot et user

Contenu du snippet

Redire les 5 dernieres lignes (log) pour bot et user.
C'est rigolo, car j'ai galerer comme un con pour le faire avec des variables, alors j'ait fait en fichier txt comme ça je galere pas :)

Source / Exemple :


; VERSION ROBOT (BOT)

on 1:text:*:#:{
  if ($1 == !log5) {
    if (%antirepetitionlog5 == on) { halt }
    else {
      if (%comptlignelog_ [ $+ [ $chan ] ] == $null) || (%comptlignelog_ [ $+ [ $chan ] ] < 6) { 
        echo -a Attent qu'il yait en moin 5 lignes dite.
        halt 
      }
      else {
        set -u10 %antirepetitionlog5 on
        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 ] ])
      }
    }
  }
  else {
    write log5_ [ $+ [ $chan ] $+ ] .txt 4,1( $time $chan $nick ) : $1-
    inc %comptlignelog_ [ $+ [ $chan ] ] 1 
  }
}

; VERSION USER
on *:text:*:#:{
  write log5_ [ $+ [ $chan ] $+ ] .txt 3,1( $time $chan $nick ) : $1-
  inc %comptlignelog_ [ $+ [ $chan ] ] 1 
  halt 
}
on 1:input:*:{
  if ($1 == !log5) {
    if (%comptlignelog_ [ $+ [ $chan ] ] == $null) || (%comptlignelog_ [ $+ [ $chan ] ] < 6) { 
      echo -a Attent qu'il yait en moin 5 lignes dite.
      halt 
    }
    else {
      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 ] ])
    }
  }
  else {
    write log5_ [ $+ [ $chan ] $+ ] .txt 4,1( $time $chan $nick ) : $1-
    inc %comptlignelog_ [ $+ [ $chan ] ] 1 
  }
}
menu channel {
  Log 
  .5 dernieres lignes sur $chan:/echo -a Fait !log5 sur la fenetre de $chan (attention au flood)
}

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.