From 0ad30f24898877c712a249434fcbc0a268f86315 Mon Sep 17 00:00:00 2001 From: Spicy_Marinara Date: Wed, 15 Oct 2025 09:50:41 +0200 Subject: [PATCH] Add delay before Continue click and console logs to debug quietPrompt --- index.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index b345997..a1936c8 100644 --- a/index.js +++ b/index.js @@ -617,16 +617,24 @@ async function sendPlotProgression(type) { // This is the proper way to add additional instructions to a continuation const context = getContext(); const originalQuietPrompt = context.quietPrompt || ''; + + // Set the quiet prompt that will be appended to the continuation prompt context.quietPrompt = prompt; + + console.log('[RPG Companion] Set quietPrompt:', context.quietPrompt); + console.log('[RPG Companion] Full prompt:', prompt); - // Trigger actual continuation by calling the continuation function directly - // Use Generate with empty string for 'normal' type, but set continue_type to true - $('#option_continue').trigger('click'); - - // Restore the original quiet prompt after generation starts + // Small delay to ensure quietPrompt is set before triggering continuation setTimeout(() => { - context.quietPrompt = originalQuietPrompt; - }, 500); + // Trigger continuation + $('#option_continue').trigger('click'); + + // Restore the original quiet prompt after a delay + setTimeout(() => { + context.quietPrompt = originalQuietPrompt; + console.log('[RPG Companion] Restored original quietPrompt'); + }, 500); + }, 50); // console.log('[RPG Companion] Plot progression generation triggered'); } catch (error) {