mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 03:32:34 +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"))
|
||||
raw = raw.replace(/%src/g, getPlayerStr(src));
|
||||
if (raw.match("%dest"))
|
||||
raw = raw.replace(/%dest/g, getPlayerStr(dest));
|
||||
if (raw.match("%arg2"))
|
||||
raw = raw.replace(/%arg2/g, luatr(data[4]));
|
||||
if (raw.match("%arg"))
|
||||
raw = raw.replace(/%arg/g, luatr(data[3]));
|
||||
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
|
||||
|
||||
if (data.length > 3) {
|
||||
for (let i = 4; i < data.length; i++) {
|
||||
raw = raw.replace(new RegExp("%arg" + (i - 2), "g"), data[i]);
|
||||
}
|
||||
|
||||
raw = raw.replace(new RegExp("%arg", "g"), data[3]);
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
|
|
14
Fk/util.js
14
Fk/util.js
|
@ -34,11 +34,15 @@ function processPrompt(prompt) {
|
|||
if (raw.match("%src"))
|
||||
raw = raw.replace(/%src/g, getPlayerStr(src));
|
||||
if (raw.match("%dest"))
|
||||
raw = raw.replace(/%dest/g, getPlayerStr(dest));
|
||||
if (raw.match("%arg2"))
|
||||
raw = raw.replace(/%arg2/g, luatr(data[4]));
|
||||
if (raw.match("%arg"))
|
||||
raw = raw.replace(/%arg/g, luatr(data[3]));
|
||||
raw = raw.replace(/%dest/g, luatr(getPhoto(dest).general));
|
||||
|
||||
if (data.length > 3) {
|
||||
for (let i = 4; i < data.length; i++) {
|
||||
raw = raw.replace(new RegExp("%arg" + (i - 2), "g"), data[i]);
|
||||
}
|
||||
|
||||
raw = raw.replace(new RegExp("%arg", "g"), data[3]);
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user