1. added the start of script files on login/startup. You can now add
authorminima <minima>
Fri, 14 Sep 2001 17:50:19 +0000 (17:50 +0000)
committerminima <minima>
Fri, 14 Sep 2001 17:50:19 +0000 (17:50 +0000)
commands (for example to set variables) to a file called
/spider/scripts/startup. You can also put in scripts for a callsign which
will be executed when that callsign logs on. A sample script is in the
directory (you did remember to do cvs update -d?). User settable versions
of this will happen when the general mechanism for doing that is available.
2. Added set/unset/anntalk commands. If you unset/anntalk then you will
no longer see many of the of talk like announces. Unfortunately you may
miss the odd useful one as well (but since everything is repeated many times
you probably won't :-)

Changes
cmd/Commands_en.hlp
cmd/set/anntalk.pl [new file with mode: 0644]
cmd/unset/anntalk.pl [new file with mode: 0644]
perl/DXChannel.pm
perl/DXCommandmode.pm
perl/DXProt.pm
perl/DXUser.pm
perl/Messages
perl/cluster.pl
scripts/startup.issue [new file with mode: 0644]

diff --git a/Changes b/Changes
index cc0bae52a287580dfc93e41e36d4abe283090b18..4e77eca50bbea59bea04e970f16722c146cbda9e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,14 @@
+14Sep01=======================================================================
+1. added the start of script files on login/startup. You can now add 
+commands (for example to set variables) to a file called 
+/spider/scripts/startup. You can also put in scripts for a callsign which
+will be executed when that callsign logs on. A sample script is in the
+directory (you did remember to do cvs update -d?). User settable versions
+of this will happen when the general mechanism for doing that is available.
+2. Added set/unset/anntalk commands. If you unset/anntalk then you will
+no longer see many of the of talk like announces. Unfortunately you may
+miss the odd useful one as well (but since everything is repeated many times
+you probably won't :-)
 13Sep01=======================================================================
 1. did some work on making talk more intelligent and fixed a>b problem.
 2. fixed a nasty problem on input when being hit with full buffers of 
index bf86e53552b422b52d3268e22ba324851bb25401..dd7602ac9e18875551dab1f9432b911242838cb9 100644 (file)
@@ -1037,16 +1037,31 @@ SP is an alias for SEND PRIVATE
 === 0^SET/ANNOUNCE^Allow announce messages to come out on your terminal
 === 0^UNSET/ANNOUNCE^Stop announce messages coming out on your terminal
 
+=== 0^SET/ANNTALK^Allow talk like announce messages on your terminal
+=== 0^UNSET/ANNTALK^Stop talk like announce messages on your terminal
+The announce system on legacy cluster nodes is used as a talk 
+substitute because the network is so poorly connected. If you:
+
+  unset/anntalk
+
+you will suppress several of these announces, you may miss the odd 
+useful one as well, but you would probably miss them anyway in the
+welter of useless ones.
+
+  set/anntalk 
+
+allows you to see them again. This is the default.
+
 === 5^SET/ARCLUSTER <call> [<call>..]^Make the callsign an AR-Cluster node
 
-=== 8^SET/BADDX <call>..^Stop words we do not wish to see in the callsign field
-of a dx spot being propagated
-=== 8^UNSET/BADDX <call>..^Allow a word to be seen again in a DX spot
-Setting a word as 'baddx' will prevent spots with that word in the 
-callsign field of a DX spot from going any further. They will not be 
-displayed and they will not be sent onto other nodes.
+=== 8^SET/BADDX <call>..^Stop callsigns in a dx spot being propagated
+=== 8^UNSET/BADDX <call>..^Propagate a dx spot with this callsign again
+Setting a word as 'baddx' will prevent spots with that word in the
+'spotted' field (as in: DX 14001.1 FR0G)of a DX spot from going any
+further. They will not be displayed and they will not be sent onto
+other nodes.
 
-The word must be wriiten in full, no wild cards are allowed eg:-
+The word must be written in full, no wild cards are allowed eg:-
 
   set/baddx FORSALE VIDEO FR0G
 
@@ -1092,6 +1107,23 @@ will allow spots from him again.
 
 Use with extreme care. This command may well be superceded by FILTERing.
 
+=== 8^SET/BADWORD <word>..^Stop things with this word being propagated
+=== 8^UNSET/BADWORD <word>..^Propagate things with this word again
+Setting a word as a 'badword' will prevent things like spots,
+announces or talks with this word in the the text part from going any
+further. They will not be displayed and they will not be sent onto
+other nodes.
+
+The word must be written in full, no wild cards are allowed eg:-
+
+  set/badword annihilate annihilated annihilation 
+
+will stop anything with these words in the text.
+
+  unset/badspotter annihilated
+
+will allow text with this word again.
+
 === 0^SET/BEEP^Add a beep to DX and other messages on your terminal
 === 0^UNSET/BEEP^Stop beeps for DX and other messages on your terminal
 
@@ -1314,6 +1346,10 @@ for more information.
 Display all the bad spotter's callsigns in the system, see SET/BADSPOTTER
 for more information.
 
+=== 1^SHOW/BADWORD^Show all the bad words in the system
+Display all the bad words in the system, see SET/BADWORD
+for more information.
+
 === 0^SHOW/CONFIGURATION [<node>]^Show all the nodes and users visible
 This command allows you to see all the users that can be seen
 and the nodes to which they are connected.
diff --git a/cmd/set/anntalk.pl b/cmd/set/anntalk.pl
new file mode 100644 (file)
index 0000000..eec6540
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# set the allow talklike announce flag
+#
+# Copyright (c) 1998 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+
+@args = $self->call if (!@args || $self->priv < 9);
+
+foreach $call (@args) {
+  $call = uc $call;
+  my $chan = DXChannel->get($call);
+  if ($chan) {
+    $chan->ann_talk(1);
+    $chan->user->wantann_talk(1);
+       push @out, $self->msg('annts', $call);
+  } else {
+    push @out, $self->msg('e3', "Set Ann_Talk", $call);
+  }
+}
+return (1, @out);
diff --git a/cmd/unset/anntalk.pl b/cmd/unset/anntalk.pl
new file mode 100644 (file)
index 0000000..7e8f012
--- /dev/null
@@ -0,0 +1,27 @@
+#
+# unset the allow talklike announce flag
+#
+# Copyright (c) 1998 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+
+@args = $self->call if (!@args || $self->priv < 9);
+
+foreach $call (@args) {
+  $call = uc $call;
+  my $chan = DXChannel->get($call);
+  if ($chan) {
+    $chan->ann_talk(0);
+    $chan->user->wantann_talk(0);
+       push @out, $self->msg('anntu', $call);
+  } else {
+    push @out, $self->msg('e3', "Unset Ann_Talk", $call);
+  }
+}
+return (1, @out);
index ba2e0edcad28607cb0df2502567817c95909e444..a0b09548444a612545fd68c814f67cc7c9060fa9 100644 (file)
@@ -103,6 +103,7 @@ $count = 0;
                  senddbg => '8,Sending Debug,yesno',
                  width => '0,Column Width',
                  disconnecting => '9,Disconnecting,yesno',
+                 ann_talk => '0,Suppress Talk Anns,yesno',
                 );
 
 use vars qw($VERSION $BRANCH);
index a5aaa5cfebd1f122c1b68b274d166e3c613774bf..96c135376495fbbb0747f64b7ee996ae4657bfdb 100644 (file)
@@ -30,9 +30,11 @@ use AnnTalk;
 use WCY;
 use Sun;
 use Internet;
+use Script;
+
 
 use strict;
-use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug $suppress_ann_to_talk);
+use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug);
 
 %Cache = ();                                   # cache of dynamically loaded routine's mod times
 %cmd_cache = ();                               # cache of short names
@@ -40,8 +42,6 @@ $errstr = ();                                 # error string from eval
 %aliases = ();                                 # aliases for (parts of) commands
 $scriptbase = "$main::root/scripts"; # the place where all users start scripts go
 $maxerrors = 20;                               # the maximum number of concurrent errors allowed before disconnection
-$suppress_ann_to_talk = 1;             # don't announce 'to <call> ' or '<call> ' type announcements
-
 
 use vars qw($VERSION $BRANCH);
 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
@@ -102,6 +102,7 @@ sub start
        $self->{wx} = $user->wantwx;
        $self->{dx} = $user->wantdx;
        $self->{logininfo} = $user->wantlogininfo;
+       $self->{ann_talk} = $user->wantann_talk;
        $self->{here} = 1;
 
        # get the filters
@@ -144,6 +145,10 @@ sub start
                run_cmd($DXProt::me, "forward/opernam $call");
                $user->lastoper($main::systime);
        }
+
+       # run a script send the output to the punter
+       my $script = new Script(lc $call);
+       $script->run($self) if $script;
 }
 
 #
@@ -705,9 +710,9 @@ sub announce
        my $text = shift;
        my ($filter, $hops);
 
-       if ($suppress_ann_to_talk && $to ne $self->{call}) {
+       if (!$self->{ann_talk} && $to ne $self->{call}) {
                my $call = AnnTalk::is_talk_candidate($_[0], $text);
-               return if $call && Route::get($call);
+               return if $call;
        }
 
        if ($self->{annfilter}) {
index c1583c21377d1e19715311d335cacccc76bb59b4..990aa45d57d21f2035913aaad4d08f854fb0b30d 100644 (file)
@@ -32,6 +32,7 @@ use BadWords;
 use DXHash;
 use Route;
 use Route::Node;
+use Script;
 
 use strict;
 
@@ -60,7 +61,7 @@ $baddx = new DXHash "baddx";
 $badspotter = new DXHash "badspotter";
 $badnode = new DXHash "badnode";
 $last10 = $last_pc50 = time;
-$ann_to_talk = 1;
+$ann_to_talk = 0;
 
 @checklist = 
 (
@@ -272,6 +273,10 @@ sub start
 
        # send info to all logged in thingies
        $self->tell_login('loginn');
+
+       # run a script send the output to the debug file
+       my $script = new Script(lc $call);
+       $script->run($self) if $script;
 }
 
 #
index 419156d3ac6dc75ecf2b6b1491e9b1ae5d5f307c..cbedad4114a561e5e16034ddfb587e7e8a826e36 100644 (file)
@@ -71,6 +71,7 @@ $lasttime = 0;
                  nopings => '9,Ping Obs Count',
                  wantlogininfo => '9,Login info req,yesno',
           wantgrid => '0,DX Grid Info,yesno',
+                 wantann_talk => '0,Talklike Anns,yesno',
                  lastoper => '9,Last for/oper,cldatetime',
                  nothere => '0,Not Here Text',
                 );
@@ -519,6 +520,11 @@ sub wantgrid
        return _want('grid', @_);
 }
 
+sub wantann_talk
+{
+       return _want('ann_talk', @_);
+}
+
 sub wantlogininfo
 {
        my $self = shift;
index d762e7e9516e6917cbec7a8b4c0c38af459b7ab3..720a6e1f04ddfb69942902edcf8a0f578671e8f5 100644 (file)
@@ -14,6 +14,8 @@ package DXM;
                 already => '$_[0] already connnected',
                                anns => 'Announce flag set on $_[0]',
                                annu => 'Announce flag unset on $_[0]',
+                               annts => 'Ann_Talk flag set on $_[0]',
+                               anntu => 'Ann_Talk flag unset on $_[0]',
                                badnode1 => '$_[0] is now a bad node',
                                badnode2 => '$_[0] is now a good node',
                                badnode3 => 'List of Bad Nodes:-',
index 516e7cb1eb8f57ae33478d313e97ee9627df3245..98eabf63bc7f30d10749535ffec969243cd32588 100755 (executable)
@@ -67,6 +67,7 @@ use DXBearing;
 use DXDb;
 use DXHash;
 use DXDupe;
+use Script;
 use Prefix;
 use Spot;
 use Bands;
@@ -452,6 +453,8 @@ DXDebug::dbgclean();
 
 # this, such as it is, is the main loop!
 dbg("orft we jolly well go ...");
+my $script = new Script "startup";
+$script->run($DXProt::me) if $script;
 
 #open(DB::OUT, "|tee /tmp/aa");
 
diff --git a/scripts/startup.issue b/scripts/startup.issue
new file mode 100644 (file)
index 0000000..4ad0285
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# startup script example
+#
+# set maximum no of spots allowed to 100
+set/var $Spot::maxspots = 1