Skip to content

Instantly share code, notes, and snippets.

@RottenMind
Created January 29, 2015 05:46
Show Gist options
  • Save RottenMind/22ebe4b25d34f77c5900 to your computer and use it in GitHub Desktop.
Save RottenMind/22ebe4b25d34f77c5900 to your computer and use it in GitHub Desktop.
Sells items from crafting list
var _pbags_crafting = client.dataModel.model.ent.main.inventory.tradebag; //tradebag
$.each(_pbags_crafting, function (bi, bag) {
_pbags_crafting.forEach(function (slot) {
//console.log("item names", slot.name);
// Match unused slots
if (slot === null || !slot || slot === undefined) {
_bagUnused++;
}
// Match items to exclude from auto vendoring, dont add to _tmpBag: Exclude pattern list - bound - Epic Quality - Blue Quality
else if (_excludeItems.test(slot.name) || slot.bound || slot.rarity == "Special" || slot.rarity == "Gold") {
_bagUsed++;
}
// Match everything else
else {
if (settings["autovendor_profresults"]) {
for (i = 0; i < _profitems.length; i++) {
if (_profitems[i].pattern.test(slot.name))
_profitems[i].count++;
}
}
_tmpBag[_tmpBag.length] = slot;
_bagUsed++;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment