Yeah, I couldn't get it to work either when I first started. I ended up just having to work off of woobie's code and using sheep.c as a reference, then graduating to gseen and such thrid-party modules.
As for public triggers, it's pretty straight forward.
Code: Select all
static void pub_triggerme(char* nick, char* host, char* handle, char* chan, char* text)
{
/* implement me! */
}
static char* MYMODULE_close()
{
/* some code goes here */
del_builtin(H_pub, pub_trig);
}
cmd_t pub_trig [] = {
{"!triggerme", "", pub_triggerme, NULL},
{0, 0, 0, 0}
};
/* in MYMODULE_start function */
char* MYMODULE_start()
{
/* -----------------------------------------------------------------------------
Be sure to get a pointer to irc_funcs or server_funcs, before calling
H_pub. I can't remember which it is right now.
--------------------------------------------------------------------------------*/
add_builtin(H_pub, pub_trig);
}
NOTE: I am trying to remember this the best that I can away from my sources, so there may be some incorrect namings and such.
Umby.
serra wrote:hi!
First i want to thank stdragon for his module-example. It wasn't me who ask for it but it was just what i was looking for, long time ago! I really do apreciate very much this code.
However I couldn't get it working, even after correcting some minor erros like... a funcion called pub_baa being called by pub_sheep.
And also after included module irc.
The problem is that the bot goes well to irc but when I type !baa on the chan it crashes with a segment violation.
Can you take a look in it and help me to get this to work? I really need to have this example working to start understanding eggdrop module programming
thank you very much for your time and atention!
Pedro