egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Worldtime1.3.tcl working, again.
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Nov 25, 2007 12:27 pm    Post subject: Reply with quote

Code:
<speechles> !tz san fran
<sp33chy> The current time in San Francisco, California, United States is 8:24 AM Pacific Standard Time (PST) -0800 UTC @ Sunday, November 25, 2007

<speechles> !tz .fr australia
<sp33chy> The current time in Adelaide, South Australia, Australia is 02:55 Central Daylight Time (CDT) +1030 UTC @ lundi 26 novembre 2007

Corrected minor issue with script giving no reply. Method used to parse now allows for much greater changes in html, so minor website changes should no longer affect this script.
Enjoy WorldTime v1.3 available here.
Back to top
View user's profile Send private message
Exedore
Halfop


Joined: 27 Jan 2008
Posts: 43

PostPosted: Thu Apr 17, 2008 12:58 am    Post subject: Reply with quote

!This last upgrade works perfect!

BUT..

¿What should I do, to make the bot sends the text in spanish?

Code:

<speechles> !tz san fran
<sp33chy> La hora actual en San Francisco, California, Estados Unidos es 8:24 AM Pacific Standard Time (PST) -0800 UTC @ Domingo 25 de Noviembre de 2007


Or at least partially...

This TCL is great!

Thxs
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Apr 17, 2008 1:05 am    Post subject: Reply with quote

Exedore wrote:
!This last upgrade works perfect!

BUT..

¿What should I do, to make the bot sends the text in spanish?

Code:

<speechles> !tz san fran
<sp33chy> La hora actual en San Francisco, California, Estados Unidos es 8:24 AM Pacific Standard Time (PST) -0800 UTC @ Domingo 25 de Noviembre de 2007


Or at least partially...

This TCL is great!

Thxs

The partially part I can do for you, in fact, you already have the ability to do so.
Quote:
<speechles> !tz .es san francisco
<sp33chy> The current time in San Francisco, California, United States is 22:04 Pacific Daylight Time (PDT) -0700 UTC @ miércoles, 16 de abril de 2008
<speechles> !tz .fr new york
<sp33chy> The current time in New York, New York, United States is 01:08 Eastern Daylight Time (EDT) -0400 UTC @ jeudi 17 avril 2008
<speechles> !tz .it london
<sp33chy> The current time in London, United Kingdom is 6.08 DST +0100 UTC @ giovedì 17 aprile 2008

Unfortunately, you can see the parts which remain in english (this is a limitation of the website, not the script). But, you can use this for any regional dialect and it will work similar to how it does in the unoffficial google script.
Back to top
View user's profile Send private message
Exedore
Halfop


Joined: 27 Jan 2008
Posts: 43

PostPosted: Thu Apr 17, 2008 1:14 am    Post subject: Reply with quote

I understand...

anyway.. is a minor detail.

I switch this:
Code:
set lang "en"

For this:
Code:
set lang "es"


I don't know if is ok

'ES' of Español

Or should be 'SP'?
for Spanish?..
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Apr 17, 2008 1:30 am    Post subject: Reply with quote

Exedore wrote:
I understand...

anyway.. is a minor detail.

I switch this:
Code:
set lang "en"

For this:
Code:
set lang "es"


I don't know if is ok

'ES' of Español

Or should be 'SP'?
for Spanish?..


Sure you can change that for the default behavior to be 'ES'.
Then if someone uses just !tz <somewhere> it will give spanish flavored results instead of english. But they can also at anytime, !tz .fr <somewhere> and get french results, even tho you have set that to 'ES'. Do you understand?
The script has a dual behavior. It will let you dynamically select your language when you trigger it (behavior 2). Or, If they choose not to give a language when they trigger it, they will instead be given the default (set lang "XX") language (behavior 1). This follows exactly how the unofficial google script works when dealing with languages, it has dual behavior as well.

And for any curious, this agent line is how languages are handled before loading the html.
Code:
puts $tzsock "Accept-Language: ${lang}-${lang},${lang};q=0.9,${lang};q=0.8,${lang};q=0.7,*;q=0.6"
Back to top
View user's profile Send private message
LOQUILLO
Voice


Joined: 21 Jul 2004
Posts: 14
Location: Perú

PostPosted: Mon Oct 27, 2008 4:47 pm    Post subject: Reply with quote

Updated main post. Fixed typo.
_________________
LOQUILLO
IRC Network: EFnet
Channel: #Spanglish
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kettavan
Voice


Joined: 02 Jan 2009
Posts: 1
Location: Malaysia

PostPosted: Fri Jan 02, 2009 8:31 am    Post subject: Still not working..... Reply with quote

guys i have tried it but yet not working...

[20:29pm] <@kettavan> !tz miami
[20:29pm] <@tami|an> The time in Miami,United States is

Help me plz.......
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
LOQUILLO
Voice


Joined: 21 Jul 2004
Posts: 14
Location: Perú

PostPosted: Sun Sep 13, 2009 11:14 pm    Post subject: Re: Still not working..... Reply with quote

kettavan wrote:
guys i have tried it but yet not working...

[20:29pm] <@kettavan> !tz miami
[20:29pm] <@tami|an> The time in Miami,United States is

Help me plz.......

Strange, it's working for me.
<LOQUILLO_> !tz miami
<mario_sp> The current time in Miami, Florida, United States is 11:13 PM Eastern Daylight Time (EDT) -0400 UTC @ Sunday, September 13, 2009
_________________
LOQUILLO
IRC Network: EFnet
Channel: #Spanglish
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Fri Nov 20, 2009 6:28 am    Post subject: Reply with quote

I wrote a new worldtime.tcl which no longer uses a website to get the data.

I thought you may find this useful...

http://www.hm2k.com/posts/worldtime-tcl

Hope this helps.
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Mon Feb 01, 2010 6:30 am    Post subject: speechles' worldtime Reply with quote

speechles, worldtime is not working for me...
Quote:
Tcl error [pub_world_time]: can't read "tzzone": no such variable


About hm2k's script, if I'm not wrong it's a timezone script, not worldtime, isn't it?

Thanks.
Back to top
View user's profile Send private message
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Mon Feb 01, 2010 6:39 am    Post subject: Reply with quote

It's both.

Quote:
The zoneinfo database, also called the tz database, is a collaborative compilation of information about the world's time zones.


See http://en.wikipedia.org/wiki/Zoneinfo

What were you expecting?
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Mon Feb 01, 2010 7:37 am    Post subject: Reply with quote

What I meant is this:
Quote:
<torrevado> .tz Madrid
<eggbot> torrevado, The time for the Europe/Madrid timezone is Mon Feb 01 13:35:29 2010


That is the timezone, not the real time, which is 12:35:29.
Back to top
View user's profile Send private message
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Mon Feb 01, 2010 8:11 am    Post subject: Reply with quote

It has nothing to do with timezones vs "real time" as they are the same thing.

Unfortunately, there appears to be an issue with the script...

Quote:

[11:59:23 am] > .tz London
[11:59:24 am] <Bot> HM2K, The time for the Europe/London timezone is Mon Feb 01 12:58:03 2010


It appears the script returns the time one hour ahead.

The problem stems from [clock seconds].

If [clock seconds] is too fast, your system clock may be wrong.

Code:
[root@blade ~]# ntpdate uk.pool.ntp.org
 1 Feb 12:13:03 ntpdate[20281]: step time server 82.219.4.31 offset -3642.419450 sec


That fixed it for me...

Quote:

[12:17:10 pm] > .tz London
[12:17:11 pm] <Bot> HM2K, The time for the Europe/London timezone is Mon Feb 01 12:15:08 2010
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Mon Feb 01, 2010 9:06 am    Post subject: Reply with quote

hm2k, I have a question...

your solution would change server time? I'm not root, just have a shell account, so:
Quote:
1 Feb 13:04:30 ntpdate[88094]: bind() fails: Permission denied

Obviously admins won't change server time to match my needs.

Thanks.
Back to top
View user's profile Send private message
hm2k
Halfop


Joined: 11 Sep 2006
Posts: 57
Location: UK

PostPosted: Mon Feb 01, 2010 10:36 am    Post subject: Reply with quote

You need to be root to issue that command. Speak to your system administrators.

There's no two ways about it, their system clock is incorrect and it is in their best interest to fix it.

However, I am working on updating the script to use the ntp protocol rather than the system time, but it's not working yet and is less reliable.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 2 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber