Advertisement
Guest User

Untitled

a guest
May 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3. use Xchat qw(:all);
  4.  
  5. register( "Op Everyone", "001", "Op everyone in a channel" );
  6.  
  7.  
  8. hook_command( "oall", sub {
  9. my @toopall = ();
  10. my $delay = 1;
  11. my $channel = get_info('channel');
  12. my $deal_throttle = get_prefs('net_throttle');
  13.  
  14. my $myinfo = user_info();
  15. if ( $myinfo->{prefix} && $myinfo->{prefix} ne '+' ) {
  16. my @all_users = get_list('users');
  17. my $context = get_context();
  18. if ($deal_throttle) {
  19. command('set -quiet net_throttle 0');
  20. }
  21. foreach my $this_user (@all_users) {
  22. if ( $this_user->{prefix} ne '+') {
  23. push(@toopall, $this_user->{nick});
  24. }
  25. if (scalar @toopall == 4) {
  26. command('timer '. $delay++ ." mode $channel +oooo " . join(' ', @toopall));
  27. @toopall = ();
  28. }
  29. }
  30. if ( scalar @toopall ) {
  31. command("timer $delay mode $channel +" . ('o' x scalar(@toopall)) . ' ' . join(' ', @toopall);
  32. }
  33. command('timer ' . $delay . ' set -quiet net_throttle ' . $deal_throttle);
  34. }
  35. return EAT_ALL;
  36. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement