mIRC Homepage
Posted By: symphony Custom identifiers support in timestamp - 02/05/08 08:43 PM
I was wondering if it would be a good idea to support Custom Identifiers in timestamps (both with /timestamp -f and the logging timpstamping).

Custom identifiers will provide features usual timestamping has so you know...
Posted By: RusselB Re: Custom identifiers support in timestamp - 02/05/08 11:58 PM
Would you kindly provide an example of what you mean? Maybe I'm just tired, but I'm having a hard time picturing how this would be useful.
Posted By: argv0 Re: Custom identifiers support in timestamp - 03/05/08 12:11 AM
[HH:nn:ss ($ticks)]

[$uptime(mirc,2)]


What's not to get?
I think a popular use would be to allow the timestamp to only display if it has changed since the last message. For instance I often see scripted themes use timestamps which will display something like:
Quote:
12:51am
<joe> hi
<mary> hi joe
<joe> what's up?
12:52am
<mary> not much, you?


Using a custom identifier it could be as simple as
Code:
alias mytimestamp {
  if (%last_ts == $asctime(hh:nntt)) return
  else {
    %last_ts = $asctime(hh:nntt)
    return $asctime(hh:nntt) $+ $crlf
  }
}


That would be assuming that $crlf worked as a newline, but anyway, I'm guessing this is the kind of thing people would use it for.
Posted By: Jigsy Re: Custom identifiers support in timestamp - 03/05/08 12:51 AM
In the theme of timestamps, I'd like colors in timestamps to stay after you've closed/started mIRC.
Posted By: symphony Re: Custom identifiers support in timestamp - 03/05/08 02:00 AM
like to be able to use $mytimestamp as the timestamp value
/timestamp -f $mytimestamp

I KNOW it can be scripted in custom theming, but I think it would be better if implemented as an existing feature.
make sense?
Posted By: RusselB Re: Custom identifiers support in timestamp - 03/05/08 04:03 AM
I understand now what you're looking for, and I agree that this could be a good feature.. as I said, I was tired earlier.
Posted By: Kol Re: Custom identifiers support in timestamp - 03/05/08 04:49 AM
I also like the idea. Sounds useful for those who want to further customize their timestamp.

I made a handy little snippet that uses a timer on START to find the exact time each second starts in $ticks. Some basic subtraction, and voila! You can have milliseconds in your timestamp

Code:
on *:START: {
  unset %t
  .timer $asctime($calc($ctime +60),HH:nn) 1 0 msget 1 $!+ $!right($ticks,3)
}
alias -l msf return $right(0000 $+ $left($1,$2),$2)
alias msget {
  if (!$isid) set %t $1
  else {
    var %c 1 $+ $right($ticks,3)
    var %c $calc(%c -%t)
    if (%c < 0) { var %c $calc(1000- $abs(%c)) }
    return $replacecs($asctime($1),xxx,$msf(%c,3),xx,$msf(%c,2),x,$msf(%c,1))
  }
}


It probably has an accuracy deficiency of +-10ms but in timestamps, that's not much.

If we could use identifiers in timestamps, you'd be able to do /timestamp -f [HH:nn:ss $msget(xxx) $+ ]
Posted By: argv0 Re: Custom identifiers support in timestamp - 03/05/08 06:36 AM
/timestamp -f [HH:nn] < $+ $nick $+ > $1-

And then we dont even need on text events wink
Posted By: symphony Re: Custom identifiers support in timestamp - 03/05/08 12:23 PM
huh?
Posted By: Horstl Re: Custom identifiers support in timestamp - 04/05/08 10:39 PM
...for "themed" output of incoming text (I assume) smile
Posted By: Kol Re: Custom identifiers support in timestamp - 05/05/08 08:10 AM
Or sarcasm...
Posted By: argv0 Re: Custom identifiers support in timestamp - 05/05/08 08:54 PM
A little of both, really..

Makes you wonder if maybe the whole theming method should be rethought by adding things like, say, $nickstampfmt, $linefmt that can customize output without the need of text events.
Posted By: symphony Re: Custom identifiers support in timestamp - 06/05/08 09:08 AM
Nobody asked for some new identified to be added, it was about allowing scripted identifiers to be used.
Posted By: Doqnach Re: Custom identifiers support in timestamp - 06/05/08 09:26 AM
Originally Posted By: Jigsy
In the theme of timestamps, I'd like colors in timestamps to stay after you've closed/started mIRC.


this is also due to a limitation in ini files because of windows I believe... but yeah it would be nicer if the colours would stay and you don't have to do a /timestamp in ON START (which is the workaround for this problem)

having timestamp support identifiers would certainly be a nice addition and I can see it's uses.
Posted By: argv0 Re: Custom identifiers support in timestamp - 06/05/08 08:44 PM
You should probably re-read my post, the suggestion was whilst on-topic.
© mIRC Discussion Forums