Check repop from GMCP

Posted by Quit on Tue 05 May 2015 06:37 PM — 4 posts, 20,070 views.

#0
Hi

In Cmud I used to have a gmcp trigger to play a sound when
there was a repop in the area I was in.
But where do I put a trigger to catch when comm.repop.zone
send something.

I also use zone script alot, but think I can do that with
turning on/off trigger groups, but then again how do I get room.info.zone without checking for it all the time.
Australia Forum Administrator #1
Which GMCP/ATCP plugins (if any) are you currently using? They should broadcast a message letting you know of new messages arriving from the MUD, like repops.
Australia Forum Administrator #2
I've been doing some experimenting on Achaea.

Assuming you have no plugins installed, grab the GMCP_handler plugin from http://www.gammon.com.au/forum/?id=12834&reply=1#reply1 and install it.

[EDIT] See next reply.





That will catch the messages listed above "Char.Vitals", "Char.Status" etc. For each one a "handler" is called. (eg. gotCharacterVitals). Now in that you can check things. There is an example which shows your current HP.

Also the "Room.WrongDir" handler plays a sound.

I didn't see the "comm.repop.zone" message while I was there.

For debugging you can turn on gmcp debugging by typing:


gmcpdebug 1


Then you will see (rather wordy) messages as the GMCP messages arrive. To turn that off type:


gmcpdebug 0
Amended on Wed 06 May 2015 02:54 AM by Nick Gammon
Australia Forum Administrator #3
Earlier suggestion completely reworked.

See: http://www.gammon.com.au/gmcp

Grab the GMCP_handler_NJG plugin from GitHub, and also the GMCP_message_receiver_test plugin.

Template:gitplugin=GMCP_handler_NJG
To save and install the GMCP_handler_NJG plugin do this:
  1. Go to the GitHub page: GMCP_handler_NJG.xml
  2. Select all the page and copy it to the Clipboard
  3. Open a text editor (such as Notepad) and paste the plugin into it
  4. Save to disk on your PC, preferably in your plugins directory, as: GMCP_handler_NJG.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  5. Go to the MUSHclient File menu -> Plugins
  6. Click "Add"
  7. Choose the file GMCP_handler_NJG.xml (which you just saved in step 4) as a plugin
  8. Click "Close"
  9. Save your world file, so that the plugin loads next time you open it.

The main GitHub page for this plugin is at: https://github.com/nickgammon/plugins/blob/master/GMCP_handler_NJG.xml.

There you will find the commit history and other information.



Template:gitplugin=GMCP_message_receiver_test
To save and install the GMCP_message_receiver_test plugin do this:
  1. Go to the GitHub page: GMCP_message_receiver_test.xml
  2. Select all the page and copy it to the Clipboard
  3. Open a text editor (such as Notepad) and paste the plugin into it
  4. Save to disk on your PC, preferably in your plugins directory, as: GMCP_message_receiver_test.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  5. Go to the MUSHclient File menu -> Plugins
  6. Click "Add"
  7. Choose the file GMCP_message_receiver_test.xml (which you just saved in step 4) as a plugin
  8. Click "Close"
  9. Save your world file, so that the plugin loads next time you open it.

The main GitHub page for this plugin is at: https://github.com/nickgammon/plugins/blob/master/GMCP_message_receiver_test.xml.

There you will find the commit history and other information.




That demonstrates messages being processed by a plugin after being received by GMCP.

There is no polling involved, you just respond when the message arrives.