| View previous topic :: View next topic |
| Author |
Message |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sat May 12, 2012 5:38 pm Post subject: botonchan problem |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat May 12, 2012 11:00 pm Post subject: Re: if ![botonchan $channel] |
|
|
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 |
|
 |
Torrevado Op
Joined: 02 Aug 2006 Posts: 101
|
Posted: Sun May 13, 2012 10:58 am Post subject: |
|
|
Yes, solving that typo, it works.
Thank you very much, willyw  |
|
| Back to top |
|
 |
|