+24Feb03=======================================================================
+1. add the 'run' command and the 'privilege' command to allow sysops to
+create scripts for people.
23Feb03=======================================================================
1. Added show/wm7d command (a US only callbook server) [by K1XX].
2. Added a prototype show/db0sdx command (w.i.p).
--- /dev/null
+#
+# check the privilege of the user is at least n
+#
+# Copyright (c) 1998 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @out;
+$line = '1' unless defined $line;
+push @out, $self->msg('e5') unless $line =~ /^\d+$/ && $self->priv >= $line;
+return (1, @out);
+
--- /dev/null
+#
+# the run command
+#
+# run a script from the scripts directory
+#
+# Copyright (c) 1998 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @f = split /\s+/, $line;
+my @out;
+
+while (@f) {
+ my $f = shift @f;
+
+ if (is_callsign(uc $f) && $self->priv < 8 && uc $f ne $self->call) {
+ push @out, $self->msg('e5');
+ next;
+ }
+ $f =~ s|[^-\w/]||g;
+ my $script = new Script(lc $f);
+ unless ($script) {
+ push @out, $self->msg('e3', 'script', $f);
+ next;
+ }
+ $script->run($self);
+}
+
+return (1, @out);
+
} else {
dbg($_) for @out;
}
+ last if @out && $l =~ /^pri?v?/;
}
}
}
use DXUtil;
use DXDebug;
use IO::File;
+use Time::HiRes qw(gettimeofday tv_interval);
use Curses 1.06;
use Console;
$khistpos = 0;
$spos = $pos = $lth = 0;
$inbuf = "";
+@time = ();
+
+$SIG{WINCH} = sub {@time = gettimeofday};
sub mydbg
{
$has_colors = has_colors();
do_initscr();
- $winch = 0;
- $SIG{'WINCH'} = sub {$winch = 1};
show_screen();
}
$lasttime = $t;
}
my $ch = $bot->getch();
- if ($winch) {
+ if (@time && tv_interval(\@time, [gettimeofday]) >= 1) {
# mydbg("Got Resize");
# do_resize();
next;