mIRC Home    About    Download    Register    News    Help

Print Thread
#264703 03/01/19 03:08 PM
Joined: Jul 2014
Posts: 285
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 285
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 (Co-Admin)
Joined: Feb 2015
Posts: 128
kap Offline
Vogon poet
Offline
Vogon poet
Joined: Feb 2015
Posts: 128


GNU Terry Pratchett - Looking for a mIRC help channel -> Check #mircscripting @ irc.swiftirc.net
Joined: Jul 2014
Posts: 285
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 285
Originally Posted By: kap

Thank you!


TECO
irc.PTirc.org (Co-Admin)
Joined: Jul 2014
Posts: 285
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 285
Originally Posted By: kap

Your suggestion did not work.


TECO
irc.PTirc.org (Co-Admin)
Joined: Feb 2015
Posts: 128
kap Offline
Vogon poet
Offline
Vogon poet
Joined: Feb 2015
Posts: 128
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 (=


GNU Terry Pratchett - Looking for a mIRC help channel -> Check #mircscripting @ irc.swiftirc.net
Joined: Dec 2002
Posts: 5,244
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,244
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?

Joined: Jul 2014
Posts: 285
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 285
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 (Co-Admin)
Joined: Jul 2014
Posts: 285
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 285
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 (Co-Admin)
Joined: Jan 2004
Posts: 1,995
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,995
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?

Joined: Jul 2014
Posts: 285
TECO Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Jul 2014
Posts: 285
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 (Co-Admin)

Link Copied to Clipboard