| View previous topic :: View next topic |
| Author |
Message |
Nara Halfop
Joined: 23 Jul 2006 Posts: 40
|
Posted: Sun Jul 23, 2006 11:17 pm Post subject: Problem with bind pub |
|
|
I am attempting to bind pub a command that works in all channels, but then exclude channels from it using an if, something like this:
| Code: | bind pub - - @test proc:test
proc proc:test { nick host hand chan text } {
if {$chan != #chan} {
putquick "PRIVMSG $chan :Hi"
}
} |
However, when I use this, it creates an error, rather then executing it. If you could please give me the proper way to do a command like this, I would most appreciate it. |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Mon Jul 24, 2006 1:21 am Post subject: |
|
|
should be
|
|
| Back to top |
|
 |
Nara Halfop
Joined: 23 Jul 2006 Posts: 40
|
Posted: Mon Jul 24, 2006 7:40 am Post subject: |
|
|
| Erm, actually, I meant to do just one -. But would that be why the script isn't working (as in excluding the channel)? |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Jul 24, 2006 9:28 am Post subject: |
|
|
put #chan in double quotes
and use case-insensitive comparison, learn about Tcl [string] command _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
neo42 Voice
Joined: 19 Jul 2006 Posts: 5 Location: Alabama
|
Posted: Tue Jul 25, 2006 10:21 am Post subject: |
|
|
Look at this thread
http://forum.egghelp.org/viewtopic.php?t=11940
for a right elegant solution. You'd just need to put a ! in front of the if expression, changing the logic to "if this flag doesn't exist, do..." All that's left then is to .chanset #chan +flag on the chans you want to exclude. _________________ --------------------------------------------
Neo42
NetAdmin, StrandedIRC
irc://irc.strandedirc.com:7000
Come join us on the #island, mon!
ethercrash@yahoo.com |
|
| Back to top |
|
 |
Nara Halfop
Joined: 23 Jul 2006 Posts: 40
|
Posted: Tue Jul 25, 2006 10:53 am Post subject: |
|
|
Thanks. That topic helped a lot Neo and it gave me a better method.
~Century0 |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Tue Jul 25, 2006 4:13 pm Post subject: |
|
|
| your topic title said "problem with bind pub", so i gave you a valid answer to your bind mistake :p |
|
| Back to top |
|
 |
|