Risuai 0.6.3 first commit

This commit is contained in:
kwaroran
2023-05-07 12:41:45 +09:00
parent 50e5e1d917
commit 2c5c7d2694
98 changed files with 15070 additions and 0 deletions

15
src/ts/process/scripts.ts Normal file
View File

@@ -0,0 +1,15 @@
import type { character } from "../database";
const dreg = /{{data}}/g
export function processScript(char:character, data:string, mode:'editinput'|'editoutput'|'editprocess'){
for (const script of char.customscript){
if(script.type === mode){
const reg = new RegExp(script.in,'g')
data = data.replace(reg, (v) => {
return script.out.replace(dreg, v)
})
}
}
return data
}