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 

Need help with user defined flags

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
eggdropout
Voice


Joined: 17 Oct 2005
Posts: 5

PostPosted: Mon Oct 17, 2005 7:59 pm    Post subject: Need help with user defined flags Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Oct 18, 2005 4:20 am    Post subject: Reply with quote

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


Joined: 17 Oct 2005
Posts: 5

PostPosted: Wed Oct 19, 2005 2:09 am    Post subject: Reply with quote

that worked Cool

thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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