fleshed out some commands (particularly flag setting and unsetting)
[spider.git] / perl / DXM.pm
1 #
2 # DX cluster message strings for output
3 #
4 # Each message string will substitute $_[x] positionally. What this means is
5 # that if you don't like the order in which fields in each message is output then 
6 # you can change it. Also you can include various globally accessible variables
7 # in the string if you want. 
8 #
9 # Largely because I don't particularly want to have to change all these messages
10 # in every upgrade I shall attempt to add new field to the END of the list :-)
11 #
12 # Copyright (c) 1998 - Dirk Koopman G1TLH
13 #
14 # $Id$
15 #
16
17 package DXM;
18
19 require Exporter;
20 @ISA = qw(Exporter);
21 @EXPORT = qw(msg);
22
23 %msgs = (
24   addr => 'Address set to: $_[0]',
25   anns => 'Announce flag set on $_[0]',
26   annu => 'Announce flag unset on $_[0]',
27   conother => 'Sorry $_[0] you are connected on another port',
28   concluster => 'Sorry $_[0] you are already connected elsewhere on the cluster',
29   dxs => 'DX Spots flag set on $_[0]',
30   dxu => 'DX Spots flag unset on $_[0]',
31   e1 => 'Invalid command',
32   e2 => 'Error: $_[0]',
33   e3 => '$_[0]: $_[1] not found',
34   email => 'E-mail address set to: $_[0]',
35   heres => 'Here set on $_[0]',
36   hereu => 'Here unset on $_[0]',
37   homebbs => 'Home BBS set to: $_[0]',
38   homenode => 'Home Node set to: $_[0]',
39   l1 => 'Sorry $_[0], you are already logged on on another channel',
40   l2 => 'Hello $_[0], this is $main::mycall located in $main::myqth',
41   m2 => '$_[0] Information: $_[1]',
42   pr => '$_[0] de $main::mycall $main::cldate $main::ztime >',
43   prx => '$main::$mycall >',
44   talks => 'Talk flag set on $_[0]',
45   talku => 'Talk flag unset on $_[0]',
46   wwvs => 'WWV flag set on $_[0]',
47   wwvu => 'WWV flag unset on $_[0]',
48 );
49
50 sub msg
51 {
52   my $self = shift;
53   my $s = $msgs{$self};
54   return "unknown message '$self'" if !defined $s;
55   return  eval qq("$s");
56 }
57