diff --git a/public/script.js b/public/script.js
index 8ad914990..4ba6f2397 100644
--- a/public/script.js
+++ b/public/script.js
@@ -1336,7 +1336,14 @@ async function Generate(type, automatic_trigger, force_name2) {
let hordeAmountGen = null;
if (main_api == 'kobold' && horde_settings.use_horde && horde_settings.auto_adjust) {
- const adjustedParams = await adjustHordeGenerationParams(this_max_context, amount_gen);
+ let adjustedParams;
+ try {
+ adjustedParams = await adjustHordeGenerationParams(this_max_context, amount_gen);
+ }
+ catch {
+ activateSendButtons();
+ return;
+ }
this_max_context = adjustedParams.maxContextLength;
hordeAmountGen = adjustedParams.maxLength;
}
diff --git a/public/scripts/extensions/dice/index.js b/public/scripts/extensions/dice/index.js
index c8c287bd8..2b098fce5 100644
--- a/public/scripts/extensions/dice/index.js
+++ b/public/scripts/extensions/dice/index.js
@@ -1,3 +1,4 @@
+import { callPopup } from "../../../script.js";
import { getContext } from "../../extensions.js";
export { MODULE_NAME };
@@ -10,8 +11,13 @@ function setDiceIcon() {
sendButton.classList.remove('spin');
}
-function doDiceRoll() {
- const value = $(this).data('value');
+async function doDiceRoll() {
+ let value = $(this).data('value');
+
+ if (value == 'custom') {
+ value = await callPopup('Enter the dice formula:
(for example, 2d6)', 'input');
+ }
+
const isValid = droll.validate(value);
if (isValid) {
@@ -33,6 +39,7 @@ function addDiceRollButton() {