| View previous topic :: View next topic |
| Author |
Message |
quantum0726 Voice
Joined: 03 Mar 2006 Posts: 9
|
Posted: Sun Mar 05, 2006 4:25 am Post subject: Greet script for selected users |
|
|
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:
| Code: | 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.
Thanks much! |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Mar 05, 2006 11:41 pm Post subject: |
|
|
Maybe alter this script
| Code: |
set badnicks [list "*Guest*"]
bind join - * ban:bnick
bind nick - * ban:bnick
proc ban:bnick {nick uhost hand chan {nn ""}} {
global badnicks
set bbanmask "*$nick*!*@*"
if {$nn == ""} { set nn $nick }
if {![isbotnick $nick]} {
foreach badnick $badnicks {
if {[string match -nocase $badnick $nn]} {
putserv "MODE $chan +b $bbanmask"
putserv "KICK $chan $nick :Guest Nicks not allowed."
break
}
}
}
}
|
|
|
| Back to top |
|
 |
quantum0726 Voice
Joined: 03 Mar 2006 Posts: 9
|
Posted: Tue Mar 07, 2006 5:27 pm Post subject: |
|
|
Thanks cache! I modified the script a bit and it's working well.
| Code: |
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
}
}
}
}
|
|
|
| Back to top |
|
 |
|