| View previous topic :: View next topic |
| Author |
Message |
Seka Voice
Joined: 19 Apr 2011 Posts: 18
|
Posted: Wed Apr 20, 2011 11:19 pm Post subject: [SOLVED] Another help request: Time Driven Channel Post |
|
|
I have the following code in place:
| Code: | bind time - "00 * * * *" clock
proc time:clock {min hour day month year} {
set tell_time [lindex $args 0]
set tower_time [ctime $tell_time]
if {$tower_time == 12:00} {
putquick "PRIVMSG $channel :\00306The clocktower tolls the Noon Bell."
}
elseif {$tower_time == 13:00} {
putquick "PRIVMSG $channl :\00306The clocktower tolls the First Bell."
}
} |
With the following error, as a result:
| Code: | | Tcl error [clock]: unknown or ambiguous subcommand "00": must be add, clicks, format, microseconds, milliseconds, scan, or seconds |
The error comes up every hour, so I know that part is functioning, at least. I'm just not sure what is keeping the bot from posting to the specified channel. $channel is defined earlier in the script.
Last edited by Seka on Thu Apr 21, 2011 4:16 pm; edited 1 time in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Apr 21, 2011 12:43 am Post subject: |
|
|
| Quote: |
set tell_time [lindex $args 0]
|
There's no 'args' variable, thus why the error. Why you get the time from 'ctime' if you already have it from the 'time:clock' procedure?
This has been already discussed here. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Seka Voice
Joined: 19 Apr 2011 Posts: 18
|
Posted: Thu Apr 21, 2011 9:38 am Post subject: |
|
|
I was under the impression that I would need to convert the time to something readable, in order to use the following commands properly.
So I should remove this:
| Code: | | set tower_time [ctime $tell_time] |
But leave in:
| Code: | | set tell_time [lindex $args 0] |
And add the 'args' variable? |
|
| Back to top |
|
 |
Seka Voice
Joined: 19 Apr 2011 Posts: 18
|
Posted: Thu Apr 21, 2011 4:16 pm Post subject: |
|
|
| Got it figured. |
|
| Back to top |
|
 |
|