mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2005
Posts: 44
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Sep 2005
Posts: 44
when i type /time it tells me Saturday September 24 2005 -- 05:59 -04:00 in the status window...

How can i do it so it says like

Server Time : 05:59 - September 24 2005 in the main chat window?

I've tried...

on *:TEXT:/time:*{
var %t = $iif($target == $chan,$chan,$nick)
msg %t $chan Server Time : $calc($gmt- $duration(6:0:0)
} but thats without the date.

any help to fix it?

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Code:
raw 391:*:{
  echo -s Server Time: $time($ctime($remove($gettok($1-,3-8,32),-)),HH:nn - mmmm dd yyyy)
  haltdef
}

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Kelders code will work, just change the 'echo -s' to 'msg $active' or 'msg #channame' or something if you want it to be displayed publically somewhere.

Also, i think you are confusing the on text event a little bit. The on text event is triggered only by what other people say. Anything that you type, such as text you type and send to a channel or commands you type, do not trigger the on text event.

The on INPUT event is triggerend when you press enter to send text to somewhere or type a command.

If your event was changed to on INPUT it would still fail to work correctly, this is because you are using trying to calculate the server time on your side rather than requesting the information from the server, you are making assumptions that all the servers use that specific timezone.

Furthermore, if you want other people to be able to request the server time from you with a command, add BOTH kelders code (remember to edit the 'echo -s' part) and add something like "ON *:TEXT:!servertime:#: /time". Of corse, this will tell them the time of the server you are on, not the one they are on that will almost certainly be different.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Link Copied to Clipboard