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.

does this exist ?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
B
Bidziil
Voice
Posts: 7
Joined: Sun Feb 15, 2009 2:12 am

does this exist ?

Post by Bidziil »

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
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

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
B
Bidziil
Voice
Posts: 7
Joined: Sun Feb 15, 2009 2:12 am

Post by Bidziil »

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
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Requires that the files monday.txt, tuesday.txt etc are in the bot's root directory (same directory as the .conf file).

Code: Select all

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
B
Bidziil
Voice
Posts: 7
Joined: Sun Feb 15, 2009 2:12 am

Post by Bidziil »

thank you so very much
installed and it is perfect
exactally what i wanted
Post Reply