Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- Xchat::hook_command("power", "power_main");
- use warnings;
- use strict;
- ### Main routine.
- sub power_main {
- my($networks, $oppedchans, $wholechannels);
- my $opped = my $whole = "0";
- my $oldcontext = Xchat::get_context();
- my @channels = Xchat::get_list("channels");
- foreach my $temp (@channels){
- my $chan = $temp->{"channel"};
- my $type = $temp->{"type"};
- if($type == "1"){
- $networks++;
- }
- if($type == "2"){
- Xchat::set_context("$chan");
- my $userinfo = Xchat::user_info();
- if($userinfo->{"prefix"} =~ /^[@~&]$/){
- my $users = Xchat::get_list("users");
- Xchat::set_context("$oldcontext");
- $oppedchans++;
- $wholechannels++;
- $opped = $opped + $users;
- $whole = $whole + $users;
- } else {
- my $uopusers = Xchat::get_list("users");
- Xchat::set_context("$oldcontext");
- $wholechannels++;
- $whole = $whole + $uopusers;
- }
- }
- }
- Xchat::command("say I'm opped in $oppedchans/$wholechannels channels on $networks network/s. I've got the power about $opped/$whole users.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement