Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 105 lines (74 sloc) 2.251 kB
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
1 #!/usr/bin/perl
2
3 # infobot -- copyright kevin lenzo (c) 1997-infinity
4 # Flooterbuck Infobot -- copyright (C) Dave Brown, 2001-2004
5
6 # For full licensing terms see the file LICENSE included with
7 # the flooterbuck distribution.
8
9 require 5.6.0;
10
11 BEGIN {
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
12 $VER_MAJ = 1;
13 $VER_MIN = 2;
14 $VER_MOD = 1;
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
15
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
16 $version = "Flooterbuck infobot $VER_MAJ\.$VER_MIN\.$VER_MOD [dagbrown]";
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
17 }
18
19 BEGIN {
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
20 $filesep = '/';
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
21
22 # set this to the absolute path if you need it; especially
23 # if . is not in your path
24
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
25 $param{'basedir'} = ( $0 =~ /(.*)$filesep/ ) ? $1 : '.';
26
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
27 # $infobot_base_dir = '/usr/local/lib/infobot';
28
29 # change this next line if you run a local instance of
30 # an infobot and use the code from the main location.
31 # the 'files' directory contains infobot.config and
32 # infobot.users, among other things.
33
34 $param{'confdir'} = "$param{basedir}${filesep}conf";
35
36 # everything is loaded, then the variables that
37 # you want to set will override the defaults; this
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
38 # is why all these requires are here.
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
39
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
40 $param{'srcdir'} = $param{'basedir'} . $filesep . "src";
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
41
42 opendir DIR, $param{'srcdir'}
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
43 or die "can't open source directory $param{srcdir}: $!";
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
44
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
45 while ( $file = readdir DIR ) {
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
46 next unless $file =~ /\.pl$/;
47 require "$param{srcdir}$filesep$file";
48 }
49 closedir DIR;
50 }
51
52 # get the command line arguments
53 &getArgs();
54
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
55 # initialize everything
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
56 &setup();
57
58 # launch the irc event loop
59 &irc();
60
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
61 exit 0; # just so you don't look farther down in this file :)
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
62
63 # --- support routines
64
65 sub usage {
66 print "\n";
67 print " usage: $0 [-h] [<config file>]\n";
68 print "\n";
69 print " -h this message\n";
70 print "\n";
71 }
72
73 sub getArgs {
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
74 if ( $ARGV[0] ) {
75 if ( $ARGV[0] =~ /^-[hi\?]/ ) {
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
76 &usage;
77 exit 1;
78 }
79 else {
fd3b819 @dagbrown Ran the entire lot through perltidy
authored
80 $paramfile = $ARGV[0];
7abb999 @dagbrown Initial commit from CVS snapshot.
authored
81 }
82 }
83 else {
84 $paramfile = '';
85 }
86 }
87
88 1;
89
90 __END__
91
92 =head1 NAME
93
94 Flooterbuck Infobot - a modular IRC information bot
95
96 =head1 SYNOPSIS
97
98 B<infobot> S<[ -h ]> [I<paramfile1> [I<paramfile2> ...]]
99
100 =head1 NOTE
101
102 If you're reading this, you need to yell at
103 Dave Brown (flooterbuck@dagbrown.com)
104 and tell him to write some actual documentation. =)
Something went wrong with that request. Please try again.