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.

botonchan problem

Help for those learning Tcl or writing their own scripts.
Post Reply
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

botonchan problem

Post by Torrevado »

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: Select all

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: Select all

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

Code: Select all

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

Code: Select all

if {![validchan $channel]} {putserv "NOTICE $nick: I'm not on $channel"}
Could someone explain me why doesn't work this way? Thanks!
w
willyw
Revered One
Posts: 1205
Joined: Thu Jan 15, 2009 12:55 am

Re: if ![botonchan $channel]

Post by willyw »

Put a space between $nick and the colon.

Code: Select all

if {![validchan $channel]} {putserv "NOTICE $nick :I'm not on $channel"}
Experiment with it that way.

I hope this helps.
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

Post by Torrevado »

Yes, solving that typo, it works.

Thank you very much, willyw :wink:
Post Reply