From 3f12bc58858246c1ec19715c415e9348ab54a747 Mon Sep 17 00:00:00 2001 From: Matt Wagner Date: Sun, 20 Jun 2021 14:13:29 -0700 Subject: [PATCH] Adding datanet link trigger --- CREDITS.md | 1 + mfile | 2 +- src/triggers/datanet-links/datanet-link.lua | 5 +++++ src/triggers/datanet-links/triggers.json | 12 ++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 CREDITS.md create mode 100644 src/triggers/datanet-links/datanet-link.lua create mode 100644 src/triggers/datanet-links/triggers.json diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..a7760d2 --- /dev/null +++ b/CREDITS.md @@ -0,0 +1 @@ +Datanet links by Fishy and Kbug diff --git a/mfile b/mfile index 45c406e..2247571 100644 --- a/mfile +++ b/mfile @@ -1,4 +1,4 @@ { "package": "lotj-ui", - "version": "v2.0.3" + "version": "v2.0.4" } \ No newline at end of file diff --git a/src/triggers/datanet-links/datanet-link.lua b/src/triggers/datanet-links/datanet-link.lua new file mode 100644 index 0000000..9714ac4 --- /dev/null +++ b/src/triggers/datanet-links/datanet-link.lua @@ -0,0 +1,5 @@ +for i = 1, #matches, 4 do + selectString(matches[i], 1) + setUnderline(true) + setLink([[send("datanet ]] .. matches[i] .. [[")]], "Datanet link: " .. matches[i]) +end \ No newline at end of file diff --git a/src/triggers/datanet-links/triggers.json b/src/triggers/datanet-links/triggers.json new file mode 100644 index 0000000..e98281e --- /dev/null +++ b/src/triggers/datanet-links/triggers.json @@ -0,0 +1,12 @@ +[ + { + "name": "datanet-link", + "matchall": true, + "patterns": [ + { + "pattern": "(?:(\"\\w+.*?\\w+\"|';\\w+.*?\\w+'|\\w+?)?):(\\/(?:(\\w|\\d|_)+?\\/?)+)", + "type": "regex" + } + ] + } +]