Hi, I'm not sure if this is something that can be set directly in eggdrop or if it requires a sep. script (so feel free to move this to another forum if appropriate).
I'm looking for a way to have my bot greet only users with nicks following a certain pattern, e.g. Guest*. I found a greet script, but it looks like it'll greet every user:
set welc(msg) "hi %nick, welcome!"
set welc(chan) "#channel"
set welc(type) "1"
bind join - #channel* givewelcome
proc givewelcome {nick uhost hand chan} {
global welc
set welctxt $welc(msg)
regsub -all "%nick" $welctxt "$nick" welctxt
regsub -all "%chan" $welctxt "$chan" welctxt
switch $welc(type) {
1 { puthelp "NOTICE $nick :$welctxt" }
2 { puthelp "PRIVMSG $nick :$welctxt" }
}
}
putlog "Channel Greeting - Generated by http://www.egginfo.org - Frostbyte"
Can I modify this script or can you recommend any script to do this. I'm guessing just a if clause for $nick would work, but I don't know how to use wildcards/regex in tcl.
set guestnicks [list "*Guest*"]
bind join - * greet:gnick
proc greet:gnick {nick uhost hand chan {nn ""}} {
global guestnicks
if {$nn == ""} { set nn $nick }
if {![isbotnick $nick]} {
foreach guestnick $guestnicks {
if {[string match -nocase $guestnick $nn]} {
# wait a bit first, then send greeting
after 30000
putserv "PRIVMSG $chan :Hi $nick!"
break
}
}
}
}