Anope IRC Services

Anope Development => Modules => Topic started by: n00bie on March 05, 2006, 07:57:38 AM

Title: Can anyone fixed this code...
Post by: n00bie on March 05, 2006, 07:57:38 AM
Hello, first of all i am a newbie in anope module coding and stuff. After reading through the example demos provided by anope, i decided to learn and write my own module. So here is one. But, i got a problem on the code and if anyone could fixed these code for me, i will be very thankful:

Quote
Fixed :P



[Edited on 8-7-2006 by n00bie]
Title:
Post by: dragoonkain on March 05, 2006, 11:49:47 PM
I'll admit I didn't read through it, but if you could would you please tell us where you're having problems? I.E: Are you compiling the code and getting compile errors? Is KissServ not replying with the proper message? Not replying at all?

Thanks

PS:

int do_kiss(User * u)
{
ChannelInfo *ci;
char *chan = strtok(NULL, " ");
char *text = strtok(NULL, " ");
...

You shouldn't use strtok(NULL, " "); for Anope 1.7.x if that's what you're aiming for. Try:

[oopsie - slashed by Trystan]

[Edited on 6-3-2006 by dragoonkain]
Title:
Post by: Trystan Scott Lee on March 06, 2006, 12:47:00 AM
You can't use moduleGetLastBuffer() if your using a custom psdeuo client. Since the core looks to see if the person being asked for is one of theirs (core only) services and sets the last buffer correctly, otherwise it is just ignored and the last buffer is worthless

Also the above code will ONLY work if you privmsg the bot..

if (*av[0] == '#') {
return MOD_CONT;
}

that tells it to ignore all privmsg seen that are to a channel

To tired to point out the rest of the issues with this code
Title:
Post by: n00bie on March 06, 2006, 08:01:10 AM
Code: [Select]
if (*av[0] == '#') {
return MOD_CONT;
}

thanks a lot Trystan, now, ive got my first clue.

[Edited on 31-8-2006 by n00bie]