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.

Problem with bind pub

Help for those learning Tcl or writing their own scripts.
Post Reply
N
Nara
Halfop
Posts: 40
Joined: Sun Jul 23, 2006 11:12 pm

Problem with bind pub

Post by Nara »

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.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

- -
should be

Code: Select all

-|-
N
Nara
Halfop
Posts: 40
Joined: Sun Jul 23, 2006 11:12 pm

Post by Nara »

Erm, actually, I meant to do just one -. But would that be why the script isn't working (as in excluding the channel)?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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

 tag when posting logs, code
n
neo42
Voice
Posts: 5
Joined: Wed Jul 19, 2006 11:59 pm
Location: Alabama
Contact:

Post by neo42 »

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
N
Nara
Halfop
Posts: 40
Joined: Sun Jul 23, 2006 11:12 pm

Post by Nara »

Thanks. That topic helped a lot Neo and it gave me a better method.

~Century0
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

your topic title said "problem with bind pub", so i gave you a valid answer to your bind mistake :p
Post Reply