/[cvs]/botnetop.mod/botnetop.c
ViewVC logotype

Contents of /botnetop.mod/botnetop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Fri Aug 25 20:19:17 2000 UTC (18 years, 9 months ago) by sup
Branch: MAIN
Changes since 1.2: +26 -8 lines
File MIME type: text/x-chdr
Updated to 0.4.0

1 /*
2 * botnetop.c -- part of botnetop.mod
3 *
4 * $Id: botnetop.c,v 1.2 2000/08/14 01:47:33 guppy Exp $
5 */
6 /*
7 * Copyright (C) 2000 Teemu Hjelt <temex@iki.fi>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24 #define MODULE_NAME "botnetop"
25 #define MAKING_BOTNETOP
26 #define MODULE_VERSION "0.4.0"
27 #include "../module.h"
28 #include "../irc.mod/irc.h"
29 #include "../server.mod/server.h"
30 #include "../channels.mod/channels.h"
31
32 #undef global
33 static Function *global = NULL, *irc_funcs = NULL, *server_funcs = NULL, *channels_funcs = NULL;
34
35 #include "botnetop.h"
36
37 static int strict_host = 1;
38 static int bop_modeop = 0;
39 static int bop_linkop = 1;
40 static int bop_osync = 0;
41 static int bop_addhost = 0;
42 static int bop_setneed = 0;
43 static int bop_cycle = 0;
44 static int bop_log = 2;
45 static char bop_cycle_msg[256] = "Please part the channel so the bots can cycle!";
46
47 #include "misc.c"
48 #include "botcmds.c"
49 #include "ircbinds.c"
50 #include "botbinds.c"
51 #include "needbinds.c"
52 #include "tclcmds.c"
53
54 static int botnetop_expmem()
55 {
56 return 0;
57 }
58
59 static void botnetop_report(int idx, int details)
60 {
61 if (details)
62 dprintf(idx, " Tcl commands: bop_reqop, bop_letmein\n");
63 }
64
65 static tcl_ints botnetop_tcl_ints[] =
66 {
67 {"strict-host", &strict_host, 0},
68 {"bop_modeop", &bop_modeop, 0},
69 {"bop_linkop", &bop_linkop, 0},
70 {"bop_osync", &bop_osync, 0},
71 {"bop_addhost", &bop_addhost, 0},
72 {"bop_setneed", &bop_setneed, 0},
73 {"bop_cycle", &bop_cycle, 0},
74 {"bop_log", &bop_log, 0},
75 {0, 0, 0}
76 };
77
78 static tcl_strings botnetop_tcl_strings[] =
79 {
80 {"bop_cycle_msg", bop_cycle_msg, 256, 0},
81 {0, 0, 0, 0}
82 };
83
84 static char *botnetop_close()
85 {
86 Context;
87 rem_builtins(H_join, botnetop_join);
88 rem_builtins(H_mode, botnetop_mode);
89 rem_builtins(H_link, botnetop_link);
90 rem_builtins(H_bot, botnetop_bot);
91 rem_builtins(H_need, botnetop_need);
92 rem_tcl_ints(botnetop_tcl_ints);
93 rem_tcl_strings(botnetop_tcl_strings);
94 rem_tcl_commands(botnetop_tcl_cmds);
95 module_undepend(MODULE_NAME);
96 return NULL;
97 }
98
99 char *botnetop_start();
100
101 static Function botnetop_table[] =
102 {
103 (Function) botnetop_start,
104 (Function) botnetop_close,
105 (Function) botnetop_expmem,
106 (Function) botnetop_report,
107 };
108
109 char *botnetop_start(Function * global_funcs)
110 {
111 global = global_funcs;
112 Context;
113 module_register(MODULE_NAME, botnetop_table, 0, 2);
114 if (!(irc_funcs = module_depend(MODULE_NAME, "irc", 1, 0)))
115 return "You need the irc module to use the botnetop module.";
116 if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 0)))
117 return "You need the server module to use the botnetop module.";
118 if (!(channels_funcs = module_depend(MODULE_NAME, "channels", 1, 0)))
119 return "You need the channels module to use the botnetop module.";
120 if (!module_depend(MODULE_NAME, "eggdrop", 105, 0))
121 return "This module requires eggdrop1.5.0 or later";
122 add_builtins(H_join, botnetop_join);
123 add_builtins(H_mode, botnetop_mode);
124 add_builtins(H_link, botnetop_link);
125 add_builtins(H_bot, botnetop_bot);
126 add_builtins(H_need, botnetop_need);
127 add_tcl_ints(botnetop_tcl_ints);
128 add_tcl_strings(botnetop_tcl_strings);
129 add_tcl_commands(botnetop_tcl_cmds);
130 putlog(LOG_MISC, "*", "botnetop.mod v%s by Sup loaded.", MODULE_VERSION);
131 return NULL;
132 }
133

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23