| View previous topic :: View next topic |
| Author |
Message |
Snoopotic Voice
Joined: 10 Feb 2007 Posts: 4
|
Posted: Sat Feb 10, 2007 10:28 am Post subject: Help for delayed onjoinmessage excluding certain hosts |
|
|
Hi.
I need your help. FIrst the Code:
| Code: |
## set a var for your hosts
set matchHosts [list \
*@crew* \
*@root* \
*@bastard* \
*@services* \
*@*users*]
## then use that down here
proc join:message {nick uhost hand chan} {
foreach mask $::matchHosts {
if {![string match -nocase $mask $uhost]} {utimer 15 [list timed_message $nick]; return 0}
}
}
## put your binds after the proc
bind join - * join:message
proc timed_message {nick} {
puthelp "NOTICE $nick :Hi $nick, welcome to #channel... blabla :D"
} |
THe problem is: with this current code, the bot sends the delayed notice to ALL users joining that channel ALSO these one having this (v)host is specified above :/
Any ideas it might be inside the foreach - if thingy... but I'm out of my sources. Im not that tcl-freak and snipped the code together
Thanks for your help.
I use eggdrop *.18 under suse10 on an unrealircd |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Feb 10, 2007 10:51 am Post subject: |
|
|
your foreach is all wrong
try
| Code: |
## set a var for your hosts
set matchHosts [list \
*@crew* \
*@root* \
*@bastard* \
*@services* \
*@*users*]
## then use that down here
proc join:message {nick uhost hand chan} {
foreach mask $::matchHosts {
if {[string match -nocase $mask $uhost]} {return 0}
}
utimer 15 [list timed_message $nick]
}
## put your binds after the proc
bind join - * join:message
proc timed_message {nick} {
puthelp "NOTICE $nick :Hi $nick, welcome to #channel... blabla :D"
}
|
|
|
| Back to top |
|
 |
Snoopotic Voice
Joined: 10 Feb 2007 Posts: 4
|
Posted: Sat Feb 10, 2007 12:15 pm Post subject: |
|
|
Ha very fine, its qiet a more easy solution I thought it might be done by negotiating...
Nah. Thanks so much, works as I wanted it  |
|
| Back to top |
|
 |
|