sunslayer commented on a Page, Count (down|up)  -  Nov 07, 2010

you can combine the two aliases into one

alias count {
  .noop $regsubex($1 $$2,/(\d*)\W(\d*)/,)
  var %v1 = $regml(1),%v2 = $regml(2),%v = $iif(%v1 < %v2,+,-),%a = 0
  while ($counttrue(%v1,%v2,%v)) {
    .timercounter [ $+ [ %a ] ] 1 %a $iif(#,say,echo -a) %v1
    $iif(%v = +,inc %v1,dec %v1)
    inc %a
  }
}
alias -l counttrue { return $iif(($1 <= $2 && $3 = +) || ($1 >= $2 && $3 = -),1,0) }

depending on whether $1 < $2 it will count up/down
and btw Jethro_> Just enter a single number grater than 1 to count.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.