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.
Help for those learning Tcl or writing their own scripts.
Rapfnny
Voice
Posts: 8 Joined: Sat May 16, 2009 8:31 pm
Location: irc.Bob-Omb.net
Contact:
Post
by Rapfnny » Sat Jul 18, 2009 12:10 pm
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.
tomekk
Master
Posts: 255 Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:
Post
by tomekk » Sat Jul 18, 2009 1:02 pm
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
}
Rapfnny
Voice
Posts: 8 Joined: Sat May 16, 2009 8:31 pm
Location: irc.Bob-Omb.net
Contact:
Post
by Rapfnny » Sat Jul 18, 2009 1:18 pm
:\ 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...
arfer
Master
Posts: 436 Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK
Post
by arfer » Sun Jul 19, 2009 1:56 am
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
Rapfnny
Voice
Posts: 8 Joined: Sat May 16, 2009 8:31 pm
Location: irc.Bob-Omb.net
Contact:
Post
by Rapfnny » Sun Jul 19, 2009 11:20 am
Oh for some reason, it works now. Thank you.