I would like to know if there is a way to do a specific set of commands weekly (eg. Saturdays 12:00) but the TIME bind only supports dates and not days
If there is anyone that can help, please just give me that bit of code
set days "Wednesday Saturday"
proc something {minute hour day month year} {
global days
if {[lsearch -exact [split [string tolower $days]] [string tolower [clock format [unixtime] -format %A]]] == -1} {
return 0
}
otherwise do this
}
bind time - "00 12 * * *" something
I tried this method and I didn't have much luck with it.
Here is my script
set days "Wednesday Sunday"
proc meeting {minute hour day month year} {
global days
if {[lsearch -exact [split [string tolower $days]] [string tolower [clock format [unixtime] -format %A]]] == -1} {
return 0
}
otherwise do this
}
set meeting_url "http://mywebpage.com"
bind time - "20 04 * * *" meeting_get
proc meeting_get {nick mask hand chan args} {
global meeting_url
set file [open "|lynx -source $meeting_url" r]
set html "[gets $file]"
regsub "<html><head><title></title></head><body>" $html "" html
putserv "NOTICE $nick $chan :$html "
}
If anyone has any ideas about this I would be happy to try them out. This is not giving me any errors at all. Its just not doing anything.
I know the parsing script works because I tried it our in an onjoin bind earlier.
All I really need this to do is post a few lines of text at these times and not parse an html file, but im new to this and the html thing worked. I didn't want to factor in too many things that could go wrong.
Instead of "otherwise do this" add your stuff to do when is one of thouse days from the days variable. Also, I think your regsub won't do what you intend to do, the notice you want to send with the result can have just one destination $chan or $nick and bouth don't have a variable so will fail to *work* .. either set them to something like set nick "somenickhere" or set chan "#somechannel" or put directly a nick or a channel you want to be the destination of the notice.
Bucko wrote:set the time bind to "45 12 * * *" for 12:45am and wablam automatically I should get my message appearing on Sundays and Wednesdays at 12:45 am.
Or do I need some sort if if statment in front of my set tclmsg... IE: if days = Sunday then blah blah blah
This bind would work, to make it prettier yo can bind to "45 12 *" instead (* matchs everything with spaces or no spaces)
Im still having problems would sombody be able to check this script.
Im not sure whats not functioning, but I've tested it with various times and I can't seem to even get the message to output.
set days "Sunday Wednesday"
proc something {minute hour day month year} {
global days
if {[lsearch -exact [split [string tolower $days]] [string tolower [clock format [unixtime] -format %A]]] == -1} {
return 0
}
set tclmsg "TCL is fun to learn when you've been up all night drinking coffee"
global tclmsg
putserv #NAChat :$tclmsg