Jump to content
  • 0
Sky

Script command send message to channel

Question

Hello Hercules !
 
Is it possible to send a message to a channel with a script command ? I couldn't find anything in the doc. It would be useful to send some information to a group of players.
There is a source mod on rAthena forums for that but obviously it doesn't work on Hercules and I'm not able to convert it.

 
http://rathena.org/board/topic/94041-npc-talk-to-a-channel/

 

/*========================================== * channelmes (sends message to given channel) *------------------------------------------*/BUILDIN_FUNC(channelmes){	const char *channel_name = script_getstr(st,2), *msg = script_getstr(st,3);	struct Channel * channel = channel_name2channel(channel_name,NULL,0);		if( channel ) {		DBIterator *iter;		struct map_session_data *user;		char message[CHAN_MSG_LENGTH];		snprintf(message, CHAN_MSG_LENGTH, "[ #%s ] %s",channel->name, msg);		iter = db_iterator(channel->users);		for( user = (struct map_session_data*)dbi_first(iter); dbi_exists(iter); user = (struct map_session_data*)dbi_next(iter) ) {			//I didn't use clif_channel_msg or channel_send here, because they need a sender sd...			clif_colormes(user,channel->color,message);		}	}	return SCRIPT_CMD_SUCCESS;}BUILDIN_DEF(channelmes,"ss"),//usage:channelmes("#main","Hi, I am "+strcharinfo(0)+".");

 

 

 

Can someone more experienced with source can take a look ?

Edited by Sky

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

channelmes command: https://github.com/HerculesWS/Hercules/commit/dfe8337d9ddb1a0b356ae86de9955845d280b759

 

channelmes("<#channel>", "<message>");This command will send a message to the specified chat channel.The sent message will not include any character's names.For special channels, such as #map and #ally, the attached RID's map or guildwill be used.If the channel doesn't exist (or, in the case of a character-specific channel,no RID is attached), false will be returned. In case of success, true isreturned.

Share this post


Link to post
Share on other sites
  • 0

Right now, no. But it is possible to make a command to do that. At least from what I've seen about the channel system that is. However, our channel system here are Herc differs from rAthena from what I can tell. So I don't think that command you linked will be convertable :/

Share this post


Link to post
Share on other sites
  • 0

Ah that's too bad. Thanks for your reply.

Can I do a suggestion to the developpers about that ?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.