egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Rapfnny
Voice


Joined: 16 May 2009
Posts: 8
Location: irc.Bob-Omb.net

PostPosted: Sat Jul 18, 2009 12:10 pm    Post subject: Join through tcl script (/msg bot join #channel) [SOLVED] Reply with quote

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
View user's profile Send private message Visit poster's website
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Sat Jul 18, 2009 1:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Rapfnny
Voice


Joined: 16 May 2009
Posts: 8
Location: irc.Bob-Omb.net

PostPosted: Sat Jul 18, 2009 1:18 pm    Post subject: s Reply with quote

:\ 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
View user's profile Send private message Visit poster's website
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Sun Jul 19, 2009 1:56 am    Post subject: Reply with quote

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
View user's profile Send private message
Rapfnny
Voice


Joined: 16 May 2009
Posts: 8
Location: irc.Bob-Omb.net

PostPosted: Sun Jul 19, 2009 11:20 am    Post subject: a Reply with quote

Oh for some reason, it works now. Thank you.
_________________
Bob-Omb
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber