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 

[SOLVED] Another help request: Time Driven Channel Post

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Seka
Voice


Joined: 19 Apr 2011
Posts: 18

PostPosted: Wed Apr 20, 2011 11:19 pm    Post subject: [SOLVED] Another help request: Time Driven Channel Post Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Apr 21, 2011 12:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Seka
Voice


Joined: 19 Apr 2011
Posts: 18

PostPosted: Thu Apr 21, 2011 9:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Seka
Voice


Joined: 19 Apr 2011
Posts: 18

PostPosted: Thu Apr 21, 2011 4:16 pm    Post subject: Reply with quote

Got it figured.
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 -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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