[feat] added regex script helps
This commit is contained in:
@@ -50,6 +50,13 @@ export const languageEnglish = {
|
|||||||
+ "\n- if the key starts with **|**, the key's value will not change."
|
+ "\n- if the key starts with **|**, the key's value will not change."
|
||||||
+ "\n- if the key starts with **$**, the key's value will more likely to change."
|
+ "\n- if the key starts with **$**, the key's value will more likely to change."
|
||||||
+ "\n\nwhen the image is first generated, you can only change it by modifying 'Current Image Generation Data' in below.",
|
+ "\n\nwhen the image is first generated, you can only change it by modifying 'Current Image Generation Data' in below.",
|
||||||
|
|
||||||
|
regexScript: "Regex Script is a custom script that is embbedded to the character. it replaces string that matches IN to OUT.\n\nThere are three type options."
|
||||||
|
+ "- **Modify Input** modifys user's input"
|
||||||
|
+ "- **Modify Output** modifys character's output"
|
||||||
|
+ "- **Modify Request Data** modifys current chat data when sent.\n\nIN must be a regex without flags and *\\*.\n\nOUT is a normal string."
|
||||||
|
+ "\n\n If OUT starts with @@, it doesn't replaces the string, but instead does a special effect if matching string founds."
|
||||||
|
+ "\n\n- @@emo (emotion name)\n\n if character is Emotion Images mode, sets (emotion name) as emotion and prevents default.",
|
||||||
experimental: "This is a experimental setting. it might be unstable."
|
experimental: "This is a experimental setting. it might be unstable."
|
||||||
},
|
},
|
||||||
setup: {
|
setup: {
|
||||||
|
|||||||
@@ -179,7 +179,13 @@ export const languageKorean = {
|
|||||||
+ "\n- 키의 이름이 **|** 로 시작할 시, 값은 고정됩니다."
|
+ "\n- 키의 이름이 **|** 로 시작할 시, 값은 고정됩니다."
|
||||||
+ "\n- 키의 이름이 **$** 로 시작할 시, 값은 더 자주 변합니다."
|
+ "\n- 키의 이름이 **$** 로 시작할 시, 값은 더 자주 변합니다."
|
||||||
+ "\n\n이미지가 처음 생성된 이후부터는 '현재 이미지 생성 데이터'를 수정하여 변경할 수 있습니다.",
|
+ "\n\n이미지가 처음 생성된 이후부터는 '현재 이미지 생성 데이터'를 수정하여 변경할 수 있습니다.",
|
||||||
experimental: "실험적 기능입니다. 불안정할 수 있습니다."
|
experimental: "실험적 기능입니다. 불안정할 수 있습니다.",
|
||||||
|
regexScript: "정규식 스크립트는 캐릭터에 종속된 커스텀 스크립트입니다. IN의 조건에 맞는 문자열을 OUT으로 변경합니다.\n\n타입은 세가지가 있습니다."
|
||||||
|
+ "- **입력문 수정** 유저의 입력문을 수정합니다"
|
||||||
|
+ "- **출력문 수정** 캐릭터의 출력문을 수정합니다"
|
||||||
|
+ "- **리퀘스트 데이터 수정** 리퀘스트를 보낼 때 채팅 데이터를 수정합니다.\n\nIN은 flag와 *\\* 가 없는 Regex여야 합니다.\n\nOUT은 일반 문자열입니다."
|
||||||
|
+ "\n\n 만약 OUT이 @@로 시작된다면, 특수한 효과를 냅니다"
|
||||||
|
+ "\n\n- @@emo (emotion name)\n\n 감정 이미지 모드일 시 (emotion name)을 감정으로 정하고 감정 처리를 하지 않습니다.",
|
||||||
},
|
},
|
||||||
setup: {
|
setup: {
|
||||||
chooseProvider: "AI 제공자를 선택해 주세요",
|
chooseProvider: "AI 제공자를 선택해 주세요",
|
||||||
|
|||||||
@@ -396,7 +396,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
</table>
|
</table>
|
||||||
<span class="text-neutral-200 mt-4">{language.regexScript} <Help key="experimental"/></span>
|
<span class="text-neutral-200 mt-4">{language.regexScript} <Help key="regexScript"/></span>
|
||||||
<table class="contain w-full max-w-full tabler mt-2 flex flex-col p-2 gap-2">
|
<table class="contain w-full max-w-full tabler mt-2 flex flex-col p-2 gap-2">
|
||||||
{#if currentChar.data.customscript.length === 0}
|
{#if currentChar.data.customscript.length === 0}
|
||||||
<div class="text-gray-500">No Scripts</div>
|
<div class="text-gray-500">No Scripts</div>
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ export function processScriptFull(char:character, data:string, mode:ScriptMode){
|
|||||||
if(char.viewScreen !== 'emotion'){
|
if(char.viewScreen !== 'emotion'){
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
if(emoChanged){
|
||||||
|
return v
|
||||||
|
}
|
||||||
const emoName = script.out.substring(6).trim()
|
const emoName = script.out.substring(6).trim()
|
||||||
let charemotions = get(CharEmotion)
|
let charemotions = get(CharEmotion)
|
||||||
let tempEmotion = charemotions[char.chaId]
|
let tempEmotion = charemotions[char.chaId]
|
||||||
|
|||||||
Reference in New Issue
Block a user