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 

botonchan problem

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


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sat May 12, 2012 5:38 pm    Post subject: botonchan problem Reply with quote

Hi, writing a very simple script containing /msg commands related to channel's stuff such op, deop, topic, etc.

I'm trying to make eggdrop send a msg to $nick when he requests a command for a channel where the bot is not on.
So, for an input /msg op #chan <nick> it would send a response "I'm not in #channel" (in the console there is already a message Tcl error [giveop]: illegal channel: #channelname).

This is a sample part of the script

Code:
bind msg o|o op giveop

proc giveop {nick uhost handle text} {
global botnick

set nickopped "[lindex [split $text] 1]"
set channel "[lindex [split $text] 0]"


if {![onchan $nickopped $channel]} {
putserv "NOTICE $nick :$nickopped is not on $channel"
return 1
}


putserv "MODE $channel +o $nickopped

}



I tried several things but none of them didn't work

Code:
if {![botonchan $channel]} {putserv "NOTICE $nick: I'm not on $channel"}

Code:
if {![onchan $botnick $channel]} {putserv "NOTICE $nick: I'm not on $channel"}

Code:
if {![validchan $channel]} {putserv "NOTICE $nick: I'm not on $channel"}


Could someone explain me why doesn't work this way? Thanks!
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat May 12, 2012 11:00 pm    Post subject: Re: if ![botonchan $channel] Reply with quote

Put a space between $nick and the colon.

Code:

if {![validchan $channel]} {putserv "NOTICE $nick :I'm not on $channel"}


Experiment with it that way.

I hope this helps.
Back to top
View user's profile Send private message
Torrevado
Op


Joined: 02 Aug 2006
Posts: 101

PostPosted: Sun May 13, 2012 10:58 am    Post subject: Reply with quote

Yes, solving that typo, it works.

Thank you very much, willyw Wink
Back to top
View user's profile Send private message
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