Last active
July 8, 2023 03:36
-
-
Save whiteball/367fd210f15b2e9e619eefb7f6f450ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AIのべりすと ハイパーロングタームメモリから条件付きでコメント除外 | |
// @namespace https://ai-novelist-share.geo.jp/ | |
// @version 0.1.0 | |
// @description @break、@startpoint、@endpoint、@/*の後ろに!!(エクスクラメーションマーク2つ)が書かれている場合、そのコメントの範囲をハイパーロングタームメモリの記憶対象に含めないようにします。 | |
// @author しらたま | |
// @match https://ai-novel.com/novel.php | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=ai-novel.com | |
// @updateURL https://gist.github.com/whiteball/367fd210f15b2e9e619eefb7f6f450ae/raw/ai_novelist_exluding_comments_from_hyper_ltm.user.js | |
// @downloadURL https://gist.github.com/whiteball/367fd210f15b2e9e619eefb7f6f450ae/raw/ai_novelist_exluding_comments_from_hyper_ltm.user.js | |
// @supportURL https://gist.github.com/whiteball/367fd210f15b2e9e619eefb7f6f450ae | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const originalAddLTMData = window.addLTMData | |
window.addLTMData = function (query, userid, docid, key_hash, lang='ja') { | |
query = query.replace(/^[\s\S]+@(break|startpoint)!!(\r?\n|$)/g, '') | |
.replace(/(^|\r?\n)@endpoint!![\s\S]+$/g, '') | |
// .replace(/@_!![\s\S]+(\r?\n|$)/g, '') | |
.replace(/@\/\*!![\s\S]*?@\*\/(\r?\n|$)?/g, '') | |
return originalAddLTMData(query, userid, docid, key_hash, lang) | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment