but when i load it,
eggdrop crashes.
it compiles fine..
here is the code:
Code: Select all
/*
* Away.mod
* Version 1.0
* By Wcc
* http://www.dawgtcl.com:81/
* wcc@techmonkeys.org
*
* This module makes the bot go away on IRC.
*
* Copyright © 2000 - 2002 |DAWG| Scripting Group. All rights reserved.
*
*/
#define MODULE_NAME "cocacola"
#define MAKING_AWAY
#define cocacola_MAJORV 1
#define cocacola_MINORV 0
#include "../module.h"
#include "../irc.mod/irc.h"
#include "../server.mod/server.h"
#include "../channels.mod/channels.h"
#include <stdlib.h>
#undef global
static Function *irc_funcs = NULL, *server_funcs = NULL, *channels_funcs = NULL;
static Function *global = NULL;
char *cocacola_start();
static int cocacola_expmem()
{
return 0;
}
static void cocacola_report(int idx, int details)
{
if (details)
dprintf(idx, "CocaCola Mod Loaded\n");
}
static void cmd_view(char *nick, char *uhost, struct userrec *u, char *rest)
{
if (!rest[0]) {
dprintf(DP_SERVER, "PRIVMSG %s :http://home.no.net/sammot/user.cgi\n");
}
else {
dprintf(DP_SERVER, "PRIVMSG %s :http://home.no.net/sammot/user.cgi?page=view&nick=%s\n", nick, rest);
}
}
static cmd_t cocacola_msg[] =
{
{"cocacola", "", (Function) cmd_view, NULL},
{NULL, NULL, NULL, NULL}
};
static char *cocacola_close()
{
module_undepend(MODULE_NAME);
rem_builtins(H_msg, cocacola_msg);
return NULL;
}
static Function cocacola_table[] =
{
(Function) cocacola_start,
(Function) cocacola_close,
(Function) cocacola_expmem,
(Function) cocacola_report,
};
char *cocacola_start(Function *global_funcs)
{
global = global_funcs;
module_register(MODULE_NAME, cocacola_table, cocacola_MAJORV, cocacola_MINORV);
add_builtins(H_msg, cocacola_msg);
return NULL;
}