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.

Join through tcl script (/msg bot join #channel) [SOLVED]

Help for those learning Tcl or writing their own scripts.
Post Reply
R
Rapfnny
Voice
Posts: 8
Joined: Sat May 16, 2009 8:31 pm
Location: irc.Bob-Omb.net
Contact:

Join through tcl script (/msg bot join #channel) [SOLVED]

Post by Rapfnny »

How can I make the bot join/part a channel through a pm?
I tried this:

Code: Select all

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:
Tcl error [msg:join]: invalid command name ""
What can i do to fix this?
Last edited by Rapfnny on Sun Jul 19, 2009 11:20 am, edited 1 time in total.
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

try:

Code: Select all

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
}
R
Rapfnny
Voice
Posts: 8
Joined: Sat May 16, 2009 8:31 pm
Location: irc.Bob-Omb.net
Contact:

s

Post by Rapfnny »

:\ it didn't work
[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...
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

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
R
Rapfnny
Voice
Posts: 8
Joined: Sat May 16, 2009 8:31 pm
Location: irc.Bob-Omb.net
Contact:

a

Post by Rapfnny »

Oh for some reason, it works now. Thank you.
Post Reply