mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
modify [function] processPrompt
This commit is contained in:
parent
d11bf58cb4
commit
d5832b824b
|
@ -542,11 +542,15 @@ function processPrompt(prompt) {
|
||||||
if (raw.match("%src"))
|
if (raw.match("%src"))
|
||||||
raw = raw.replace(/%src/g, getPlayerStr(src));
|
raw = raw.replace(/%src/g, getPlayerStr(src));
|
||||||
if (raw.match("%dest"))
|
if (raw.match("%dest"))
|
||||||
raw = raw.replace(/%dest/g, getPlayerStr(dest));
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
Fk/util.js
14
Fk/util.js
|
@ -34,11 +34,15 @@ function processPrompt(prompt) {
|
||||||
if (raw.match("%src"))
|
if (raw.match("%src"))
|
||||||
raw = raw.replace(/%src/g, getPlayerStr(src));
|
raw = raw.replace(/%src/g, getPlayerStr(src));
|
||||||
if (raw.match("%dest"))
|
if (raw.match("%dest"))
|
||||||
raw = raw.replace(/%dest/g, getPlayerStr(dest));
|
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
Block a user