Last X Lines

Last X Lines

mIRC Snippet that retrieves the last lines from active window. Because its a very simple code, you can implement it in some dialog studio app, like a history log.

Postat de Copyright Categorie Review user Vizualizari Data
BLKoldSUN BLKoldSUN stats Cod testat 474 2024-08-11 09:23:49

alias last {
  if ($hget(lastline)) .hfree lastline 
  if ($1 !isnum) return
  else { 
    if ($1 > $line($active,0)) {
      echo -a There are not so many lines in : $active
      return
    }
    var %i 1
    while (%i <= $1) {
      var %p $calc($line($active,0) - %i +1)
      hadd -m lastline %i $line($active,%p,0)
      inc %i
    }
    echo -a  $+ $iif($server,Pasting, Echoing)  last $1 lines $+ $iif($2 != $null, to $2 $+ .,.)
    var %t $1
    while (%t) {
      $iif($server,msg $iif($2,$2, $active), echo -a) $hget(lastline,%t)
      dec %t
    }
    .hfree lastline
  }
}