| View previous topic :: View next topic |
| Author |
Message |
Bidziil Voice
Joined: 15 Feb 2009 Posts: 7
|
Posted: Sun Sep 13, 2009 12:48 am Post subject: does this exist ? |
|
|
I am looking, without any luck, for a schedule script.
Basically it should have the triggers !Monday !Tuesday , etc.. one for every day of the week, and each trigger reads the days schedule from its own datafile, output being something like.....
<user> !Monday
<BOT> The schedule for Monday is:
<BOT> 8:00 AM to 10:00 AM Nancy
<BOT> 10:00 AM to 12:00 PM Fred
does something of this nature exist, and/or would it be easy to code up ?
thanks in advance for any help |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Sun Sep 13, 2009 7:19 am Post subject: |
|
|
I don't recall seeing such a script though I can't say I've specifically looked for one. I think the difficulty depends on a more complete explanation of your needs.
Does the script read a file created by some other means or is the script intended to both read and write data to the file? If the data file is created externally, then what is it's format?
Does the datafile store information for only seven days ie. Sunday through Saturday (easier), or does it need to store the date such that any number of Mondays, Tuesdays etc (but obviously different dates) can exist (difficult).
Does a daily event always have both a start time and an end time or can it have just a single event time?
If the script writes information, can only one event exist with a specific start time or event time on any particular day? Can time ranges for two or more events overlap?
Possibly there are other questions but the point I am making is that it could turn out to be a fairly big script to code from scratch and you are not really giving us much of a specification. Neither am I making any promises regarding coding it, but unless you ellaborate i don't think you'll get any takers. _________________ I must have had nothing to do |
|
| Back to top |
|
 |
Bidziil Voice
Joined: 15 Feb 2009 Posts: 7
|
Posted: Sun Sep 20, 2009 3:54 am Post subject: |
|
|
the script would only read the data file, preferably one data file for each of the seven daily triggers, a simple .txt or .dat file, which can be altered in notepad etc would be sufficient.
as far as the start and stop times, those would be altered as needed in the data file
pretty much, i am looking for something similar to the rulez2b.tcl that i found in the archive, but with the ability to have the seven triggers and responses |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Sun Sep 20, 2009 5:47 am Post subject: |
|
|
Requires that the files monday.txt, tuesday.txt etc are in the bot's root directory (same directory as the .conf file).
| Code: |
foreach dayname {sunday monday tuesday wednesday thursday friday saturday} {
bind PUB - !$dayname [list pDailySchedule $dayname]
}
proc pDailySchedule {dayname nick uhost hand chan text} {
if {[file exists ${dayname}.txt]} {
set id [open ${dayname}.txt r]
set schedule [split [read -nonewline $id] \n]
close $id
if {[llength $schedule] != 0} {
putserv "PRIVMSG $chan :Schedule for [string totitle $dayname]"
foreach item $schedule {
putserv "PRIVMSG $chan :$item"
}
} else {putserv "PRIVMSG $chan :There are no scheduled events for [string totitle $dayname]"}
} else {putserv "PRIVMSG $chan :Missing file ${dayname}.txt"}
return 0
}
|
_________________ I must have had nothing to do |
|
| Back to top |
|
 |
Bidziil Voice
Joined: 15 Feb 2009 Posts: 7
|
Posted: Sun Sep 20, 2009 2:51 pm Post subject: |
|
|
thank you so very much
installed and it is perfect
exactally what i wanted |
|
| Back to top |
|
 |
|