Skip to content

How to capture server messages sent from interactive console?

In linux you can do 'say something' in the interactive console and it gets broadcast to all players.

It goes to combat log like :

[Server]: something


In the module scripting, I'd like to capture this message and "do" something with it. How could I capture it? i think I want to use SetListeningPattern, but don't know where to put that.


for example: `say gamemode 1`

if ( "matches game mode" ) {
gametype = parse words
SetLocalInt(GetModule(), "GameMode", gametype )

}


Comments

  • ProlericProleric Member Posts: 1,281
    edited March 2018
    To pick up messages from the chat window, you need a listening creature with SetListenPattern in its OnSpawn script. It will detect and process the message in its OnConversation script.
  • Knight_ShieldKnight_Shield Member Posts: 51
    Oh wow mind just got a little blown here.
    Question: I can trigger realtime events by having my linux use nwservctl.sh script to send message, then capture message in server and script things to happen like killer penguins appaer ?
Sign In or Register to comment.