broadcast.tcl

By krimson on May 11, 2006

This script basically sends out a specific message to all channels with a given delay. Useful for shell companies or channels that give out eggdrops.

### set the delay (in minutes) between broadcasts
set broadcast(time) 60

### set the broadcast message
set broadcast(message) ""

### set the channel (or channels separated by spaces) in 
### which you don't want to send the broadcast message
set broadcast(silent) ""

### check if message exists
### if message is not set, skip code
### else start timer
if {![info exists broadcast(message)]} { 
     putlog "broadcast.tcl : no message defined"
     } else {
           set announce:timer:info [timer exists announce:broadcast] 
           if {$announce:timer:info != ""} {
             killtimer $announce:timer:info
           }
             unset announce:timer:info
             timer $broadcast(time) announce:broadcast
         }

proc announce:broadcast {} {
   global broadcast
   foreach chan [channels] {
       if {![string match -nocase "*$chan*" "$broadcast(silent)"]} { 
          puthelp "PRIVMSG $chan :$broadcast(message)" 
       }
   }
   timer $broadcast(time) announce:broadcast 
}

putlog "LOADED broadcast.tcl by krimson"

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.