| View previous topic :: View next topic |
| Author |
Message |
Rapfnny Voice
Joined: 16 May 2009 Posts: 8 Location: irc.Bob-Omb.net
|
Posted: Sat Jul 18, 2009 12:10 pm Post subject: Join through tcl script (/msg bot join #channel) [SOLVED] |
|
|
How can I make the bot join/part a channel through a pm?
I tried this:
| Code: |
bind MSG -|- "join" msg:join
bind MSG -|- "part" msg:part
proc msg:join {nick uhost handle text} {
set chan [lindex $text 0]
[channel add $chan]
putserv "PRIVMSG $chan :Invited by $nick"
}
proc msg:part {nick uhost handle text} {
set chan [lindex $text 0]
[channel remove $chan]
}
|
But when i do /msg bot join #channel
It joins, but it doesnt do the privmsg. I get this:
| Quote: | | Tcl error [msg:join]: invalid command name "" |
What can i do to fix this? _________________ Bob-Omb
Last edited by Rapfnny on Sun Jul 19, 2009 11:20 am; edited 1 time in total |
|
| Back to top |
|
 |
tomekk Master

Joined: 28 Nov 2008 Posts: 255 Location: Oswiecim / Poland
|
Posted: Sat Jul 18, 2009 1:02 pm Post subject: |
|
|
try:
| Code: | bind MSG -|- "join" msg:join
bind MSG -|- "part" msg:part
proc msg:join {nick uhost handle text} {
set chan [lindex [split $text] 0]
channel add $chan
putserv "PRIVMSG $chan :Invited by $nick"
}
proc msg:part {nick uhost handle text} {
set chan [lindex [split $text] 0]
channel remove $chan
}
|
|
|
| Back to top |
|
 |
Rapfnny Voice
Joined: 16 May 2009 Posts: 8 Location: irc.Bob-Omb.net
|
Posted: Sat Jul 18, 2009 1:18 pm Post subject: s |
|
|
:\ it didn't work
| Quote: |
[10:34] Tcl error [msg:join]: invalid command name ""
[10:34] joined #chan but didn't want to!
[10:34] Oops. Someone made me join #chan... leaving...
|
_________________ Bob-Omb |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Sun Jul 19, 2009 1:56 am Post subject: |
|
|
I couldn't for the life of me see where this script (modified by tomekk) was behaving in the way you have reported, so I loaded and tested it. It works fine for me (on DALnet, not that the network would make a difference).
Either you have not loaded this particular script or something is interfering with it's performance such as a .conf setting/configuration (maybe something like +inactive in global-chanset settings) or it is another script that you are using. _________________ I must have had nothing to do |
|
| Back to top |
|
 |
Rapfnny Voice
Joined: 16 May 2009 Posts: 8 Location: irc.Bob-Omb.net
|
Posted: Sun Jul 19, 2009 11:20 am Post subject: a |
|
|
Oh for some reason, it works now. Thank you. _________________ Bob-Omb |
|
| Back to top |
|
 |
|