Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: looking for way to bind !cmd on chan  (Read 2479 times)

0 Members and 1 Guest are viewing this topic.

tazmania

  • Guest
looking for way to bind !cmd on chan
« on: October 16, 2007, 01:32:27 PM »

hello,

i'm new to anope module coding, so trying to study it.

i'm trying to add my service with some command that i would like it to be triggered from within channel by users, using !cmd. (now i know some of you may reply, use eggdrop for it, i might just do that eventually, but i would still like to understand the anope service module coding "internals")

i went over the 2 tutorials on wiki, read them, and tried to "study" from other modules written by other posted on site. i was looking @ vhostserv module code, that had support for !vhost command trigger in his code.

what i fail to understand is what is exactly the porpuse of the createMessage() function & the moduleAddMessage() function.
as in his code for example i see:
under AnopeInit() ,placed a call to createMessage, where inside that createMessage function placed name of a "mid function" that from there calling to another function that check for command using myStrGetToken() function.
(that i assume split for " " & the 0 gets the first bit after split.)

would appreciate any help, sorry if it's being n00b question. i tried to search for answer, & browse forum, and couldn't find my answer...

[Edited on 16-10-2007 by tazmania]
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #1 on: October 16, 2007, 03:47:43 PM »

I m sorry to say this, but imho ircd_vhostserv has a rather ugly  and needlessly complicated implementation of fantasy commands.
You would be better off looking at the bs_fantasy_kick.c module that ships in the anope core (anope/src/core/bs_fantasy_kick.c) or the bs_fantasytemplate module which was created for this purpose.
Also read the anope wiki part regarding internal events.

And you have assumed correctly what myStrGetToken() does :)
This function is also in the wiki btw.

[Edited on 16-10-2007 by Viper]
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

tazmania

  • Guest
(No subject)
« Reply #2 on: October 16, 2007, 05:57:47 PM »

thanks for your reply viper.
i'll check the reference modules you given & will study them.
:)
Logged
Pages: [1]   Go Up