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.

Need help with user defined flags

Old posts that have not been replied to for several years.
Locked
e
eggdropout
Voice
Posts: 5
Joined: Mon Oct 17, 2005 4:14 pm

Need help with user defined flags

Post by eggdropout »

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

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

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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

 && ![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.
e
eggdropout
Voice
Posts: 5
Joined: Mon Oct 17, 2005 4:14 pm

Post by eggdropout »

that worked 8)

thanks!
Locked