modify algorithm

This commit is contained in:
Ho-spair 2024-05-15 18:24:23 +08:00
parent 3f5f8a7f16
commit 495c08cb0f
1 changed files with 3 additions and 3 deletions

View File

@ -499,11 +499,11 @@ function processPrompt(prompt) {
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general)); raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
if (data.length > 3) { if (data.length > 3) {
for (let i = 4; i < data.length; i++) { for (let i = data.length - 1; i > 3; i--) {
raw = raw.replace(new RegExp("%arg" + (i - 2), "g"), data[i]); raw = raw.replace(new RegExp("%arg" + (i - 2), "g"), luatr(data[i]));
} }
raw = raw.replace(new RegExp("%arg", "g"), data[3]); raw = raw.replace(new RegExp("%arg", "g"), luatr(data[3]));
} }
return raw; return raw;
} }