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.
Help for those learning Tcl or writing their own scripts.
Nara
Halfop
Posts: 40 Joined: Sun Jul 23, 2006 11:12 pm
Post
by Nara » Sun Jul 23, 2006 11:17 pm
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: Select all
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.
Nara
Halfop
Posts: 40 Joined: Sun Jul 23, 2006 11:12 pm
Post
by Nara » Mon Jul 24, 2006 7:40 am
Erm, actually, I meant to do just one -. But would that be why the script isn't working (as in excluding the channel)?
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Jul 24, 2006 9:28 am
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
neo42
Voice
Posts: 5 Joined: Wed Jul 19, 2006 11:59 pm
Location: Alabama
Contact:
Post
by neo42 » Tue Jul 25, 2006 10:21 am
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.
Nara
Halfop
Posts: 40 Joined: Sun Jul 23, 2006 11:12 pm
Post
by Nara » Tue Jul 25, 2006 10:53 am
Thanks. That topic helped a lot Neo and it gave me a better method.
~Century0
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Tue Jul 25, 2006 4:13 pm
your topic title said "problem with bind pub", so i gave you a valid answer to your bind mistake :p