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 

Countdown to date in topic

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


Joined: 10 Mar 2005
Posts: 3
Location: Washington

PostPosted: Thu Mar 10, 2005 7:22 pm    Post subject: Countdown to date in topic Reply with quote

I run a convention site, with chat room and would like a way for the bot to change the topic to include the how many more days untill (this convention).

One of the things though is I need to be able to set multiple dates and multiple places. Because we work with other local conventions. So the topic would read:

"Topic: 340 more days till radcon!, 56 more days till norwescon! etc."

With perhaps certain things where you could say that when it was within a week he would say something different than just days. Like 2months and 3 days. or only one week away!

If this script is too complicated forgive me for asking Smile I am new here and don't know what is considered an allowable request.

Venus
_________________
I don't think I am evil, I know I am.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
greenbear
Owner


Joined: 24 Sep 2001
Posts: 733
Location: Norway

PostPosted: Thu Mar 10, 2005 11:48 pm    Post subject: Reply with quote

Code:
# set the name and date for the convention here
# convention name mm/dd/yy
set conventions {
  "radcon 04/25/05"
  "norwescon 07/11/2005"
  "and another convention 08/15/2005"
}

# channel
set convchan #channel

bind pub -|- !topconv pubconv
bind time - "00 00 * * *" convtime

proc pubconv {nick uhost hand chan text} {
 settopic
}

proc convtime {min hour day month year} {
 settopic
}

proc settopic {} {
 foreach c $::conventions {
  set conv [lrange $c 0 end-1]
  set when [clock scan [lindex $c end]]
  set days [expr ($when-[clock seconds])/86400]
  lappend topic "$days more days till [join $conv]!"
 }
 putserv "TOPIC $::convchan :[join $topic {, }]"
}

It will update the topic at midnight every night, and you can also type !topconv to update it.
Back to top
View user's profile Send private message Send e-mail
dhp1080
Voice


Joined: 14 Aug 2006
Posts: 8

PostPosted: Sat Nov 04, 2006 6:52 pm    Post subject: Reply with quote

Hi,

I suppose this topic is from over a year ago, but it still fits very well what I need, but not quite.

My topic is in the format of "http://example.com | <countdown> | Any text"

I'd really appreciate it if someone could slightly modify the above script to put it into that format, and maybe reupdate the topic whenever anyone changes it in case the countdown gets taken out accidentally.

Thanks in advance
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Nov 05, 2006 2:13 pm    Post subject: Reply with quote

That's not very easy to do if your topic constantly changes, so I wouldn't count on it anytime soon (unless the countdown should always be in the middle of the | | part (in which case, it wouldn't be very hard at all)
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Nov 05, 2006 5:04 pm    Post subject: Reply with quote

I'll make a modified version of my date.tcl script to handle events and setting topics. Gimme a few days to finish it.
Back to top
View user's profile Send private message
dhp1080
Voice


Joined: 14 Aug 2006
Posts: 8

PostPosted: Sun Nov 05, 2006 5:47 pm    Post subject: Reply with quote

metroid wrote:
That's not very easy to do if your topic constantly changes, so I wouldn't count on it anytime soon (unless the countdown should always be in the middle of the | | part (in which case, it wouldn't be very hard at all)


The countdown would always be in the || part, and the URL never changes. If someone were to erase the countdown part, i'd want the bot to go about fixing it and putting it back.

Thanks for the responses.
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