I Dumped($self) and can't find anything resembling this... I can write a tracker plugin for this if there is not one already availible... one question how do I access one plugin's variables from another plugin
EG.
optrackers isop(user)
from genprotection
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We don't really have a facility for doing that. Really that should probably become part of UserUpdater and update some data structure in the channel object. Maybe something like isopped($nick) would be appropriate?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey... I've been through the sources I can't find any OBVIOUS reference to an IS OP except the one in the user module...
Is there a way to find out if a channel member is opped regardles of if they are or are not in or specified as an op in the config?
I Dumped($self) and can't find anything resembling this... I can write a tracker plugin for this if there is not one already availible... one question how do I access one plugin's variables from another plugin
EG.
optrackers isop(user)
from genprotection
thanks
We don't really have a facility for doing that. Really that should probably become part of UserUpdater and update some data structure in the channel object. Maybe something like isopped($nick) would be appropriate?
Yes, this would be good.
I had a fairly efficiant way of tracking ops and voices in my original script (before moving to perlbot)
Perhaps you can tailor this code for perlbot
(Forgive me for errors below, I'm retyping from memory, not tested source)
----- User Status Monitoring ----
sub ModeChange {
my $event = shift;
my @Args = @{$event->{args}};
my $modeline = shift(@Args);
my $chan = $event->{to}[0];
if ($modeline =~ /[ov]/) {
while ($modeline !~ /^([+-][a-z])+$/) {
$modeline =~ s/([+-])([a-z])([a-z])/$1$2$1$3/;
}
my @modes = $modeline =~ /([+-][a-z])/g;
my %modehash;
@modehash{@Args} = @modes;
while (my($Nick,$Mode) = each (%modehash)) {
if ($Mode == '-o') {
delete($UserTracking{$chan}{$Nick}{'op'});
} elsif ($Mode == '+o') {
$UserTracking{$chan}{$Nick}{op} = 1;
} elsif ($mode == '-v') {
delete($UserTracking{$chan}{$Nick}{'voice'});
} elsif ($Mode == '+o') {
$UserTracking{$chan}{$Nick}{'voice'} = 1;
}
my @NModes = keys(%{$UserTracking{$chan}{$Nick}});
if ($#NModes == -1) {
delete($UserTracking{$chan}{$Nick});
}
}
}
}
sub isopped {
$nick = $shift;
$chan = $shift;
return $UserTracking{$chan}{$Nick}{op};
}
sub isvoiced {
$nick = $shift;
$chan = $shift;
return $UserTracking{$chan}{$Nick}{voice};
}