Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //
- // Item Conditions - EDIT THIS CAREFULLY
- var ItemConditions = function(item) {
- // Add your conditions to this list
- var conditions = [
- //[(item.name == "Example" && item.rarity > 5), ItemResult.KEEP], // Example
- [(item.name == "Bow"), ItemResult.SELL],
- [(item.name == "Staff"), ItemResult.SELL],
- [(item.name == "Sword"), ItemResult.SELL],
- [(item.name == "2-handed Sword"), ItemResult.SELL],
- [(item.name == "Wand"), ItemResult.SELL],
- [(item.rarity < 5), ItemResult.SELL],
- ];
- // Ignore the rest of the function
- for (var i = 0; i < conditions.length; i++) {
- if (conditions[i][0] == true) {
- return conditions[i][1];
- }
- }
- return false;
- }
- var ItemResult = {
- SELL: 0,
- KEEP: 1,
- KEEPANDCONTINUE: 2,
- };
- for (var i = 0; i < items.length; i++)
- {
- // ItemConditions
- switch(ItemConditions(items[i])) {
- case ItemResult.SELL:
- sell(items[i]);
- return;
- case ItemResult.KEEP:
- return;
- case ItemResult.KEEPANDCONTINUE:
- break;
- default:
- break;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement