Here we go:awyeah wrote:Paste the script (procedure) here, so we can take a closer look.
Code: Select all
There we go:
proc proc:greet {nick mask hand chan} {
global greetchan greetvar greeting greetchan2 greeting2 greetchan3
global greeting3 greetchan4 greeting4 greetchan5 greeting5 greetchan6
global greeting6 greetchan7 greeting7 greetchan8 greeting8 greetchan9
global greeting9 greetchan10 greeting10 greetchan11 greeting11 greetchan12
global greeting12 greetchan13 greeting13 greetchan14 greeting14 greetchan15
global greeting15 greetchan16 greeting16 greetchan17 greeting17 greetchan18
global greeting18 greetchan19 greeting19 greetchan20 greeting20
if {[string match -nocase *$greetchan* $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " results
foreach line $results {
puthelp "Notice $nick :$line"
}
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting"
}
}
}
Code: Select all
#################################################
## greeting.tcl by kazoo ##
## www.conflabit.net ##
## david@conflabit.net ##
## ##
## Modifications by Ratman ##
## http://www.homecomputersecurity.net:81 ##
## ratman6@charter.net ##
#################################################
# For the channel greeting..
# You will need to set greeting.txt
# To your greeting in your eggdrop directory
# Only if your greetvar is set to 0
##############################
########## Variables #########
##############################
# Once these are set and have loaded once, You will have to
# Comment all of these out to make the set command work
#
#
# If you want greeting to read from greeting.txt set this to 0
# If you want it to read from the variable, set this to 1
set greetvar 1
# Set this to your Channel Greeting
set greeting "Welcome to #lobby. If you can see the message you are in the channel"
# Set this to your greeting channel
# * for all
set greetchan "#lobby"
# Repeat for the following 19.
# Leave blank if you don't need them
set greeting2 "Welcome to #teamchevelle. If you can see the message you are in the channel"
set greetchan2 "#teamchevelle"
set greeting3 "Welcome to #teamcamaro. If you can see the message you are in the channel"
set greetchan3 "#teamcamaro"
set greeting4 "Welcome to #apparition. If you can see the message you are in the channel"
set greetchan4 "#apparition"
set greeting5 "Welcome to #angellesavoie. If you can see the message you are in the channel"
set greetchan5 "#angellesavoie"
set greeting6 "Welcome to our channel!"
set greetchan6 "#yourchannel"
set greeting7 "Welcome to our channel!"
set greetchan7 "#yourchannel"
set greeting8 "Welcome to our channel!"
set greetchan8 "#yourchannel"
set greeting9 "Welcome to our channel!"
set greetchan9 "#yourchannel"
set greeting10 "Welcome to our channel!"
set greetchan10 "#yourchannel"
# Have fun!
############
## SCRIPT ##
############
bind join - * proc:greet
proc proc:greet {nick mask hand chan} {
global greetchan greetvar greeting greetchan2 greeting2 greetchan3
global greeting3 greetchan4 greeting4 greetchan5 greeting5 greetchan6
global greeting6 greetchan7 greeting7 greetchan8 greeting8 greetchan9
global greeting9 greetchan10 greeting10 greetchan11 greeting11 greetchan12
global greeting12 greetchan13 greeting13 greetchan14 greeting14 greetchan15
global greeting15 greetchan16 greeting16 greetchan17 greeting17 greetchan18
global greeting18 greetchan19 greeting19 greetchan20 greeting20
if {[string match -nocase "$greetchan" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting"
}
}
if {[string match -nocase "$greetchan2" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting2.txt" 0] [join [lrange "cat greeting2.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting2"
}
}
if {[string match -nocase "$greetchan3" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting3.txt" 0] [join [lrange "cat greeting3.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting3"
}
}
if {[string match -nocase "$greetchan4" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting4.txt" 0] [join [lrange "cat greeting4.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting4"
}
}
if {[string match -nocase "$greetchan5" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting5.txt" 0] [join [lrange "cat greeting5.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting5"
}
}
if {[string match -nocase "$greetchan6" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting6.txt" 0] [join [lrange "cat greeting6.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting6"
}
}
if {[string match -nocase "$greetchan7" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting7.txt" 0] [join [lrange "cat greeting7.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting7"
}
}
if {[string match -nocase "$greetchan8" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting8.txt" 0] [join [lrange "cat greeting8.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting8"
}
}
if {[string match -nocase "$greetchan9" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting9.txt" 0] [join [lrange "cat greeting9.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting9"
}
}
if {[string match -nocase "$greetchan10" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting10.txt" 0] [join [lrange "cat greeting10.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting10"
if {[string match -nocase "$greetchan11" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting11.txt" 0] [join [lrange "cat greeting2.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting11"
}
}
if {[string match -nocase "$greetchan12" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting12.txt" 0] [join [lrange "cat greeting3.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting12"
}
}
if {[string match -nocase "$greetchan13" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting13.txt" 0] [join [lrange "cat greeting4.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting13"
}
}
if {[string match -nocase "$greetchan14" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting14.txt" 0] [join [lrange "cat greeting5.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting14"
}
}
if {[string match -nocase "$greetchan15" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting15.txt" 0] [join [lrange "cat greeting6.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting15"
}
}
if {[string match -nocase "$greetchan16" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting16.txt" 0] [join [lrange "cat greeting7.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting16"
}
}
if {[string match -nocase "$greetchan17" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting17.txt" 0] [join [lrange "cat greeting8.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting17"
}
}
if {[string match -nocase "$greetchan18" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting18.txt" 0] [join [lrange "cat greeting9.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting18"
}
}
if {[string match -nocase "$greetchan19" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting19.txt" 0] [join [lrange "cat greeting10.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting19"
}
if {[string match -nocase "$greetchan20" $chan]} {
if {[string match -nocase "0" $greetvar]} {
regsub -all "\t" [split [exec [lindex "cat greeting20.txt" 0] [join [lrange "cat greeting10.txt" 1 end]]] \n] " " results
foreach line $results { puthelp "Notice $nick :$line" }
}
if {[string match -nocase "1" $greetvar]} {
putquick "Notice $nick :$greeting20"
}
}
}
bind pub n|f set cmd:setgreet
proc cmd:setgreet {nick host hand chan text} {
global greetchan greetvar greeting greetchan2 greeting2 greetchan3
global greeting3 greetchan4 greeting4 greetchan5 greeting5 greetchan6
global greeting6 greetchan7 greeting7 greetchan8 greeting8 greetchan9
global greeting9 greetchan10 greeting10 greetchan11 greeting11 greetchan12
global greeting12 greetchan13 greeting13 greetchan14 greeting14 greetchan15
global greeting15 greetchan16 greeting16 greetchan17 greeting17 greetchan18
global greeting18 greetchan19 greeting19 greetchan20 greeting20
if {[string match -nocase "greeting" $text"]} {
if {[string match -nocase "$greetchan" $chan]} {
set $greeting "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan2" $chan]} {
set $greeting2 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan3" $chan]} {
set $greeting3 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan4" $chan]} {
set $greeting4 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan5" $chan]} {
set $greeting5 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan6" $chan]} {
set $greeting6 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan7" $chan]} {
set $greeting7 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan8" $chan]} {
set $greeting8 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan9" $chan]} {
set $greeting9 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan10" $chan]} {
set $greeting10 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
if {[string match -nocase "$greetchan11" $chan]} {
set $greeting11 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan12" $chan]} {
set $greeting12 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan13" $chan]} {
set $greeting13 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan14" $chan]} {
set $greeting14 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan15" $chan]} {
set $greeting15 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan16" $chan]} {
set $greeting16 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan17" $chan]} {
set $greeting17 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan18" $chan]} {
set $greeting18 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan19" $chan]} {
set $greeting19 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
if {[string match -nocase "$greetchan20" $chan]} {
set $greeting20 "$text"
putserv "Notice $nick :Greeting for $chan set to $text"
}
}
}
putlog "greeting.tcl by kazoo (david@conflabit.net)With Mods by Ratman - LOADED!!"
# kazoo (david@conflabit.net)
I could not find any other script that would handle MULTIPLE channels and worked. Would there be an eaier way to get this script to support mutiple chans BTW/ I'd like it to maybe supprt 100 eventually (nice round number)awyeah wrote:Seriously... if I have time, I can rewrite this whole script in less than 10-15 lines, out of the total 200+ lines.
And still it will prove to be the same efficient, as it currently is!
There are very good, customizable greet scripts out there! Why did you specifically choose this one?
Code: Select all
#Define the channels for this script to work on
set greetchans "#chan1 #chan2 #chan3 #mychan #yourchan"
#Declare the global variable in the procedure
proc:greet {nick mask hand chan} {
global greetchans greetvar greeting
.....................
.....................
}
#This line will be used in your procedure after declaring the variables.
if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {
if {[string match -nocase "0" $greetvar]} {
...................
...................
}
Code: Select all
#################################
## greeting.tcl by kazoo ######
## www.conflabit.net ######
## david@conflabit.net ######
#################################
# For the channel greeting..
# You will need to set greeting.txt
# To your greeting in your eggdrop directory
# Only if your greetvar is set to 0
##############################
########## Variables #########
##############################
# Once these are set and have loaded once, You will have to
# Comment all of these out to make the set command work
#
#
# If you want greeting to read from greeting.txt set this to 0
# If you want it to read from the variable, set this to 1
set greetvar 1
# Set this to your Channel Greeting
set greeting "Welcome to #lobby. If you can see the message you are in the channel"
# Set this to your greeting channel
# * for all
set greetchan "#lobby"
# Repeat for the following 9.
# Leave blank if you don't need them
set greeting2 "Welcome to #teamchevelle. If you can see the message you are in the channel"
set greetchan2 "#teamchevelle"
set greeting3 "Welcome to #teamcamaro. If you can see the message you are in the channel"
set greetchan3 "#teamcamaro"
set greeting4 "Welcome to #apparition. If you can see the message you are in the channel"
set greetchan4 "#apparition"
set greeting5 "Welcome to #angellesavoie. If you can see the message you are in the channel"
set greetchan5 "#angellesavoie"
set greeting6 "Welcome to our channel!"
set greetchan6 "#yourchannel"
set greeting7 "Welcome to our channel!"
set greetchan7 "#yourchannel"
set greeting8 "Welcome to our channel!"
set greetchan8 "#yourchannel"
set greeting9 "Welcome to our channel!"
set greetchan9 "#yourchannel"
set greeting10 "Welcome to our channel!"
set greetchan10 "#yourchannel"
# Have fun!
############
## SCRIPT ##
############
bind join - * proc:greet
#Declare the global variable in the procedure
proc:greet {nick mask hand chan} {
global greetchans(0) greetvar greeting(0)
if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {
if {[string match -nocase "0" $greetvar]} {
Code: Select all
global greetchans(0) greetchans(1) greetvar greeting(0) greeting(1)
Code: Select all
global greetchans(0-100) or global greetchans(0 to 100)
Code: Select all
if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {
if {[string match -nocase "0" $greetvar]} {
}
}
Code: Select all
bind join - * greet_join
set greet_message "Your message here"
setudef flag greetmsg
proc greet_join {nick uhost hand channel} {
global greet_message
if {[isbotnick $nick] || ![channel get $channel greetmsg]} {
return 0
}
putquick "PRIVMSG $nick :$greet_message"
}
Code: Select all
#If you want greeting to read from greeting.txt set this to 0
#If you want it to read from the variable, set this to 1
set greetvar "1"
#Set this to your channel greeting
set greeting "Welcome to the channel. If you can see this message you are in the channel!"
#Set this to your greeting channels
set greetchans "#funchat #cyberparty #chatterz #beginner #allnitecafe"
bind join - * proc:greet
proc:greet {nick uhost hand chan} {
global greetvar greetchans
if {([lsearch -exact [split [string tolower $greetchans]] [string tolower $chan]] == -1)} {
if {([string equal $greetvar "0"])} {
regsub -all "\t" [split [exec [lindex "cat greeting.txt" 0] [join [lrange "cat greeting.txt" 1 end]]] \n] " " results
foreach line $results {
puthelp "Notice $nick :$line"
}
}
if {([string equal $greetvar "1"])} {
putquick "NOTICE $nick :$greeting"
}
}
}