[fix] fix triggers
This commit is contained in:
@@ -503,7 +503,9 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
|||||||
await sayTTS(currentChar, result)
|
await sayTTS(currentChar, result)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
const msgs = req.type === 'success' ? [['char',req.result]] as const : req.type === 'multiline' ? req.result : []
|
const msgs = (req.type === 'success') ? [['char',req.result]] as const
|
||||||
|
: (req.type === 'multiline') ? req.result
|
||||||
|
: []
|
||||||
for(const msg of msgs){
|
for(const msg of msgs){
|
||||||
const msgIndex = db.characters[selectedChar].chats[selectedChat].message.length
|
const msgIndex = db.characters[selectedChar].chats[selectedChat].message.length
|
||||||
const result2 = processScriptFull(nowChatroom, reformatContent(msg[1]), 'editoutput', msgIndex)
|
const result2 = processScriptFull(nowChatroom, reformatContent(msg[1]), 'editoutput', msgIndex)
|
||||||
|
|||||||
@@ -67,14 +67,13 @@ export function runTrigger(char:character,mode:triggerMode, arg:{
|
|||||||
historyend: '',
|
historyend: '',
|
||||||
promptend: ''
|
promptend: ''
|
||||||
}
|
}
|
||||||
let varValues = getVarChat(-1, char)
|
|
||||||
let varValuesChanged = false
|
|
||||||
const triggers = char.triggerscript
|
const triggers = char.triggerscript
|
||||||
const chat = arg.chat ?? char.chats[char.chatPage]
|
const chat = arg.chat ?? char.chats[char.chatPage]
|
||||||
if(!triggers){
|
if(!triggers){
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
let varValues = getVarChat(-1, char)
|
||||||
|
let varValuesChanged = false
|
||||||
for(const trigger of triggers){
|
for(const trigger of triggers){
|
||||||
if(mode !== trigger.type){
|
if(mode !== trigger.type){
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user