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.

[SOLVED] Another help request: Time Driven Channel Post

Help for those learning Tcl or writing their own scripts.
Post Reply
S
Seka
Voice
Posts: 18
Joined: Tue Apr 19, 2011 10:21 pm

[SOLVED] Another help request: Time Driven Channel Post

Post by Seka »

I have the following code in place:

Code: Select all

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: Select all

 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.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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.
S
Seka
Voice
Posts: 18
Joined: Tue Apr 19, 2011 10:21 pm

Post by Seka »

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: Select all

set tower_time [ctime $tell_time] 
But leave in:

Code: Select all

set tell_time [lindex $args 0] 
And add the 'args' variable?
S
Seka
Voice
Posts: 18
Joined: Tue Apr 19, 2011 10:21 pm

Post by Seka »

Got it figured.
Post Reply