mIRC Home    About    Download    Register    News    Help

Print Thread
Custom identifiers support in timestamp #198674 02/05/08 08:43 PM
Joined: Jan 2006
Posts: 468
symphony Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
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...

Re: Custom identifiers support in timestamp [Re: symphony] #198681 02/05/08 11:58 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: Custom identifiers support in timestamp [Re: RusselB] #198683 03/05/08 12:11 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
[HH:nn:ss ($ticks)]

[$uptime(mirc,2)]


What's not to get?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Custom identifiers support in timestamp [Re: RusselB] #198684 03/05/08 12:12 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: Custom identifiers support in timestamp [Re: symphony] #198687 03/05/08 12:51 AM
Joined: Nov 2004
Posts: 804
Jigsy Offline
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 804
In the theme of timestamps, I'd like colors in timestamps to stay after you've closed/started mIRC.


What do you do at the end of the world? Are you busy? Will you save us?
Re: Custom identifiers support in timestamp [Re: RusselB] #198696 03/05/08 02:00 AM
Joined: Jan 2006
Posts: 468
symphony Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
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?

Re: Custom identifiers support in timestamp [Re: symphony] #198704 03/05/08 04:03 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: Custom identifiers support in timestamp [Re: symphony] #198706 03/05/08 04:49 AM
Joined: Dec 2007
Posts: 48
K
Kol Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Dec 2007
Posts: 48
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) $+ ]

Re: Custom identifiers support in timestamp [Re: symphony] #198707 03/05/08 06:36 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
/timestamp -f [HH:nn] < $+ $nick $+ > $1-

And then we dont even need on text events wink


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Custom identifiers support in timestamp [Re: argv0] #198714 03/05/08 12:23 PM
Joined: Jan 2006
Posts: 468
symphony Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
huh?

Re: Custom identifiers support in timestamp [Re: symphony] #198815 04/05/08 10:39 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
...for "themed" output of incoming text (I assume) smile

Re: Custom identifiers support in timestamp [Re: Horstl] #198841 05/05/08 08:10 AM
Joined: Dec 2007
Posts: 48
K
Kol Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Dec 2007
Posts: 48
Or sarcasm...

Re: Custom identifiers support in timestamp [Re: Kol] #198873 05/05/08 08:54 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Custom identifiers support in timestamp [Re: argv0] #198894 06/05/08 09:08 AM
Joined: Jan 2006
Posts: 468
symphony Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
Nobody asked for some new identified to be added, it was about allowing scripted identifiers to be used.

Re: Custom identifiers support in timestamp [Re: Jigsy] #198895 06/05/08 09:26 AM
Joined: Jan 2003
Posts: 1,063
D
Doqnach Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
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.


If it ain't broken, don't fix it!
Re: Custom identifiers support in timestamp [Re: symphony] #198944 06/05/08 08:44 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You should probably re-read my post, the suggestion was whilst on-topic.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"