mIRC Homepage

Server-time does not appear

Posted By: Tiago

Server-time does not appear - 03/01/19 03:08 PM

Hi
I have a question that I can not solve. I know since version 7.33 that mIRC supports server-time without the need for script, but I'm not able to put the server-time here:
Code:
alias cmode { return $left($remove($nick($2, $1).pnick,$1),1) }

on ^*:text:*:#:{
  echo -t $chan ... 3( $+ $+($cmode($nick,#)) $+ 3) $1-
  haltdef
}

I have this code to customize the messages that appear in the channel, but when I connect to my znc the messages that were recorded in znc appear with the time I connect and it is not correct, because if I remove the msgs the server-time appears with the correct time when mIRC connects to the znc server.

How can I do to put the correct server-time?

Thank you for your help wink
Posted By: kap

Re: Server-time does not appear - 03/01/19 05:00 PM

Echo -tz switch?
Posted By: Tiago

Re: Server-time does not appear - 04/01/19 12:25 AM

Originally Posted By: kap

Thank you!
Posted By: Tiago

Re: Server-time does not appear - 05/01/19 12:40 AM

Originally Posted By: kap

Your suggestion did not work.
Posted By: kap

Re: Server-time does not appear - 05/01/19 10:10 AM

I merely floated the idea of a -z switch in conjunction with the -t switch to get it to work. It was never implemented!

My post was just a way of saying that I experience the same issue (=
Posted By: Khaled

Re: Server-time does not appear - 05/01/19 11:00 AM

From /echo in the help file:

Quote:
The -tN switch prefixes the line with a timestamp if global time stamping is on or timestamping is on for that window. N is optional and is the UTC value to use for the timestamp.

In this case, you could specify $msgstamp as the N value. Does that do what you are expecting?
Posted By: Tiago

Re: Server-time does not appear - 05/01/19 12:38 PM

Originally Posted By: Khaled
From /echo in the help file:

Quote:
The -tN switch prefixes the line with a timestamp if global time stamping is on or timestamping is on for that window. N is optional and is the UTC value to use for the timestamp.

In this case, you could specify $msgstamp as the N value. Does that do what you are expecting?


Hi Khaled,

I am not able to put the $timestamp in the custom echo that is sent to the channels, because the local time always appears to me and not the time of the messages coming from the server.
What I intend is that the end result is, that when I connect to a znc server in the echo show the time the messages were sent and not the local time, as I show this example I made for you see:
Quote:
[20:30] ... Joined: #opers
[20:30] ... Topic: Opers Channel
[20:30] ... Set by: James on Tuesday, 17 July 2018, 19:35:43
[20:27] ... (*buffextras) TECO!TECO@PTirc/Global-IRCop/TECO joined
[20:27] ... (&ChanServ) [TECO] Hello everyone :-)
[20:27] ... (*buffextras) ChanServ!ChanServ@services.ptirc.org set mode: +o TECO
[20:27] ... (*buffextras) Server set mode: +sntrOPC
[20:30] ... (@TECO) hi
[20:30] ... (@TECO) I'm back
[20:31] ... (@TECO) :-)


I have this echo customization code in the channels, but I am not able to put the server-time in msgs.
Code:
alias cmode { return $left($remove($nick($2, $1).pnick,$1),1) }

on ^*:text:*:#:{
  echo -tm $chan ... 3( $+ $+($cmode($nick,#)) $+ 3) $1-
  haltdef
}
Posted By: Tiago

Re: Server-time does not appear - 05/01/19 08:22 PM

But without custom echo the mIRC displays the server-time correctly and the remaining messages on the other servers that do not znc also work correctly with the local time, but now I'm not able to put the custom echo with the server-time on znc connections and local time on other IRC servers.
Posted By: maroon

Re: Server-time does not appear - 05/01/19 10:46 PM

I don't have a zNC to test on, but it looks like you need to use echo -mt $+ $msgstamp
If you need to have an alias pull double duty for normal vs znc connections, you can have logic to use 2 different echoes. I'm guessing $left($nick,1) == $chr(42) might do it?
Posted By: Tiago

Re: Server-time does not appear - 06/01/19 12:44 AM

Originally Posted By: maroon
I don't have a zNC to test on, but it looks like you need to use echo -mt $+ $msgstamp
If you need to have an alias pull double duty for normal vs znc connections, you can have logic to use 2 different echoes. I'm guessing $left($nick,1) == $chr(42) might do it?

Maroon thank you very much for the help. Your solution solved the problem.
Code:
echo -mt $+ $msgstamp

With this solution on znc connections or the rest, your solution presents the server-time or local time.

Thanks again.
Good year wink
© 2019 mIRC Discussion Forums