GithubHelp home page GithubHelp logo

pajlada / dinkplugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pajlads/dinkplugin

0.0 1.0 0.0 835 KB

Sends level up, clue, etc. notifications to a Discord webhook or a custom web server

Home Page: https://runelite.net/plugin-hub/show/dink

License: BSD 2-Clause "Simplified" License

Java 99.11% Kotlin 0.89%

dinkplugin's Introduction

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. This project was forked from UniversalDiscordNotifier, but has more features, reliability, configurability, testing, and maintainer activity.

Notifiers

  • Death: Send a webhook message upon dying (with special configuration for PK deaths)
  • Collection: Send a webhook message upon adding an item to your collection log
  • Level: Send a webhook message upon leveling up a skill (with support for virtual levels)
  • Loot: Send a webhook message upon receiving valuable loot
  • Slayer: Send a webhook message upon completing a slayer task (with a customizable point threshold)
  • Quests: Send a webhook message upon completing a quest
  • Clue Scrolls: Send a webhook message upon solving a clue scroll (with customizable tier/value thresholds)
  • Kill Count: Send a webhook message upon defeating a boss (with special configuration for personal best times)
  • Combat Achievements: Send a webhook message upon completing a combat task (with customizable tier threshold)
  • Achievement Diaries: Send a webhook message upon completing an achievement diary (with customizable difficulty threshold)
  • Pet: Send a webhook message upon receiving a pet
  • Speedrunning: Send a webhook message upon completing a quest speedrun (with special configuration for personal best times)
  • BA Gambles: Sends a webhook message upon receiving high level gambles from Barbarian Assault

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).

  • Collection notifier requires Settings > All Settings > Chat > Collection log - New addition notification to be enabled
  • Pet notifier recommends Settings > All Settings > Chat > Untradeable loot notifications to be enabled (which requires Settings > All Settings > Chat > Loot drop notifications) in order to determine the name of the pet
  • For Kill Count notifier, ensure you do not enable Settings > All Settings > Chat > Filter out boss kill-count with spam-filter (note: this setting is already disabled by default by Jagex)

Example

img.png

Advanced Features

  • Multiple webhook urls are supported; simply place each on a separate line
  • Each notifier can send webhook messages to separate "override" urls
  • Screenshots can be individually configured for each notifier
  • The plugin can skip notifications if the current player name is on the user-configured RSN ignore list
  • Users can choose whether their webhook messages are sent in Discord's rich embed format or a traditional format
  • The player name in Discord rich embeds can be linked to various tracking services (from HiScores to Wise Old Man)
  • Discord rich embed footers can be customized with user-specified text and image url
  • When network issues occur, Dink can make repeated attempts to send the webhook (with exponential backoff)

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

  • Export notifier settings, primary webhook URLs & webhook override URLs
    ::dinkexport all
  • Export Slayer & BA Gambles Notifier settings
    ::dinkexport slayer bagambles
  • Export webhook overrides only
    ::dinkexport webhookoverrides
  • Export all webhooks & the Levels notifier settings:
    ::dinkexport webhooks levels

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 and ignored RSNs will 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.


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.

JSON Example:
{
  "content": "Text message as set by the user",
  "extra": {},
  "type": "NOTIFICATION_TYPE",
  "playerName": "your rsn",
  "embeds": []
}

The examples below omit embeds and playerName keys because they are always the same.

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.

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

JSON for non-PvP death:
{
  "content": "%USERNAME% has died...",
  "extra": {
    "valueLost": 300,
    "isPvp": false,
    "keptItems": [],
    "lostItems": [
      {
        "id": 314,
        "quantity": 100,
        "priceEach": 3,
        "name": "Feather"
      }
    ]
  },
  "type": "DEATH"
}
JSON for PvP scenarios:
{
  "content": "%USERNAME% has just been PKed by %PKER% for %VALUELOST% gp...",
  "extra": {
    "valueLost": 300,
    "isPvp": true,
    "pker": "%PKER%",
    "keptItems": [],
    "lostItems": [
      {
        "id": 314,
        "quantity": 100,
        "priceEach": 3,
        "name": "Feather"
      }
    ]
  },
  "type": "DEATH"
}

Collection:

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

JSON for Collection Notifications:
{
  "content": "%USERNAME% has added %ITEM% to their collection",
  "extra": {
    "itemName": "Zamorak chaps",
    "itemId": 10372,
    "price": 500812,
    "completedEntries": 420,
    "totalEntries": 1443
  },
  "type": "COLLECTION"
}

Level:

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

JSON for Levelups:
{
  "content": "%USERNAME% has levelled %SKILL%",
  "extra": {
    "levelledSkills": {
      // These are the skills that dinked
      "Skill name": 30
    },
    "allSkills": {
      // These are all the skills
      "Skill name": 30,
      "Other skill": 1
    }
  },
  "type": "LEVEL"
}

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

JSON for Loot Notifications:
{
  "content": "%USERNAME% has looted: \n\n%LOOT%\nFrom: %SOURCE%",
  "extra": {
    "items": [
      {
        // type of this object is SerializedItemStack

        "id": 1234,
        "quantity": 1,
        "priceEach": 42069,
        // priceEach is the GE price of the item
        "name": "Some item"
      }
    ],
    "source": "Giant rat"
  },
  "type": "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

JSON for Slayer Notifications:
{
  "content": "%USERNAME% has completed a slayer task: %TASK%, getting %POINTS% points and making that %TASKCOUNT% tasks completed",
  "extra": {
    "slayerTask": "Slayer task name",
    "slayerCompleted": "30",
    "slayerPoints": "30"
  },
  "type": "SLAYER"
}

Quests:

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

JSON for Quest Notifications:
{
  "content": "%USERNAME% has completed a quest: %QUEST%",
  "extra": {
    "questName": "Recipe for Disaster"
  },
  "type": "QUEST"
}

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

JSON for Clue Notifications:
{
  "content": "%USERNAME% has completed a %CLUE% clue, they have completed %COUNT%.\nThey obtained:\n\n%LOOT%",
  "extra": {
    "clueType": "Beginner",
    "numberCompleted": 123,
    "items": [
      {
        // the type of this object SerializedItemStack

        "id": 1234,
        "quantity": 1,
        "priceEach": 42069,
        // priceEach is the GE price of the item
        "name": "Some item"
      }
    ]
  },
  "type": "CLUE"
}

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)

JSON for Kill Count Notifications:
{
  "content": "%USERNAME% has defeated %BOSS% with a completion count of %COUNT%",
  "extra": {
    "boss": "King Black Dragon",
    "count": 69,
    "gameMessage": "Your King Black Dragon kill count is: 69."
  },
  "type": "KILL_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)

JSON for Combat Achievement Notifications:
{
  "content": "%USERNAME% has completed %TIER% combat task: %TASK%",
  "extra": {
    "tier": "GRANDMASTER",
    "task": "Peach Conjurer"
  },
  "type": "COMBAT_ACHIEVEMENT"
}

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., Elite)

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

JSON for Achievement Diary Notifications:
{
  "content": "%USERNAME% has completed the %DIFFICULTY% %AREA% Achievement Diary, for a total of %TOTAL% diaries completed",
  "extra": {
    "area": "Varrock",
    "difficulty": "ELITE",
    "total": 36
  },
  "type": "ACHIEVEMENT_DIARY"
}

Pet:

JSON for Pet Notifications:
{
  "content": "%USERNAME% has a funny feeling they are being followed",
  "extra": {
    "petName": "Ikkle hydra",
    "milestone": "5,000 killcount"
  },
  "type": "PET"
}

Note: petName is only included if the game sent it to your chat via untradeable drop or collection log or clan notifications. milestone is only included if a clan notification was triggered.

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)

JSON for Personal Best Speedrun Notifications:
{
  "content": "%USERNAME% has just beat their personal best in a speedrun of %QUEST% with a time of %TIME%",
  "extra": {
    "questName": "Cook's Assistant",
    "personalBest": "1:13.20",
    "currentTime": "1:13.20"
  },
  "type": "SPEEDRUN"
}
JSON for Normal Speedrun Notifications:
{
  "content": "%USERNAME% has just finished a speedrun of %QUEST% with a time of %TIME% (their PB is %BEST%)",
  "extra": {
    "questName": "Cook's Assistant",
    "personalBest": "1:13.20",
    "currentTime": "1:22.20"
  },
  "type": "SPEEDRUN"
}

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)

JSON for BA Gambles Notifications:
{
  "content": "%USERNAME% has reached %COUNT% high gambles",
  "extra": {
    "gambleCount": 500,
    "items": [
      {
        "id": 3122,
        "quantity": 1,
        "priceEach": 35500,
        "name": "Granite shield"
      }
    ]
  },
  "type": "BARBARIAN_ASSAULT_GAMBLE"
}

Credits

This plugin uses code from Universal Discord Notifier.

dinkplugin's People

Contributors

iprodigy avatar mm2pl avatar felanbird avatar midgetjake avatar pajlada avatar notheowner avatar tombolks avatar equirs avatar xel86 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.