mIRC Home    About    Download    Register    News    Help

Print Thread
#120392 17/05/05 11:51 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
Is it possible that i make a mirc clock?
Like ppl say !time, the bot will show the time in US?

#120393 17/05/05 12:54 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It's possible, but the first problem that you've got is determining just what time is going to be reported? The US alone has (I think) 5 time zones, so you can't report a single time for all of the US.

#120394 17/05/05 01:41 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
American Central ?
is that a zone?
that's what my friend told me

#120395 17/05/05 02:11 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Central Time is a valid Time zone, for that time zone use
Code:
on *:text:!time:*:{
var %msg = $iif($target == $chan,$chan,$nick)
.msg %msg The current time in the Central Time Zone is $calc($gmt -  $duration(6:0:0) + $daylight)
}

#120396 17/05/05 02:22 PM
Joined: Aug 2004
Posts: 44
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Aug 2004
Posts: 44
Standard Time Zones in the US are Eastern-Central-Pacific But keep in mind that Eastern is 3 hours ahead of Pacific and 1 hour ahead of Central.

#120397 17/05/05 02:31 PM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
The current time in the Central Time Zone is 1116405106

The bot shows me that. I don't under by the 111..

will the bot be able to say it like :-

< bot > It is now: Tuesday May 17 »»9:26:05 Gametime

#120398 17/05/05 03:32 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Actually there are 5 in the continental US .. Eastern, Central, Mountain, Pacific, and Alaska (plus 2 off the continent, Aleutian and Hawaii (Hawaii is different only in the summer because they don't observe daylight savings time).


I refuse to engage in a battle of wits with an unarmed person. wink
#120399 17/05/05 06:30 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:text:!time:*:{
var %msg = $iif($target == $chan,$chan,$nick)
.msg %msg It is now $left($asctime($calc($gmt -  $duration(6:0:0) + $daylight)),-5) Game Time
}
 


Try this updated code. Not sure how to generate the »» to place in the date/time display

#120400 17/05/05 06:37 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I gave him code for the Central Time Zone because that was the time zone he asked for.

I'm in Canada, and we have 6 time zones.

#120401 18/05/05 06:17 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
RusselB, the bot respons works fine for me
but a little error.

01:06:30 am for us centrel

but my bot show's

< bot > It is now Wed May 18 17:06:02 Game Time

Alot of different from the real time

#120402 18/05/05 06:40 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Remove the + $daylight from the code

Not sure why it was giving that big a discrepancy, but when tested for my time zone (Eastern) it showed correct, with that missing, even though we are on Daylight savings time.

Maybe someone else can explain it.

#120403 18/05/05 06:58 AM
Joined: Mar 2005
Posts: 74
K
KidSol Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Mar 2005
Posts: 74
Thx! RusselB
it works now smile


Link Copied to Clipboard