need help with module
need help with module
Hello.
I'm trying to write a module, which forces chanmode +c to do exactly the same as +S does. However, when compiling my module, I get such message:
warning: assignment discards qualifiers from pointer target type
the lines near that which calls the warning are:
text = parv[2];
if (MyClient(sptr) && (chptr->mode.mode & MODE_NOCOLOR))
text = StripControlCodes(parv[2]);
What can be wrong here?
I'm trying to write a module, which forces chanmode +c to do exactly the same as +S does. However, when compiling my module, I get such message:
warning: assignment discards qualifiers from pointer target type
the lines near that which calls the warning are:
text = parv[2];
if (MyClient(sptr) && (chptr->mode.mode & MODE_NOCOLOR))
text = StripControlCodes(parv[2]);
What can be wrong here?
StripControlCodes returns a 'const char *', therefore if you assign the value to a 'char *' (so non-cost) it gives a warning.
Harmless in this case, so you cast to (char *)
But... It doesn't look to me like you are coding a proper module.
To code this in a proper module way, you would write a module which uses the HOOKTYPE_CHANMSG hook and has such a callback function (which returns a string).
Much better than modifying something official, or command overriding, or whatever you are doing ;).
Harmless in this case, so you cast to (char *)
But... It doesn't look to me like you are coding a proper module.
To code this in a proper module way, you would write a module which uses the HOOKTYPE_CHANMSG hook and has such a callback function (which returns a string).
Much better than modifying something official, or command overriding, or whatever you are doing ;).
Last edited by Syzop on Mon Nov 14, 2005 5:25 pm, edited 1 time in total.
Best way to learn it is by looking at some of the the existing modules (like from me, codemastr, etc.. check unrealircd.com -> modules).
As for real documention there's some very limited stuff on http://modules.unrealircd.com/, although it's exactly sufficient for your purposes ;p.
And if you can't find something anywhere, then there's the source of course (though indeed, that's not so elegant).
As for real documention there's some very limited stuff on http://modules.unrealircd.com/, although it's exactly sufficient for your purposes ;p.
And if you can't find something anywhere, then there's the source of course (though indeed, that's not so elegant).
Syzop, I'm actually looking at doing some case-by-case docs based on some of the smaller stuff I've written - would that be any good/postable somewhere?
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
case-by-case as in, looking at a particular problem, how I wanted to solve it, and the particular methods required to do it (ie: a module I do annotated to all hell, to give an easy example/introduction on how to do stuff).
I did a basic module to give a user a uline to test stuff for example, and I might use that as an example on how to add a command, process it, and send it to other servers, or whatever.
Postable as in, I dunno.. do you want them? Or shall I just whack them up someplace and put a link in my sig :p
I did a basic module to give a user a uline to test stuff for example, and I might use that as an example on how to add a command, process it, and send it to other servers, or whatever.
Postable as in, I dunno.. do you want them? Or shall I just whack them up someplace and put a link in my sig :p
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
API docs.. I still get confused in places, so don't know how great I'd be at that (I didn't know there was a difference between add_Command and CommandAdd until recently).
Maybe I'll have a go in a few months . I still need to work on a module that needs events, that'll be fun :p.
Maybe I'll have a go in a few months . I still need to work on a module that needs events, that'll be fun :p.
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
Module Sample
There is a place where we can find a documented module sample?
A base module where we can start codig another one ...
A base module where we can start codig another one ...
I am begging for assistance [please help]
I have been givin a task to code an unreal module. I don't know the first thing about coding in C/C++ except that you need a compiler, which I dl'd. I somehow need to create a module that when you set usermode +b to any user it will kill them with the msg "Happy Birthday!".
I have been constantly searching for someone that can help me in any way possible. Please people, i'm getting desperate. A free shell is on the line here to. So I have extra motivation to follow through with this. Send any information you may have to [email protected] please or [email protected]
Thank you for your time.
Sincerely,
Mike
[My site] http://Spyke.ro0t.org
I have been constantly searching for someone that can help me in any way possible. Please people, i'm getting desperate. A free shell is on the line here to. So I have extra motivation to follow through with this. Send any information you may have to [email protected] please or [email protected]
Thank you for your time.
Sincerely,
Mike
[My site] http://Spyke.ro0t.org