| View previous topic :: View next topic |
| Author |
Message |
wiiguy Voice
Joined: 30 Nov 2007 Posts: 9
|
Posted: Thu Dec 06, 2007 6:13 pm Post subject: |
|
|
| starpossen wrote: | Will try and mess around with that, by the way, I was wondering, would it be possible to a public command to show time left until set date?
like !xmas
and bot would respond with the timeleft. |
yes there is
| Code: | bind pub m "!xmas" count:down1
proc count:down1 {nick host handle channel text} {
set christmas "[duration [expr {[clock scan 12/25/07] - [clock seconds]}]]"
set newyear "[duration [expr {[clock scan 01/01/08] - [clock seconds]}]]"
puthelp "NOTICE $nick :$christmas before Christmas \[25th December, 2007\] and $newyear before New Year \[1st January, 2008\]"
} |
and i found out what the timezone the server is in it is in GMT and i am in GMT+1 so cany anyone help me ? |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
|
| Back to top |
|
 |
wiiguy Voice
Joined: 30 Nov 2007 Posts: 9
|
Posted: Fri Dec 07, 2007 4:10 am Post subject: |
|
|
i really meant with the script becaus i am still learning tcl.
so basically what i need is that he show the count down for GMT+1 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Dec 07, 2007 6:38 am Post subject: |
|
|
If your bot's timezone is GMT and yours is GMT+1 then you're 1 hour closer to Christmas and New year. So just subtract 3600 seconds from [clock seconds]:
| Code: | set christmas "[duration [expr {[clock scan 12/25/07] - [clock seconds] - 3600}]]"
set newyear "[duration [expr {[clock scan 01/01/08] - [clock seconds] - 3600}]]" |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|