egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help for delayed onjoinmessage excluding certain hosts

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Snoopotic
Voice


Joined: 10 Feb 2007
Posts: 4

PostPosted: Sat Feb 10, 2007 10:28 am    Post subject: Help for delayed onjoinmessage excluding certain hosts Reply with quote

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 Very Happy
Thanks for your help.
I use eggdrop *.18 under suse10 on an unrealircd
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Feb 10, 2007 10:51 am    Post subject: Reply with quote

your foreach is all wrong Smile

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
View user's profile Send private message
Snoopotic
Voice


Joined: 10 Feb 2007
Posts: 4

PostPosted: Sat Feb 10, 2007 12:15 pm    Post subject: Reply with quote

Ha very fine, its qiet a more easy solution Very Happy I thought it might be done by negotiating...
Nah. Thanks so much, works as I wanted it Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber