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.

Message at specific time

Old posts that have not been replied to for several years.
Locked
t
tonyrayo
Voice
Posts: 20
Joined: Thu Jul 31, 2003 3:29 pm
Location: Waldorf, MD
Contact:

Message at specific time

Post by tonyrayo »

Hello to all of the tcl coders out there! I am hoping someone could write a simple tcl script (I rather not be directed to a manual page, I sadly do not have the time to get into tcl now =/), or point me to an existing one. I want my bot to say a specific message two times a day (midnight and noon for example). Thank you VERY much for the help!. - tony
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

bind time "** *8 *" mytime

proc mytime {args} {
putserv "PRIVMSG #channel :This is a text that is posted at 8 & 18 o clock"
}

should work, for other times edit the time bind

other possibility : use timers

or : use a complete script, look for "time" in the tcl archive
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

GodOfSuicide wrote:bind time "** *8 *" mytime
I wouldn't do that :wink: as "*" will match 0 or more of any char you'll end up matching every minute if the day/month ends with "8". try "?? ?8*" instead :)
Last edited by user on Mon Nov 03, 2003 1:07 pm, edited 1 time in total.
Have you ever read "The Manual"?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

LOL

Post by De Kus »

try to think, before posting :D.
if you use * or ?? will be same ^^.
correct bind would be:
bind time - "00 ?8 *" mytime
(37) TIME (stackable)
bind time <flags> <mask> <proc>
proc-name <minute> <hour> <day> <month> <year>

Description: allows you to schedule procedure calls at certain
times. mask matches 5 space separated integers of the form:
"minute hour day month year". minute, hour, day, month have a
zero padding so they are exactly two characters long; year is
extended to four characters in the same way.
Module: core
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

* != ?

Post by user »

De Kus wrote:try to think, before posting :D.
*** MATCH CHARACTERS ***

Many of the bindings allow match characters in the arguments. Here
are the four special characters:

? matches any single character
* matches 0 or more characters of any type
% matches 0 or more non-space characters (can be used to match a single
word)
~ matches 1 or more space characters (can be used for whitespace between
words)
You're right about the first part matching every minute though :)
Have you ever read "The Manual"?
Locked