| View previous topic :: View next topic |
| Author |
Message |
WisH-GR Voice
Joined: 17 Aug 2009 Posts: 9
|
Posted: Mon Aug 17, 2009 4:56 am Post subject: on join notice |
|
|
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 |
|
 |
tueb Halfop
Joined: 04 Oct 2007 Posts: 76 Location: #quiz.de @ irc.gamesurge.net
|
Posted: Mon Aug 17, 2009 6:09 am Post subject: |
|
|
| 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 |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Mon Aug 17, 2009 3:50 pm Post subject: |
|
|
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 |
|
 |
Felix2003 Voice
Joined: 06 Feb 2009 Posts: 24
|
Posted: Tue Aug 18, 2009 8:02 pm Post subject: |
|
|
i stayed simple
| Code: | bind join - "#chan1 *!*@*" auto-messenge
proc auto-messenge {nick uhost handle chan} {
putquick "PRIVMSG #chan2 : !! <$nick> <$uhost> has joined #chan1 !! |
|
|
| Back to top |
|
 |
|