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 

Radio Countdown

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


Joined: 25 Jun 2008
Posts: 4

PostPosted: Wed Jun 25, 2008 1:09 pm    Post subject: Radio Countdown Reply with quote

Looking for a 3 minute countdown timer to allow the next dj that the next slot is freed up. Currently I have one for mirc, but would like to see something for the eggdrop so a dj could type a command like: !countdown and leave the work up to the bot.

Something that would leave it looking like:

Dj: !countdown
Bot: [3 minute countdown started]
Bot: [2 minutes]
Bot: [1 minute]
Bot: [45 seconds]
Bot: [30 seconds]
Bot: [20 seconds]
Bot: [10 seconds]
Bot: [5 seconds]
Bot: [1 second]
Bot: [GO GO GO]

TIA
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Thu Jun 26, 2008 4:47 am    Post subject: Reply with quote

Try this:
Code:
bind pub - !countdown cdn_start
proc cdn_start {n u h c a} {
   if {![info exists ::cdntimer($c)]} {
      cdn_next $c 0
   } else {
      # already counting on that channel - ignore request
   }
}
proc cdn_next {c i} {
   set msgs {
      "[3 minute countdown started]"
      "[2 minutes]"
      "[1 minute]"
      "[45 seconds]"
      "[30 seconds]"
      "[20 seconds]"
      "[10 seconds]"
      "[5 seconds]"
      "[1 second]"
      "[GO GO GO]"
   }
   set times {
      60 60 15 15 10 10 5 4 1
   }
   putquick "PRIVMSG $c :[lindex $msgs $i]"
   if {[llength $times]>$i} {
      set ::cdntimer($c) [utimer [lindex $times $i] [list cdn_next $c [incr i]]]
   } else {
      unset ::cdntimer($c)
   }
}

_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
padyo
Voice


Joined: 25 Jun 2008
Posts: 4

PostPosted: Thu Jun 26, 2008 7:19 pm    Post subject: Reply with quote

Awesome! Thank you. Works a charm.
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