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.

Needs

Old posts that have not been replied to for several years.
Locked
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

# Set channels:
set x(channel) "#bar1 #bar2"

bind need - op op:need

proc op:need {channel type} {
global botnick x
if {$type == "op" && [lsearch -exact [split [string tolower $x(channel)]] [string tolower $channel]] != -1)} {
bla bla bla..
}
return
}

If he needs op in the #foo he should not use op:need proc. If he wants op in #bar1 or #bar2 he should use op:need proc.
Right?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

In fact the line I was thinking to do the trick is the folowing:
if {[lsearch -exact $x(channels) $chan] == -1} {return 0}

Thanks mysefl :smile:
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

proc xstuff:need {channel type} {
global botnick x
if {[lsearch -exact $x(channels) $channel] == -1} {return 0}
if {$type == "op" && [onchan X $channel]} {
putserv "PRIVMSG X :eek:p $channel $botnick"
}
if {$type == "invite" && $channel == $x(channels)} {
putserv "PRIVMSG X :invite $channel $botnick"
}
bla bla bla
...

Do I have to put "if {[lsearch -exact $x(channels) $channel] == -1} {return 0}" at the each need? Or if I put it in only one place is for all needs?
Locked