Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

[Last X Lines] v2.0

Recommended Posts

  • Administrators
Quote

; [Last X Lines]
; {
  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
  }
}

Snippet that simply repeats last X lines (the name is quite self explanatory, isn't it ?) of conversation in active window/to target.

Usage : /last <X> [target]
<X> represents number of lines that you want to repeat.

[target] (optional) if you enter target, then last X lines from active window will be sent to target. If not, they will be repeated to $active window.

Link to comment
Share on other sites



×
×
  • Create New...