I made a script which has 2 variables per putserv line. One variable from this two is always a date (eg Dec 19). Now I want to check if the variable I get is true with the current date. when yes the putserv line should be printed.
proc pub:testscript {nick host hand chan arg} {
<snap>
(the whole set for the variables)
if {$date0==[clock format [clock seconds] -format "%b %d"]} {
putserv "PRIVMSG $chan :\0031,15$date0 $report0\003"
if {$date1==[clock format [clock seconds] -format "%b %d"]} {
putserv "PRIVMSG $chan :\0031,15$date1 $report1\003"
if {$date2==[clock format [clock seconds] -format "%b %d"]} {
putserv "PRIVMSG $chan :\0031,15$date2 $report2\003"
if {$date3==[clock format [clock seconds] -format "%b %d"]} {
putserv "PRIVMSG $chan :\0031,15$date3 $report3\003"
}
}
}
} else {
putserv "PRIVMSG $chan :\0031,15 No data for \00312,15[clock format [clock seconds] -format "%b %d"]\0031,15\003"
}
}
So it doesn't work. I always only get one putserv line although there are eg 3 variables with the same/correct date. How do I have to changes this code that I get the two other variables too (in this example)?