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 

on join notice

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
WisH-GR
Voice


Joined: 17 Aug 2009
Posts: 9

PostPosted: Mon Aug 17, 2009 4:56 am    Post subject: on join notice Reply with quote

hello again.i need help with one more tcl.
i want my bot to send a msg to a channel #chan2 when a users joins channel #chan1.
for example if nickname user1 joins #chan1 i want the bot to say to #chan2
!! user1 has joined #chan1 !!
Back to top
View user's profile Send private message
tueb
Halfop


Joined: 04 Oct 2007
Posts: 76
Location: #quiz.de @ irc.gamesurge.net

PostPosted: Mon Aug 17, 2009 6:09 am    Post subject: Reply with quote

Code:
bind join - * on_joined
proc on_joined {nick host handle channel} {
  if {$channel == "#chan1"} {
      putserv "PRIVMSG #chan2 :!! $nick has joined #chan1 !!"
  }
}



i hope this will work.

just replace #chan1 and #chan2 with the real channel names.

tueb
_________________
#Quiz.de @ irc.GameSurge.net
JavaChat
Back to top
View user's profile Send private message Visit poster's website
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Mon Aug 17, 2009 3:50 pm    Post subject: Reply with quote

It is possible that the channel name passed to a proc as a consequence of a bind is somehow different in upper/lower case from the same channel name manually configured in a script, which would cause the following code fragment to fail :-

Code:

if {$channel == "#chan1"} {


The statement above is case sensitive. It is always better to use the following instead :-

Code:

if {[string equal -nocase $channel "#chan1"]} {

_________________
I must have had nothing to do
Back to top
View user's profile Send private message
Felix2003
Voice


Joined: 06 Feb 2009
Posts: 24

PostPosted: Tue Aug 18, 2009 8:02 pm    Post subject: Reply with quote

i stayed simple Smile

Code:
bind join - "#chan1 *!*@*" auto-messenge
proc auto-messenge {nick uhost handle chan} {
  putquick "PRIVMSG #chan2 : !! <$nick> <$uhost> has joined #chan1 !!
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 -> Script Requests 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