I've got two information commands
First is a new version of the search command:
Code: Select all
case 'search':
// Expanded search function e.g.
// > search item iron
// > search monster mush
const s_arr = params[0];
const searchVals = [];
const queryX = params.slice(1) && params.slice(1).length ? params.slice(1).join(' ').toLowerCase() : undefined;
if(queryX){
if(s_arr == "item"){
for(const [key, value] of Object.entries(itemDefs)){
const valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
if (valName.includes(queryX)) {
searchVals.push(`${key} - ${valName}`);
}
}
} else if(s_arr == "monster"){
for (const [key, value] of Object.entries(monsterDefs)) {
const valName = value.h["Name"].replace(/_/g, ' ').toLowerCase();
if (valName.includes(queryX)) {
searchVals.push(`${key} - ${valName}`);
}
}
} else return "Nothing!";
if (searchVals.length > 0) return searchVals.join('\n');
else return `No info found for '${queryX}'`;
}
break;
This one behalves practically the same as iBelg's original search, but also allows you to search for monster ids:
Code: Select all
> search item iron
> search monster mush
The second is a csv id list creator:
Code: Select all
case 'list':
// Used to create Id lists in csv style
const l_arr = params[0];
const foundVals = [];
if(l_arr == "item"){
foundVals.push("Id, ingameName");
for(const [key, value] of Object.entries(itemDefs)){
const valName = value.h.displayName.replace(/_/g, ' ').toLowerCase();
foundVals.push(`${key}, ${valName}`);
}
} else if(l_arr == "monster"){
foundVals.push("Id, ingameName, HP, Defence, Damage, EXP");
for(const [key, value] of Object.entries(monsterDefs)){
const valName = value.h["Name"].replace(/_/g, ' ').toLowerCase();
foundVals.push(`${key}, ${valName}, ${value.h["MonsterHPTotal"]}, ${value.h["Defence"]}, ${value.h["Damages"][0]}, ${value.h["ExpGiven"]}`);
}
} else if(l_arr == "class"){
foundVals.push("Id, ClassName, PromotesTo");
const FuncList1 = CList.ClassNames();
const FuncList2 = CList.ClassPromotionChoices();
for(const [index, element] of FuncList1.entries())
foundVals.push(`${index}, ${element}, [${FuncList2[index]}]`);
} else if(l_arr == "quest"){
foundVals.push("Id, QuestName, NPC, paramX1, paramX2");
const FuncList1 = CList.SceneNPCquestOrder();
const FuncList2 = CList.SceneNPCquestInfo();
for(const [index, element] of FuncList1.entries())
foundVals.push(`${element}, ${FuncList2[index].join(", ")}`);
} else if(l_arr == "map"){
foundVals.push("Id, MapName, AFK1, AFK2, Transition");
const FuncList1 = CList.MapName();
const FuncList2 = CList.MapDispName();
const FuncList3 = CList.MapAFKtarget();
const FuncList4 = CList.MapAFKtargetSide();
const FuncList5 = CList.SceneTransitions();
for(const [index, element] of FuncList1.entries()){
foundVals.push(`${element}, ${FuncList2[index]}, ${FuncList3[index]}, ${FuncList4[index]}, [${FuncList5[index]}]`);
}
}
else return "Nothing";
return foundVals.join("\n"); // Concatenate all lines into one string with new lines
break;
It can list
item,
monster,
class,
quest and
map to the console like this...
...so you can simply copy paste the stuff into a new textfile.
The only weakness of this command (when listing item ids) is that the cards don't have a proper displayName, but that's a minor issue as everybody would simply bulk obtain all cards at once anyway.