View previous topic :: View next topic |
Author |
Message |
eggdropout Voice
Joined: 17 Oct 2005 Posts: 5
|
Posted: Mon Oct 17, 2005 7:59 pm Post subject: Need help with user defined flags |
|
|
Hi everyone,
I got a couple of questions I need answers to.
1. How to PRIVMSG all channels that have a certain user defined flag set to them? I know how to check if a trigger has come from a channel with a certain flag within a procedure:
Code: |
if { ![channel get $channel some_flag] } { return 0 }
|
but not how to PRIVMSG all chans that have a certain flag. And even more advanced, how to PRIVMSG all chans that have a certain flag except for the chan where the trigger came from (if, of course, this source chan has also been set with the same user defined flag)
2. I know its possible to use a couple of pub binds for one and the same procedure. Like this:
Code: |
bind pub - !quote pub:quote
bind pub - !qt pub:quote
bind pub - !addquote pub:quote
|
That's good, but how do I know (within the procedure) the specific bind that triggered it? In this case, was it !quote or !addquote or !qt?
Thats all guys, hope some of you will be able to answer. I searched through the forum and examined a couple of tcl scripts, but couldnt find what im looking for.
Thanks in advance. |
|
Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Oct 18, 2005 4:20 am Post subject: |
|
|
Code: | foreach chan [channels] {
if {[channel get $chan flag]} {
puthelp "privmsg $chan :message"
}
} |
and to not msg the channel where the command came from, simple add
Code: | && ![string equal -nocase $channel $chan] | in the if statement where $channel is the chan where the trigger was issued (from the pub bind). If you use !quote then (logically) pub:quote was triggered. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
Back to top |
|
 |
eggdropout Voice
Joined: 17 Oct 2005 Posts: 5
|
Posted: Wed Oct 19, 2005 2:09 am Post subject: |
|
|
that worked
thanks! |
|
Back to top |
|
 |
|