• IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->
Resource icon

Utility MQ2Discord

Plugin that does pretty much what the name says, connects MQ2 to discord. Chat messages that match a filter get sent to a Discord channel, and any commands you enter in that channel get executed:

MQ2Discord.png


Please consider it a beta release, may crash, etc. It's running stable for me though, and I'm keen to get other people's thoughts on it!

Setup


  1. Create a server & channel(s) from the Discord client
  2. Create a Discord bot & add it to your server, per the guide here: https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token
  3. Put MQ2Discord.dll in your plugins directory Now included with redguides updater
  4. Put LIBEAY32.dll & SSLEAY32.dll in the same directory as eqgame.exe (these are dependencies of the Discord library I'm using & get loaded from the path of the main exe, not the MQ2 directory. I'll see if I'm able to statically link soon, but for now you're stuck with DLLs)
  5. In game, load the plugin with
    Rich (BB code):
    /plugin mq2discord
  6. Enter your the token for your bot (see linked guide earlier) with
    Rich (BB code):
    /discord token <token>
  7. Enter your user id (right click your username in discord, copy id) with
    Rich (BB code):
    /discord user <user id>
  8. Since the token & user id are the same for all characters, you can do it with EQBC e.g.
    Rich (BB code):
    /bcaa //discord token <token>
  9. Enter the channel id to send messages to from this character (right click channel in discord, copy id) with
    Rich (BB code):
    /discord channel <channel id>
  10. Connect with
    Rich (BB code):
    /discord connect

Filters

A line of chat will be sent to discord if it matches an allow filter, and doesn't match any block filters. Macro event syntax is used, so you can have wildcards (#*#) or variables (|${Var}| in them. For example to allow anything containing your character's name:

Rich (BB code):
/discord allow #*#|${Me}|#*#
By default, anything starting with [MQ2] or [MQ2Discord] will be allowed.

Configuration is stored in the MQ2 directory, in MQ2Discord_server_character.json, if you want to edit it manually. You'll have to unload/load the plugin for it to take effect.

Compiling

Virus check for compiled zip: https://www.virustotal.com/#/file/5...b4265e7a9e090ddd3551260bef8753c6ad9/detection

Otherwise you're welcome to have a go at compiling, it's painful. You'll need sleepy discord, with the patch applied to add a poll method. Also nlohmann json (I installed with vcpkg).

Todo


  • Source code needs tidying up, I'm sure there's some bugs in there from my hack job multithreading among other things. I wasn't going to release it just yet but I realized there's probably some concerns around a plugin that connects externally :/
  • Better default filters - send all chat channels, tells, ooc, say etc
  • Escape discord's special characters e.g. *
  • Convert item links to allakhazam links
  • I could add regex filters if there's any interest, though Blech seems quite well designed for a large number of filters
Server Type
Live (normal server), Test
Included in Very Vanilla
Yes
Author
alynel
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from alynel

Top