This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

on join notice

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
W
WisH-GR
Voice
Posts: 9
Joined: Mon Aug 17, 2009 4:43 am

on join notice

Post by WisH-GR »

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 !!
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

Code: Select all

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
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

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: Select all

if {$channel == "#chan1"} {
The statement above is case sensitive. It is always better to use the following instead :-

Code: Select all

if {[string equal -nocase $channel "#chan1"]} {
I must have had nothing to do
F
Felix2003
Voice
Posts: 24
Joined: Fri Feb 06, 2009 8:19 pm

Post by Felix2003 »

i stayed simple :)

Code: Select all

bind join - "#chan1 *!*@*" auto-messenge
proc auto-messenge {nick uhost handle chan} {
  putquick "PRIVMSG #chan2 : !! <$nick> <$uhost> has joined #chan1 !!
Post Reply