egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

does this exist ?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Bidziil
Voice


Joined: 15 Feb 2009
Posts: 7

PostPosted: Sun Sep 13, 2009 12:48 am    Post subject: does this exist ? Reply with quote

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
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Sun Sep 13, 2009 7:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Bidziil
Voice


Joined: 15 Feb 2009
Posts: 7

PostPosted: Sun Sep 20, 2009 3:54 am    Post subject: Reply with quote

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
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Sun Sep 20, 2009 5:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Bidziil
Voice


Joined: 15 Feb 2009
Posts: 7

PostPosted: Sun Sep 20, 2009 2:51 pm    Post subject: Reply with quote

thank you so very much
installed and it is perfect
exactally what i wanted
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber