pajlads / DinkPlugin

Sends level up, clue, etc. notifications to a Discord webhook or a custom web server
https://runelite.net/plugin-hub/show/dink
BSD 2-Clause "Simplified" License
33 stars 14 forks source link
discord osrs runelite runelite-plugin webhook

Dink

Dink sends webhook messages upon noteworthy in-game events. While Dink supports the Discord webhook format (with rich embeds and optional screenshots), it also includes additional metadata that allows custom webhook servers to analyze messages or even generate their own messages. Examples of the additional metadata can be found here. This project was forked from UniversalDiscordNotifier, but has more features, reliability, configurability, testing, and maintainer activity.

Have a suggestion (e.g., new notifier, additional data), bug report (as rare as it may be), or question? Let us know on our issue tracker!

Basic Setup

To use this plugin, a webhook URL is required; you can obtain one from Discord with the following steps:
If you already have a link, skip to step 4.

  1. Click the server name (at the top-left of your screen) and select Server Settings.
  2. Select the Integrations tab on the left side and click Create Webhook (if other webhooks already exist, click View Webhooks and New Webhook).
  3. Click the newly created webhook, select the target Discord channel, and click Copy Webhook URL.
  4. Paste the copied link into the Primary Webhook URLs box in the Dink plugin settings.
  5. (Optional): If you would like different webhook URLs to receive different sets of notifications, you can instead paste the link into each relevant box in the Webhook Overrides section. Note: when a notifier has an override URL, the notifier ignores the primary URL box.

Notifiers

Other Setup

Some notifiers require in-game settings to be configured to send chat messages upon certain events (so these events can serve as triggers for webhook notifications).

Example

img.png

Advanced Features

Chat Commands

Export Current Configuration via ::dinkexport

Dink allows you to export your current plugin configuration to the clipboard via the ::dinkexport chat command.

You can share this produced JSON to friends who want to send similarly configured messages.

This export includes settings across all of the notifiers, but omits webhook URLs. If you also want to include webhook URLs in the export, you can use the all parameter to the command: ::dinkexport all.

If you only want to export the webhook URLs, run the ::dinkexport webhooks chat command.

You can export just the settings for select notifiers.
Simply run: ::dinkexport <notifier section header name without spaces>.
For example: ::dinkexport pet or ::dinkexport collectionlog.

Examples

Import Configuration via ::dinkimport

With the output of the above command (::dinkexport) copied to your clipboard, you can merge these settings with your own via the ::dinkimport chat command.

This import can replace all of your notifier settings. However, webhook URL lists, filtered RSNs, and filtered item names for the loot notifier would be combined, rather than outright replaced. If you would like all settings overwritten rather than merged during import, simply press the Reset button at the bottom of the plugin settings panel to clear out all settings (including URLs) before running ::dinkimport.

After an import, if the dink plugin settings panel was open, simply close and open it for the updated configuration to be reflected in the user interface.

Note: There is no undo button for this command, so consider making a backup of your current Dink configuration by using the ::dinkexport all command explained above and saving that to a file on your computer.

Warning: If you import override URLs for a notifier (that previously did not have any overrides), this will result in the plugin no longer sending messages from that notifier to your old primary URLs. As such, you can manually add your primary URLs to the newly populated override URL boxes so that notifications are still sent to the old primary URLs.

Get your Dink Hash via ::dinkhash

Dink notification metadata includes a player hash that custom webhook servers can utilize to uniquely identify players (persistent across name changes).

You can obtain your dink hash via the ::dinkhash chat command. Feel free to provide this value to third-party services that may request it.

Get Current Region ID via ::dinkregion

The death notifier allows you to customize any region that should be ignored. This is particularly relevant for ultimate ironmen (UIM) who frequently use particular locations to deathbank/deathpile.

To facilitate this process, the ::dinkregion chat command outputs the player's current region ID.

For example, Prifddinas spans the following region IDs: 12894, 12895, 13150, and 13151.


Notifier Configuration

Most of the config options are self-explanatory. But the notification messages for each notification type also contain some words that will be replaced with in-game values.

All messages:

%USERNAME% will be replaced with the username of the player.

Death:

%VALUELOST% will be replaced with the price of the items you lost. If you died in PvP, %PKER% will be replaced with the name of your killer.

By default, to avoid spam, Dink will ignore deaths from the following safe activities/areas: Barbarian Assault, Castle Wars, Chambers of Xeric (CoX), Clan Wars, Creature Graveyard of Mage Training Arena, Last Man Standing (LMS), Nightmare Zone (NMZ), Pest Control, player-owned houses (POH), Soul Wars, TzHaar Fight Pit. However, PvM deaths as a hardcore group ironman are not considered to be safe (and will trigger a notification in these areas). Lastly, Dink makes exceptions for Inferno and TzHaar Fight Cave; deaths in these areas do trigger notifications (despite technically being safe).

Note: If Distinguish PvP deaths is disabled, the message content will be the non-PvP version.

Collection:

%ITEM% will be replaced with the item that was dropped for the collection log.

%COMPLETED% will be replaced with the number of unique entries that have been completed.

%TOTAL_POSSIBLE% will be replaced with the total number of unique entries that are tracked in the collection log.

Note: %COMPLETED% may not be populated if the Character Summary tab was never selected since logging in.

Level:

%SKILL% will be replaced with the skill name and level that was achieved

%TOTAL_LEVEL% will be replaced with the updated total level across all skills.

%TOTAL_XP% will be replaced with the updated total experience across all skills.

Loot:

%LOOT% will be replaced with a list of the loot and value of said loot

%TOTAL_VALUE% will be replaced with the total value of the looted items

%SOURCE% will be replace with the source that dropped or gave the loot

Slayer:

%TASK% will be replaced with the task that you have completed. E.g. 50 monkeys

%TASKCOUNT% will be replaced with the number of tasks that you have completed.

%POINTS% will be replaced with the number of points you obtained from the task

Quests:

%QUEST% will be replaced with the name of the quest completed

Clue Scrolls:

%CLUE% will be replaced with the type of clue (beginner, easy, etc...)

%LOOT% will be replaced with the loot that was obtained from the casket

%TOTAL_VALUE% will be replaced with the total value of the items from the reward casket

%COUNT% will be replaced by the number of times that you have completed that tier of clue scrolls

Kill Count:

%BOSS% will be replaced with the boss name (be it the NPC, raid, etc.)

%COUNT% will be replaced with the kill count (or, generically: completion count)

Combat Achievements:

%TIER% will be replaced with the combat achievement tier (e.g., Easy, Hard, Grandmaster)

%TASK% will be replaced with the name of the combat task (e.g., Peach Conjurer)

%POINTS% will be replaced with the number of points you earned from the combat achievement.

%TOTAL_POINTS% will be replaced with the total points that have been earned across tasks.

If the task completion unlocked rewards for a tier, %COMPLETED% will be replaced with the tier that was completed.

Achievement Diary:

%AREA% will be replaced with the geographic area of the achievement diary tasks (e.g., Varrock)

%DIFFICULTY% will be replaced with the level of the achievement diary (e.g., Hard)

%TOTAL% will be replaced with the total number of achievement diaries completed across all locations and difficulties

%TASKS_COMPLETE% will be replaced with the number of tasks completed across all locations and difficulties

%TASKS_TOTAL% will be replaced with the total number of tasks possible across all locations and difficulties

%AREA_TASKS_COMPLETE% will be replaced with the number of tasks completed within the area

%AREA_TASKS_TOTAL% will be replaced with the total number of tasks possible within the area

Pet:

%GAME_MESSAGE% will be replaced with the game message associated with this type of pet drop

Speedrunning:

%QUEST% will be replaced with the name of the quest (e.g., Cook's Assistant)

%TIME% will be replaced with the time for the latest run

%BEST% will be replaced with the personal best time for this quest (note: only if the run was not a PB)

BA Gambles:

%COUNT% will be replaced with the high level gamble count

%LOOT% will be replaced with the loot received from the gamble (by default, this is included only in rare loot notifications)

Player Kills:

%TARGET% will be replaced with the victim's user name

Group Storage:

%DEPOSITED% will be replaced with the list of deposited items

%WITHDRAWN% will be replaced with the list of withdrawn items

Grand Exchange:

%TYPE% will be replaced with the transaction type (i.e., bought or sold)

%ITEM% will be replaced with the transacted item

%STATUS% will be replaced with the offer status (i.e., Completed, In Progress, or Cancelled)

Trades:

%COUNTERPARTY% will be replaced with the name of the other user involved in the trade

%GROSS_VALUE% will be replaced with the sum of item values offered by both parties in the transaction.

%NET_VALUE% will be replaced with the value of the received items minus the value of the given items.

Leagues:

Leagues notifications include: region unlocked, relic unlocked, and task completed (with customizable difficulty threshold).

Each of these events can be independently enabled or disabled in the notifier settings.

Chat:

The chat notifier enables notifications for messages that are otherwise not covered by our other notifiers.

You can customize the message patterns to your liking (* is a wildcard), and specify which types of messages to check (e.g., game, trade, clan notification, user chat).

%MESSAGE% will be replaced with the chat message the matched one of the patterns.

Metadata:

On login, Dink can submit a character summary containing data that spans multiple notifiers to a custom webhook handler (configurable in the Advanced section). This login notification is delayed by at least 5 seconds in order to gather all of the relevant data.

Credits

This plugin uses code from Universal Discord Notifier.

Item rarity data is sourced from the OSRS Wiki (licensed under CC BY-NC-SA 3.0), which was conveniently parsed by Flipping Utilities (and transformed by pajlads).