modify [function] processPrompt
This commit is contained in:
parent
766e93378e
commit
3f5f8a7f16
|
@ -497,10 +497,14 @@ function processPrompt(prompt) {
|
||||||
raw = raw.replace(/%src/g, luatr(getPhoto(src).general));
|
raw = raw.replace(/%src/g, luatr(getPhoto(src).general));
|
||||||
if (raw.match("%dest"))
|
if (raw.match("%dest"))
|
||||||
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
|
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
|
||||||
if (raw.match("%arg2"))
|
|
||||||
raw = raw.replace(/%arg2/g, luatr(data[4]));
|
if (data.length > 3) {
|
||||||
if (raw.match("%arg"))
|
for (let i = 4; i < data.length; i++) {
|
||||||
raw = raw.replace(/%arg/g, luatr(data[3]));
|
raw = raw.replace(new RegExp("%arg" + (i - 2), "g"), data[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
raw = raw.replace(new RegExp("%arg", "g"), data[3]);
|
||||||
|
}
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
Fk/util.js
12
Fk/util.js
|
@ -21,10 +21,14 @@ function processPrompt(prompt) {
|
||||||
raw = raw.replace(/%src/g, luatr(getPhoto(src).general));
|
raw = raw.replace(/%src/g, luatr(getPhoto(src).general));
|
||||||
if (raw.match("%dest"))
|
if (raw.match("%dest"))
|
||||||
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
|
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
|
||||||
if (raw.match("%arg2"))
|
|
||||||
raw = raw.replace(/%arg2/g, luatr(data[4]));
|
if (data.length > 3) {
|
||||||
if (raw.match("%arg"))
|
for (let i = 4; i < data.length; i++) {
|
||||||
raw = raw.replace(/%arg/g, luatr(data[3]));
|
raw = raw.replace(new RegExp("%arg" + (i - 2), "g"), data[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
raw = raw.replace(new RegExp("%arg", "g"), data[3]);
|
||||||
|
}
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue