Advertisement
kolton

Untitled

Jan 29th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. buildLists: function () {
  2. var i, j, k, items;
  3.  
  4. this.validIngredients = [];
  5. this.neededIngredients = [];
  6. items = me.getItems(-1, 0);
  7.  
  8. for (i = 0; i < this.recipes.length; i += 1) {
  9. IngredientLoop: for (j = 0; j < this.recipes[i].Ingredients.length; j += 1) {
  10. for (k = 0; k < items.length; k += 1) {
  11. if ((this.recipes[i].Ingredients[j] === "pgem" && [566, 571, 576, 581, 586, 601].indexOf(items[k].classid) > -1 || items[k].classid === this.recipes[i].Ingredients[j]) && this.validItem(items[k], this.recipes[i])) {
  12. this.validIngredients.push({classid: items[k].classid, gid: items[k].gid});
  13. items.splice(k, 1); // Remove from item list to prevent counting the same item more than once
  14. continue IngredientLoop;
  15. }
  16. }
  17.  
  18. this.neededIngredients.push({classid: this.recipes[i].Ingredients[j], recipe: this.recipes[i]});
  19. }
  20. }
  21. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement