This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Can this be done ?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
H
HVR
Voice
Posts: 6
Joined: Thu Dec 10, 2009 5:15 pm

Can this be done ?

Post by HVR »

I would like to know if it would be possible to have a time script which only gives the time in Eastern standard time.

Something like:

HVR !est
[bot] It is now 4:23 P.M. E.S.T.

I would be grateful for any help with this.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Assuming the bot is running on UTC (+0000) time

Code: Select all

 bind pub -|- !est pub:est

 proc pub:est {nick host hand chan text} {
  puthelp "PRIVMSG $chan :It is now [clock format [clock scan "5 hours ago"] -format "%H:%M %p"] E.S.T"
 }
:P
H
HVR
Voice
Posts: 6
Joined: Thu Dec 10, 2009 5:15 pm

Post by HVR »

thank you very much for coding this


the bot is running on GMT -6 I believe

installed and have the following result:

[21:39] <Burke> !est
[21:39] <RadioChick> It is now 15:39 PM E.S.T

My questions now would be, what do I change to get the time moved ahead 6 hours, and, how do I get it to display in regular time, not 24 hour format ?
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

EST is 5 hours behind UTC/GTM, so we would need to use

Code: Select all

 bind pub -|- !est pub:est

 proc pub:est {nick host hand chan text} {
  puthelp "PRIVMSG $chan :It is now [clock format [clock scan "1 hour"] -format "%I:%M %p"] E.S.T"
 }
and we use %I not %H if you want it in 12 hours not 24 hours.

Eggdrop goes off the shell's time, but i belive there is a patch to fix this available from the files page on the main website. But the settings are in eggdrop.conf file :)
H
HVR
Voice
Posts: 6
Joined: Thu Dec 10, 2009 5:15 pm

Post by HVR »

very cool !!!!!

thank you so much !!!!!!!!!!!
Post Reply