NW_profession_names

Prins NW professions name to console

< Обсуждения NW_profession_names

Вопрос/комментарий

This script doesn't work for me :(

I think it list only tasks with not empty list of consumables.

this piece of code lists everything:

    var professuinlist = tasks.forEach(function (main) {
        console.log("LVL:" + main.def.requiredrank, ",name:" + '"' + main.def.displayname + '"', "taskname:" + '"' + main.def.name + '".'/*,",SELL_list name:"+ slotrewards.hdef,"Required crafted item:"+ slotconsum.hdef*/);
        main.consumables.forEach(function (slotconsum) {
            console.log("Required crafted item:"+ slotconsum.hdef.replace("@ItemDef[","").replace("]",""));
        });
        main.rewards.forEach(function (slotrewards) {
            console.log("Reward is:"+ slotrewards.hdef.replace("@ItemDef[","").replace("]",""));
        });
    });

If you want this in one line just concatenate strings and log at the end.

Rotten_mindАвтор
§
Создано: 10.03.2015
Отредактировано: 10.03.2015

Leadership, not listing, others yes.

yes, with "concat" can join them.

I made it because wanted update profession lists and it did most... also with tools and premade list I can direct some questions away or make people find answers easier .

Maybe need join "inventory & profession names", :-/.

Still not perfect, but prints now items I needed, THX for advice.

function Print_prodessions(proffession) {

var tasks = unsafeWindow.client.dataModel.model.craftinglist['craft_' + proffession].entries.filter(function (entry) {
    return entry.def && entry.def.displayname;
});
//var tasks = unsafeWindow.client.dataModel.model.craftinglist['craft_' + 'Artificing'];
var professuinlist = tasks.forEach(function (main) {
    main.consumables.forEach(function (slotconsum) {
        main.rewards.forEach(function (slotrewards) {
            console.log("LVL:" + main.def.requiredrank + ", ", "name: " + '"' + main.def.displayname + '", ', "task: " + '"' + main.def.name + '", ', main.rewards[0].hdef.replace('[',': "').replace(']', '", '), "Required:" + main.consumables[0].hdef.replace('@ItemDef[',' "').replace(']', '",'));
        });
    });
});
}

Ответить

Войдите, чтобы ответить.