This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How i can .....

Old posts that have not been replied to for several years.
Locked
M
MtX

How i can .....

Post by MtX »

How can i call a function when user type any text ?
static cmd_t mtxhi_pub[] = {
{"!hi", "", pub_hi, NULL},
{NULL,NULL, NULL , NULL}
};
This will call pub_hi, when user type !hi, but how can i get any typed text ??
i try with "", but ........... :)
(sorry for my bad english)

Any ideas ?
p
pelefanten
Voice
Posts: 27
Joined: Thu Apr 17, 2003 4:37 pm

Post by pelefanten »

What you're looking for is probably not a public-command trigger, but rather a public message trigger.

Code: Select all

static int mymod_pubm(char *nick, char *host, char *handle, char *channel, char *text) {
  return 0;
}

static cmd_t mymod_pubm_tbl[] = {
  {"*", "",   mymod_pubm, NULL},
  {NULL,  NULL, NULL,       NULL}
};
And then register your function with

Code: Select all

add_builtins(H_pubm, mymod_pubm_tbl);
Think you will need to do a module_depend() call first tho. Dont remeber which module this depends on but a guess is either the irc or server module.
Locked