Automatically selects professions for empty slots
< Feedback on Neverwinter gateway - Profession Automation
Yeah, I should add it, something like this, not sure if ! work here.
if (settings["autovendor_pots2"] && settings['Alchemy'] = 0) {
_vendorItems[_vendorItems.length] = {
pattern: /^Potion_(Healing|Tidespan|Force|Fortification|Reflexes|Accuracy|Rejuvenation)_2$/,
limit: 0
};
}
Alchemy is value 0 - 99 and only if its 0 its safe to Vendor potions, I did this same mistake many times and sold potions when leveling alchemy.... can blame script when itself make foul moves, ;)
I have always wanted the vendor settings in particular to be able to be character specific, overriding the global settings per character.
Three ways to go if like do, if make level check then can vendor lower rank stuff if level X...
Check if Alchemy is active, simple,
(settings["autovendor_pots2"] && settings['Alchemy'] = 0)
add level check, not sure if its same array allways
var Alchemy_rank = unsafeWindow.client.dataModel.model.ent.main.itemassignmentcategories.categories[7].currentrank;
make level check with function, need variables....
// Check level
var level = unsafeWindow.client.dataModel.model.ent.main.itemassignmentcategories.categories.filter(function (entry) {
return entry.name == prof.taskName; //
})[0].currentrank;
var list = prof.level[level];
hmmm, then it should be, need check that value also against "undefined" and "null"?
(settings["autovendor_pots_1_2"] && settings['Alchemy'] == 0) //logical ;)
and I add higher level potions too, but they will be "nested" on groups, two potions level per group.
I think lvl60 stuff is mostly trash now so will it be,
What you think, separate all heath potions to one section.
...hmm, need TAB´s but dont want extra java stuff...
RegEx Experts, check it out http://regexpal.com/ (dot matches all, ^$ match at line breaks), still need test it.
This is how I think it must be done, I edited two sections for test purpose and both gives same results,
script rotations, no potions Vendored if Alchemy
users switch new character by hand
Solution is look if character data can loaded if use "Inventory Vendor", but just now IDK if its needed... normal exclude list works anyway and per profession works if script do rotation.
Vendor exclude is here, just simple REgexp concatenate... testing it,
// MAC-NW
function vendorItemsLimited(_items) {
var _Alchemy_state = parseInt(settings["Alchemy"]);
var _charGold = unsafeWindow.client.dataModel.model.ent.main.currencies.gold;
var _pbags = client.dataModel.model.ent.main.inventory.playerbags;
var _pbags_crafting = client.dataModel.model.ent.main.inventory.tradebag; //tradebag
var _delay = 400;
var _sellCount = 0;
var _classType = unsafeWindow.client.dataModel.model.ent.main.classtype;
var _bagCount = unsafeWindow.client.dataModel.model.ent.main.inventory.playerbags.length;
var _bagUsed = 0;
var _bagUnused = 0;
var _tmpBag1 = [];
var _tmpBag2 = [];
//var _tmpBag = [];
var _profitems = [];
// Pattern for items to leave out of auto vendoring (safeguard)
var _exclude_Alchemy = /^Potion_(Healing|Tidespan|Force|Fortification|Reflexes|Accuracy|Rejuvenation)(|_[1-5])$/;
var _excludeItems = /(Charcoal|Rocksalt|Spool_Thread|Porridge|Solvent|Brimstone|Coal|Moonseasalt|Quicksilver|Spool_Threadsilk|Clues_Bandit_Hq|Clothscraps_T4|Clothbolt_T4|Potion_Potency|Potion_Protection|Taffeta|Crafting_Asset|Craftsman|Aqua|Vitriol|Residuum|Shard|Crystal|District_Map|Local_Map|Bill_Of_Sale|Refugee|Asset_Tool|Tool|Gemfood|Gem_Upgrade_Resource|Crafting_Resource_Elemental|Elemental|Artifact|Hoard|Coffer|Fuse|Ward|Preservation|Armor_Enhancement|Weapon_Enhancement|T[5-9]_Enchantment|T[5-9]_Runestones|T10_Enchantment|T10_Runestones|4c_Personal|Item_Potion_Companion_Xp|Gateway_Rewardpack|Consumable_Id_Scroll|Dungeon_Delve_Key)/; // edited by RottenMind 08.03.2015
if (_Alchemy_state !== 0) {
_excludeItems = new RegExp(_exclude_Alchemy.source + "|" + _excludeItems.source); // make sure that we DONT sell potions if leveling
}
console.log(_excludeItems);
Test it,
I think its good to go,
https://greasyfork.org/en/scripts/7808-neverwinter-gateway-professions-robot
, and need investigate more this REgeX concatenate. Now exclude is one list and it prevent some sales we want do, so splitting it parts will help with VEndor options.
Any way quality filter prevents 90% unwanted anyway.
```if (settings["autovendor_pots2"] && settings['Alchemy'] = 0) {
Can't be correct to begin with, comparison operator in JavaScript is either `==` or `===` .
`=` is an assignment operator.
But it is a logical error, if the script button doesn't appear it means most likely a syntax / parsing error.
Try checking the log (ctrl+shift+j) to see where it was.
Would it be possible to add a code line that says if Alchemy is being trained on the character, don't sell any potions other than the Unstable ones?
Otherwise, if you have sell potions on, you'll never level alchemy.