egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with bind pub

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Nara
Halfop


Joined: 23 Jul 2006
Posts: 40

PostPosted: Sun Jul 23, 2006 11:17 pm    Post subject: Problem with bind pub Reply with quote

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
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Mon Jul 24, 2006 1:21 am    Post subject: Reply with quote

Code:
- -


should be

Code:
-|-
Back to top
View user's profile Send private message
Nara
Halfop


Joined: 23 Jul 2006
Posts: 40

PostPosted: Mon Jul 24, 2006 7:40 am    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Mon Jul 24, 2006 9:28 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
neo42
Voice


Joined: 19 Jul 2006
Posts: 5
Location: Alabama

PostPosted: Tue Jul 25, 2006 10:21 am    Post subject: Reply with quote

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! Smile
ethercrash@yahoo.com
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Nara
Halfop


Joined: 23 Jul 2006
Posts: 40

PostPosted: Tue Jul 25, 2006 10:53 am    Post subject: Reply with quote

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

~Century0
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Tue Jul 25, 2006 4:13 pm    Post subject: Reply with quote

your topic title said "problem with bind pub", so i gave you a valid answer to your bind mistake :p
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber