mIRC Home    About    Download    Register    News    Help

Print Thread
Server-time does not appear #264703 03/01/19 03:08 PM
Joined: Jul 2014
Posts: 126
Tiago Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 126
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

Last edited by Tiago; 03/01/19 03:18 PM.

TECO
irc.PTirc.org (IRCop)
Re: Server-time does not appear [Re: Tiago] #264704 03/01/19 05:00 PM
Joined: Feb 2015
Posts: 60
K
kap Offline
Babel fish
Offline
Babel fish
K
Joined: Feb 2015
Posts: 60


irc://irc.mircscripts.net:+6697/chat
Re: Server-time does not appear [Re: kap] #264706 04/01/19 12:25 AM
Joined: Jul 2014
Posts: 126
Tiago Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 126
Originally Posted By: kap

Thank you!


TECO
irc.PTirc.org (IRCop)
Re: Server-time does not appear [Re: kap] #264711 05/01/19 12:40 AM
Joined: Jul 2014
Posts: 126
Tiago Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 126
Originally Posted By: kap

Your suggestion did not work.


TECO
irc.PTirc.org (IRCop)
Re: Server-time does not appear [Re: Tiago] #264712 05/01/19 10:10 AM
Joined: Feb 2015
Posts: 60
K
kap Offline
Babel fish
Offline
Babel fish
K
Joined: Feb 2015
Posts: 60
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 (=


irc://irc.mircscripts.net:+6697/chat
Re: Server-time does not appear [Re: Tiago] #264713 05/01/19 11:00 AM
Joined: Dec 2002
Posts: 4,589
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,589
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?

Re: Server-time does not appear [Re: Khaled] #264714 05/01/19 12:38 PM
Joined: Jul 2014
Posts: 126
Tiago Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 126
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
}

Last edited by Tiago; 05/01/19 01:17 PM.

TECO
irc.PTirc.org (IRCop)
Re: Server-time does not appear [Re: Tiago] #264716 05/01/19 08:22 PM
Joined: Jul 2014
Posts: 126
Tiago Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 126
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.


TECO
irc.PTirc.org (IRCop)
Re: Server-time does not appear [Re: Tiago] #264717 05/01/19 10:46 PM
Joined: Jan 2004
Posts: 1,230
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,230
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?

Re: Server-time does not appear [Re: maroon] #264718 06/01/19 12:44 AM
Joined: Jul 2014
Posts: 126
Tiago Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Jul 2014
Posts: 126
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


TECO
irc.PTirc.org (IRCop)