Script command send message to channel

Sky

New member
Messages
2
Points
0
Github
maximecosseau
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 ?

 
Last edited by a moderator:
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 :/

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

Can I do a suggestion to the developpers about that ?

 
Follow......

Wishing we can find ways to send message to channel using script
default_biggrin.png


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

Code:
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.
 
Last edited by a moderator:
Back
Top