Advertisement
BlackHatGuy

Untitled

Aug 4th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. ScriptAPI.$userService.getInventory(function(data) {
  2. var inventory = data.inventory.items;
  3. for (var a = 0; a < inventory.length; a++ ) {
  4. var item = inventory[a];
  5. // grey = rarity 1, green 2 blue 3 etc.
  6. if (item.rarity < 1) {API.inventory.sell(item) };
  7.  
  8. // if you want to disable auto-merging, just comment out everyone between here and the indicated line
  9. for (var b=0; b < inventory.length; b++) {
  10. var invItem = inventory[b];
  11. if (item != invItem && item.rarity == invItem.rarity
  12. && item.name == invItem.name
  13. && item.plus + invItem.plus < 5 + 5 * item.rarity ) {
  14.  
  15. var primary = item;
  16. var secondary = invItem;
  17.  
  18. if (primary.ts > secondary.ts) {
  19. primary = invItem;
  20. secondary = item;
  21. };
  22.  
  23.  
  24. ScriptAPI.$craftingService.craftItems(primary, secondary);
  25. };
  26. };
  27. // Merging stops on the line above this one
  28.  
  29. };
  30.  
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement