2 # UserDCC.pl: User Commands, DCC CHAT.
4 # Version: v0.2 (20010119)
5 # Created: 20000707 (from UserExtra.pl)
8 if (&IsParam("useStrict")) { use strict; }
16 if ($message =~ /^(exit|quit)$/i) {
17 # do ircII clients support remote close? if so, cool!
18 &status("userDCC: quit called. FIXME");
20 &status("userDCC: after dcc_close!");
26 if ($message =~ /^who$/) {
27 my $count = scalar(keys %{ $dcc{'CHAT'} });
28 my $dccCHAT = $message;
30 &pSReply("Start of who ($count users).");
31 foreach (keys %{ $dcc{'CHAT'} }) {
34 &pSReply("End of who.");
39 ### for those users with enough flags.
42 if ($message =~ /^4op(\s+($mask{chan}))?$/i) {
43 return unless (&hasFlag("o"));
52 if (!$channels{$chan}{'o'}{$ident}) {
53 &msg($who, "i don't have ops on $chan to do that.");
57 # on non-4mode(<4) servers, this may be exploited.
58 if ($channels{$chan}{'o'}{$who}) {
59 rawout("MODE $chan -o+o-o+o". (" $who" x 4));
61 rawout("MODE $chan +o-o+o-o". (" $who" x 4));
68 if ($message =~ /^backlog(\s+(.*))?$/i) {
69 return unless (&hasFlag("o"));
70 return unless (&hasParam("backlog"));
72 my $max = $param{'backlog'};
77 } elsif ($num !~ /^\d+/) {
78 &msg($who, "error: argument is not positive integer.");
80 } elsif ($num > $max or $num < 0) {
81 &msg($who, "error: argument is out of range (max $max).");
85 &msg($who, "Start of backlog...");
87 sleep 1 if ($_ % 4 == 0 and $_ != 0);
88 $conn->privmsg($who, "[".($_+1)."]: $backlog[$max-$num+$_]");
90 &msg($who, "End of backlog.");
96 if ($message =~ /^dumpvars$/i) {
97 return unless (&hasFlag("o"));
98 return unless (&IsParam("dumpvars"));
100 &status("Dumping all variables...");
107 if ($message =~ /^kick(\s+(\S+)(\s+(\S+))?)?/) {
108 return unless (&hasFlag("o"));
109 my ($nick,$chan) = (lc $2,lc $4);
116 if (&validChan($chan) == 0) {
117 &msg($who,"error: invalid channel \002$chan\002");
121 if (&IsNickInChan($nick,$chan) == 0) {
122 &msg($who,"$nick is not in $chan.");
132 if ($message =~ /^mode(\s+(.*))?$/) {
133 return unless (&hasFlag("n"));
134 my ($chan,$mode) = split /\s+/,$2,2;
141 if (&validChan($chan) == 0) {
142 &msg($who,"error: invalid channel \002$chan\002");
146 if (!$channels{$chan}{o}{$ident}) {
147 &msg($who,"error: don't have ops on \002$chan\002");
157 if ($message =~ /^part(\s+(\S+))?$/i) {
158 return unless (&hasFlag("o"));
161 if ($jchan !~ /^$mask{chan}$/) {
162 &msg($who, "error, invalid chan.");
167 if (!&validChan($jchan)) {
168 &msg($who, "error, I'm not on that chan.");
172 &msg($jchan, "Leaving. (courtesy of $who).");
177 # lobotomy. sometimes we want the bot to be _QUIET_.
178 if ($message =~ /^(lobotomy|bequiet)$/i) {
179 return unless (&hasFlag("o"));
182 &performReply("i'm already lobotomized");
184 &performReply("i have been lobotomized");
192 if ($message =~ /^(unlobotomy|benoisy)$/i) {
193 return unless (&hasFlag("o"));
196 &performReply("i have been unlobotomized, woohoo");
198 delete $cache{lobotomy};
199 # undef $cache{lobotomy}; # ??
201 &performReply("i'm not lobotomized");
208 if ($message =~ /^op(\s+(.*))?$/i) {
209 return unless (&hasFlag("o"));
214 if ($opee =~ /^(\S+)\s+(\S+)$/) {
217 if (!&validChan($2)) {
218 &msg($who,"error: invalid chan ($2).");
222 &msg($who,"error: invalid params.");
226 @chans = keys %channels;
232 next unless (&IsNickInChan($opee,$_));
234 if ($channels{$_}{'o'}{$opee}) {
235 &pSReply("op: $opee already has ops on $_");
240 &pSReply("opping $opee on $_");
245 &pSReply("op: opped on all possible channels.");
247 &DEBUG("op: found => '$found'.");
248 &DEBUG("op: op => '$op'.");
255 if ($message =~ /^deop(\s+(.*))?$/i) {
256 return unless (&hasFlag("o"));
261 if ($opee =~ /^(\S+)\s+(\S+)$/) {
264 if (!&validChan($2)) {
265 &msg($who,"error: invalid chan ($2).");
269 &msg($who,"error: invalid params.");
273 @chans = keys %channels;
279 next unless (&IsNickInChan($opee,$_));
281 if (!exists $channels{$_}{'o'}{$opee}) {
282 &status("deop: $opee already has no ops on $_");
287 &status("deopping $opee on $_ at ${who}'s request");
292 &status("deop: deopped on all possible channels.");
294 &DEBUG("deop: found => '$found'.");
295 &DEBUG("deop: op => '$op'.");
302 if ($message =~ s/^say\s+(\S+)\s+(.*)//) {
303 return unless (&hasFlag("o"));
304 my ($chan,$msg) = (lc $1, $2);
305 &DEBUG("chan => '$1', msg => '$msg'.");
307 if (&validChan($chan)) {
310 &msg($who,"i'm not on \002$1\002, sorry.");
316 if ($message =~ /^die$/) {
317 return unless (&hasFlag("n"));
321 &status("Dying by $who\'s request");
325 # global factoid substitution.
326 if ($message =~ m|^s([/,#])(.+?)\1(.*?)\1;?\s*$|) {
327 my ($delim,$op,$np) = ($1, $2, $3);
328 return unless (&hasFlag("n"));
329 ### TODO: support flags to do full-on global.
332 if ($np =~ /$delim/) {
333 &performReply("looks like you used the delimiter too many times. You may want to use a different delimiter, like ':' or '#'.");
337 ### TODO: fix up $op to support mysql/pgsql/dbm(perl)
338 ### TODO: => add db/sql specific function to fix this.
339 my @list = &searchTable("factoids", "factoid_key",
340 "factoid_value", $op);
343 &performReply("Expression didn't match anything.");
347 if (scalar @list > 100) {
348 &performReply("regex found more than 100 matches... not doing.");
352 &status("gsubst: going to alter ".scalar(@list)." factoids.");
353 &performReply("going to alter ".scalar(@list)." factoids.");
359 next if (&IsLocked($faqtoid) == 1);
360 my $result = &getFactoid($faqtoid);
362 &DEBUG("was($faqtoid) => '$was'.");
365 # we could support global local (once off).
366 if ($result =~ s/\Q$op/$np/gi) {
367 if (length $result > $param{'maxDataSize'}) {
368 &performReply("that's too long (or was long)");
371 &setFactInfo($faqtoid, "factoid_value", $result);
372 &status("update: '$faqtoid' =is=> '$result'; was '$was'");
374 &WARN("subst: that's weird... thought we found the string ($op) in '$faqtoid'.");
380 &ERROR("Some warnings/errors?");
383 &performReply("Ok... did s/$op/$np/ for ".
384 (scalar(@list) - $error)." factoids");
390 if ($message =~ /^jump(\s+(\S+))?$/i) {
391 return unless (&hasFlag("n"));
399 if ($2 =~ /^(\S+)(:(\d+))?$/) {
403 &msg($who,"invalid format.");
407 &status("jumping servers... $server...");
408 &rawout("QUIT :jumping to $server");
410 if (&irc($server,$port) == 0) {
416 if ($message =~ /^reload$/i) {
417 return unless (&hasFlag("n"));
419 &status("USER reload $who");
420 &pSReply("reloading...");
422 &pSReply("reloaded.");
428 if ($message =~ /^reset$/i) {
429 return unless (&hasFlag("n"));
431 &msg($who,"resetting...");
433 foreach ( keys %channels, keys %chanconf ) {
434 next if (grep /^\Q$_\E$/i, @done);
444 &status("USER reset $who");
445 &msg($who,"resetted");
451 if ($message =~ /^rehash$/) {
452 return unless (&hasFlag("n"));
454 &msg($who,"rehashing...");
456 &status("USER rehash $who");
457 &msg($who,"rehashed");
463 ##### USER//CHAN SPECIFIC CONFIGURATION COMMANDS
466 if ($message =~ /^chaninfo(\s+(.*))?$/) {
467 my @args = split /[\s\t]+/, $2; # hrm.
469 if (scalar @args != 1) {
474 if (!exists $chanconf{$args[0]}) {
475 &pSReply("no such channel $args[0]");
479 &pSReply("showing channel conf.");
480 foreach (sort keys %{ $chanconf{$args[0]} }) {
481 &pSReply("$chan: $_ => $chanconf{$args[0]}{$_}");
483 &pSReply("End of chaninfo.");
489 if ($message =~ /^(chanset|\+chan)(\s+(.*?))?$/) {
494 if (!defined $args) {
500 while ($args =~ s/^($mask{chan})\s*//) {
504 if (!scalar @chans) {
505 push(@chans, "_default");
509 my($what,$val) = split /[\s\t]+/, $args, 2;
511 ### TODO: "cannot set values without +m".
512 return unless (&hasFlag("n"));
515 if (defined $what and $what !~ /^[-+]/ and !defined $val and $no_chan) {
516 &pSReply("Showing $what values on all channels...");
519 foreach (keys %chanconf) {
520 my $val = $chanconf{$_}{$what} || "NOT-SET";
524 foreach (keys %vals) {
525 &pSReply(" $what = $_: ".join(' ', keys %{ $vals{$_} } ) );
528 &pSReply("End of list.");
533 ### TODO: move to UserDCC again.
534 if ($cmd eq "chanset" and !defined $what) {
535 &DEBUG("showing channel conf.");
537 foreach $chan ($chan, "_default") {
538 &pSReply("chan: $chan");
539 ### TODO: merge 2 or 3 per line.
542 foreach (sort keys %{ $chanconf{$chan} }) {
543 my $newstr = join(', ', @items);
544 if (length $newstr > 60) {
549 push(@items, "$_ => $chanconf{$chan}{$_}");
551 &pSReply(" $str") if (@items);
557 &chanSet($cmd, $_, $what, $val);
563 if ($message =~ /^(chanunset|\-chan)(\s+(.*))?$/) {
564 return unless (&hasFlag("n"));
568 if (!defined $args) {
575 if ($args =~ s/^(\-)?($mask{chan})\s*//) {
577 $delete = ($1) ? 1 : 0;
578 &DEBUG("chan => $chan.");
580 &VERB("no chan arg; setting to default.",2);
585 if (!exists $chanconf{$chan}) {
586 &pSReply("no such channel $chan");
592 if (!&getChanConf($args,$chan)) {
593 &pSReply("$args does not exist for $chan");
597 my @chans = &ChanConfList($args);
598 &DEBUG("scalar chans => ".scalar(@chans) );
599 if (scalar @chans == 1 and $chans[0] eq "_default" and !$no_chan) {
600 &psReply("ok, $args was set only for _default; unsetting for _defaul but setting for other chans.");
602 my $val = $chanconf{$_}{_default};
603 foreach (keys %chanconf) {
604 $chanconf{$_}{$args} = $val;
606 delete $chanconf{_default}{$args};
611 if ($no_chan and !exists($chanconf{_default}{$args})) {
612 &pSReply("ok, $args for _default does not exist, removing from all chans.");
614 foreach (keys %chanconf) {
615 next unless (exists $chanconf{$_}{$args});
616 &DEBUG("delete chanconf{$_}{$args};");
617 delete $chanconf{$_}{$args};
623 &pSReply("Unsetting channel ($chan) option $args. (was $chanconf{$chan}{$args})");
624 delete $chanconf{$chan}{$args};
630 &pSReply("Deleting channel $chan for sure!");
631 $utime_chanfile = time();
635 &pSReply("Leaving $chan...");
637 delete $chanconf{$chan};
639 &pSReply("Prefix channel with '-' to delete for sure.");
645 if ($message =~ /^newpass(\s+(.*))?$/) {
646 my(@args) = split /[\s\t]+/, $2 || '';
648 if (scalar @args != 1) {
653 my $u = &getUser($who);
654 my $crypt = &mkcrypt($args[0]);
656 &pSReply("Set your passwd to '$crypt'");
657 $users{$u}{PASS} = $crypt;
659 $utime_userfile = time();
665 if ($message =~ /^chpass(\s+(.*))?$/) {
666 my(@args) = split /[\s\t]+/, $2 || '';
673 if (!&IsUser($args[0])) {
674 &pSReply("user $args[0] is not valid.");
678 my $u = &getUser($args[0]);
680 &pSReply("Internal error, u = NULL.");
684 if (scalar @args == 1) { # del pass.
685 if (!&IsFlag("n") and $who !~ /^\Q$verifyUser\E$/i) {
686 &pSReply("cannto remove passwd of others.");
690 if (!exists $users{$u}{PASS}) {
691 &pSReply("$u does not have pass set anyway.");
695 &pSReply("Deleted pass from $u.");
697 $utime_userfile = time();
700 delete $users{$u}{PASS};
705 my $crypt = &mkcrypt($args[1]);
706 &pSReply("Set $u's passwd to '$crypt'");
707 $users{$u}{PASS} = $crypt;
709 $utime_userfile = time();
715 if ($message =~ /^chattr(\s+(.*))?$/) {
716 my(@args) = split /[\s\t]+/, $2 || '';
724 if ($args[0] =~ /^$mask{nick}$/i) { # <nick>
725 $user = &getUser($args[0]);
728 $user = &getUser($who);
729 &DEBUG("user $who... nope.") unless (defined $user);
730 $user = &getUser($verifyUser);
734 if (!defined $user) {
735 &pSReply("user does not exist.");
739 my $flags = $users{$user}{FLAGS};
740 if (!defined $chflag) {
741 &pSReply("Flags for $user: $flags");
745 &DEBUG("who => $who");
746 &DEBUG("verifyUser => $verifyUser");
747 if (!&IsFlag("n") and $who !~ /^\Q$verifyUser\E$/i) {
748 &pSReply("cannto change attributes of others.");
754 foreach (split //, $chflag) {
755 if ($_ eq "+") { $state = 1; next; }
756 if ($_ eq "-") { $state = 0; next; }
758 if (!defined $state) {
759 &pSReply("no initial + or - was found in attr.");
764 next if ($flags =~ /\Q$_\E/);
767 if (&IsParam("owner")
768 and $param{owner} =~ /^\Q$user\E$/i
769 and $flags =~ /[nmo]/
771 &pSReply("not removing flag $_ for $user.");
774 next unless ($flags =~ s/\Q$_\E//);
781 $utime_userfile = time();
783 &pSReply("Current flags: $flags");
784 $users{$user}{FLAGS} = $flags;
786 &pSReply("No flags changed: $flags");
792 if ($message =~ /^chnick(\s+(.*))?$/) {
793 my(@args) = split /[\s\t]+/, $2 || '';
795 if ($who eq "_default") {
796 &WARN("$who or verifyuser tried to run chnick.");
800 if (!scalar @args or scalar @args > 2) {
805 if (scalar @args == 1) { # 1
806 $user = &getUser($who);
807 &DEBUG("nope, not $who.") unless (defined $user);
808 $user ||= &getUser($verifyUser);
811 $user = &getUser($args[0]);
815 if (!defined $user) {
816 &pSReply("user $who or $args[0] does not exist.");
820 if ($user =~ /^\Q$chnick\E$/i) {
821 &pSReply("user == chnick. why should I do that?");
825 if (&getUser($chnick)) {
826 &pSReply("user $chnick is already used!");
830 if (!&IsFlag("n") and $who !~ /^\Q$verifyUser\E$/i) {
831 &pSReply("cannto change nick of others.");
832 return "REPLY" if ($who eq "_default");
836 foreach (keys %{ $users{$user} }) {
837 $users{$chnick}{$_} = $users{$user}{$_};
838 delete $users{$user}{$_};
840 undef $users{$user}; # ???
842 $utime_userfile = time();
845 &pSReply("Changed '$user' to '$chnick' successfully.");
850 if ($message =~ /^([-+])host(\s+(.*))?$/) {
852 my(@args) = split /[\s\t]+/, $3 || '';
853 my $state = ($1 eq "+") ? 1 : 0;
860 if ($who eq "_default") {
861 &WARN("$who or verifyuser tried to run $cmd.");
866 if ($args[0] =~ /^$mask{nick}$/i) { # <nick>
867 return unless (&hasFlag("n"));
868 $user = &getUser($args[0]);
871 # who or verifyUser. FIXME!!!
872 $user = &getUser($who);
876 if (!defined $user) {
877 &pSReply("user $user does not exist.");
881 if (!defined $mask) {
883 &pSReply("Hostmasks for $user: $users{$user}{HOSTS}");
888 if (!&IsFlag("n") and $who !~ /^\Q$verifyUser\E$/i) {
889 &pSReply("cannto change masks of others.");
893 if ($mask !~ /^$mask{nuh}$/) {
894 &pSReply("error: mask ($mask) is not a real hostmask.");
898 my $count = scalar keys %{ $users{$user}{HOSTS} };
901 if (exists $users{$user}{HOSTS}{$mask}) {
902 &pSReply("mask $mask already exists.");
906 ### TODO: override support.
907 $users{$user}{HOSTS}{$mask} = 1;
909 &pSReply("Added $mask to list of masks.");
913 if (!exists $users{$user}{HOSTS}{$mask}) {
914 &pSReply("mask $mask does not exist.");
918 ### TODO: wildcard support. ?
919 delete $users{$user}{HOSTS}{$mask};
921 if (scalar keys %{ $users{$user}{HOSTS} } != $count) {
922 &pSReply("Removed $mask from list of masks.");
924 &pSReply("error: could not find $mask in list of masks.");
929 $utime_userfile = time();
935 if ($message =~ /^([-+])ban(\s+(.*))?$/) {
938 my(@args) = split /[\s\t]+/, $3 || '';
939 my $state = ($1 eq "+") ? 1 : 0;
946 my($mask,$chan,$time,$reason);
948 if ($flatarg =~ s/^($mask{nuh})\s*//) {
951 &DEBUG("arg does not contain nuh mask?");
954 if ($flatarg =~ s/^($mask{chan})\s*//) {
957 $chan = "*"; # _default instead?
960 if ($state == 0) { # delete.
961 my @c = &banDel($mask);
968 &pSReply("Removed $mask from chans: @c");
970 &pSReply("$mask was not found in ban list.");
981 if ($flatarg =~ s/^(\d+)\s*//) {
983 &DEBUG("time = $time.");
985 &pSReply("error: time cannot be negatime?");
992 if ($flatarg =~ s/^(.*)$//) { # need length?
996 if (!&IsFlag("n") and $who !~ /^\Q$verifyUser\E$/i) {
997 &pSReply("cannto change masks of others.");
1001 if ($mask !~ /^$mask{nuh}$/) {
1002 &pSReply("error: mask ($mask) is not a real hostmask.");
1006 if ( &banAdd($mask,$chan,$time,$reason) == 2) {
1007 &pSReply("ban already exists; overwriting.");
1009 &pSReply("Added $mask for $chan (time => $time, reason => $reason)");
1014 if ($message =~ /^whois(\s+(.*))?$/) {
1017 if (!defined $arg) {
1022 my $user = &getUser($arg);
1023 if (!defined $user) {
1024 &pSReply("whois: user $user does not exist.");
1028 ### TODO: better (eggdrop-like) output.
1029 &pSReply("user: $user");
1030 foreach (keys %{ $users{$user} }) {
1031 my $ref = ref $users{$user}{$_};
1033 if ($ref eq "HASH") {
1035 ### DOES NOT WORK???
1036 foreach (keys %{ $users{$user}{$type} }) {
1037 &pSReply(" $type => $_");
1042 &pSReply(" $_ => $users{$user}{$_}");
1044 &pSReply("End of USER whois.");
1049 if ($message =~ /^bans(\s+(.*))?$/) {
1053 if ($arg ne "_default" and !&validChan($arg) ) {
1054 &pSReply("error: chan $chan is invalid.");
1059 if (!scalar keys %bans) {
1060 &pSReply("Ban list is empty.");
1065 &pSReply(" mask: expire, time-added, count, who-by, reason");
1066 foreach $c (keys %bans) {
1067 next unless (!defined $arg or $arg =~ /^\Q$c\E$/i);
1070 foreach (keys %{ $bans{$c} }) {
1071 my $val = $bans{$c}{$_};
1073 if (ref $val eq "ARRAY") {
1074 my @array = @{ $val };
1075 &pSReply(" $_: @array");
1077 &DEBUG("unknown ban: $val");
1081 &pSReply("END of bans.");
1086 if ($message =~ /^banlist(\s+(.*))?$/) {
1089 if (defined $arg and $arg !~ /^$mask_chan$/) {
1090 &pSReply("error: chan $chan is invalid.");
1094 &DEBUG("bans for global or arg => $arg.");
1095 foreach (keys %bans) { #CHANGE!!!
1096 &DEBUG(" $_ => $bans{$_}.");
1099 &DEBUG("End of bans.");
1100 &pSReply("END of bans.");
1105 if ($message =~ /^save$/) {
1106 return unless (&hasFlag("o"));
1110 &News::writeNews() if (&ChanConfList("news"));
1116 $message =~ s/^addignore/+ignore/;
1117 $message =~ s/^(del|un)ignore/-ignore/;
1120 if ($message =~ /^(\+|\-)ignore(\s+(.*))?$/i) {
1121 return unless (&hasFlag("o"));
1122 my $state = ($1 eq "+") ? 1 : 0;
1123 my $str = $1."ignore";
1131 my($mask,$chan,$time,$comment);
1134 if ($args =~ s/^($mask{nuh})\s*//) {
1137 &ERROR("no NUH mask?");
1141 if (!$state) { # delignore.
1142 if ( &ignoreDel($mask) ) {
1143 &pSReply("ok, deleted X ignores.");
1145 &pSReply("could not find $mask in ignore list.");
1155 if ($args =~ s/^($mask{chan}|\*)\s*//) {
1162 if ($args =~ s/^(\d+)\s*//) {
1172 $comment = "added by $who";
1175 if ( &ignoreAdd($mask, $chan, $time, $comment) > 1) {
1176 &pSReply("warn: $mask already in ignore list; written over anyway. FIXME");
1178 &pSReply("added $mask to ignore list.");
1184 if ($message =~ /^ignore(\s+(.*))?$/) {
1188 if ($arg !~ /^$mask{chan}$/) {
1189 &pSReply("error: chan $chan is invalid.");
1193 if (!&validChan($arg)) {
1194 &pSReply("error: chan $arg is invalid.");
1198 &pSReply("Showing bans for $arg only.");
1201 if (!scalar keys %ignore) {
1202 &pSReply("Ignore list is empty.");
1206 ### TODO: proper (eggdrop-like) formatting.
1208 &pSReply(" mask: expire, time-added, who, comment");
1209 foreach $c (keys %ignore) {
1210 next unless (!defined $arg or $arg =~ /^\Q$c\E$/i);
1213 foreach (keys %{ $ignore{$c} }) {
1214 my $ref = ref $ignore{$c}{$_};
1215 if ($ref eq "ARRAY") {
1216 my @array = @{ $ignore{$c}{$_} };
1217 &pSReply(" $_: @array");
1219 &DEBUG("unknown ignore line?");
1223 &pSReply("END of ignore.");
1229 if ($message =~ /^(\+|\-|add|del)user(\s+(.*))?$/i) {
1231 my $strstr = $1."user";
1232 my @args = split /\s+/, $3 || '';
1234 my $state = ($str =~ /^(\+|add)$/) ? 1 : 0;
1236 if (!scalar @args) {
1242 if (scalar @args != 2) {
1243 &pSReply(".+host requires hostmask argument.");
1246 } elsif (scalar @args != 1) {
1247 &pSReply("too many arguments.");
1251 if ($state) { # adduser.
1252 if (scalar @args == 1) {
1253 $args[1] = &getHostMask($args[0]);
1254 if (!defined $args[1]) {
1255 &ERROR("could not get hostmask?");
1260 if ( &userAdd(@args) ) { # success.
1261 &pSReply("Added $args[0]...");
1264 &pSReply("User $args[0] already exists");
1269 if ( &userDel($args[0]) ) { # success.
1270 &pSReply("Deleted $args[0] successfully.");
1273 &pSReply("User $args[0] does not exist.");
1280 if ($message =~ /^sched$/) {
1285 foreach (keys %sched) {
1286 next unless (exists $sched{$_}{TIME});
1287 $time{ $sched{$_}{TIME}-time() }{$_} = 1;
1290 next unless (exists $sched{$_}{RUNNING});
1295 foreach (sort { $a <=> $b } keys %time) {
1296 my $str = join(", ", sort keys %{ $time{$_} });
1297 &DEBUG("time => $_, str => $str");
1298 push(@time, "$str (".&Time2String($_).")");
1301 &pSReply( &formListReply(0, "Schedulers: ", @time ) );
1302 &pSReply( &formListReply(0, "Scheds to run: ", sort @list ) );
1303 &pSReply( &formListReply(0, "Scheds running(should not happen?) ", sort @run ) );