####### Multi-channel onjoin messages - v1.0.0 by ppslim @ efnet
#     #
#  Allows you to set messages to be seen while joining a channel
#  Allthough this isn't much needed any more, due to a request of egghelpforum.com
#  I thought it wouldn't do much halm to add one
#     #
#  Just add the channels and there messages, and it is set to go
#     #
#######

###
# SETTINGS

# Set this to the channels and messges, follow the format of the examples
set ojcham {
{#test1} {welcome to test channel 1}
{#test2} {I see your in test channel 2}
}

# Do you want to use notices, or private messages - 0=notice - anything else=private message
# Notices goto the user, while private messages goto the channel
set ojtom 0

###
# THIS IS THE SCRIPT, SURE YA WANNA TOUCH

bind join - "*" oj:chan:message
proc oj:chan:message {nick uh hand chan} {
  global ojcham ojtom
  if {[set id [lsearch -exact [string tolower $ojcham] [string tolower $chan]]] != -1} {
    if {$ojtom == "0"} {
      putserv "NOTICE $nick :[lindex $ojcham [expr $id + 1]]"
    } {
      putserv "PRIVMSG $chan :[lindex $ojcham [expr $id + 1]]"
    }
  }
}
