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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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