Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptAPI.$userService.getInventory(function(data) {
- var inventory = data.inventory.items;
- for (var a = 0; a < inventory.length; a++ ) {
- var item = inventory[a];
- // grey = rarity 1, green 2 blue 3 etc.
- if (item.rarity < 1) {API.inventory.sell(item) };
- // if you want to disable auto-merging, just comment out everyone between here and the indicated line
- for (var b=0; b < inventory.length; b++) {
- var invItem = inventory[b];
- if (item != invItem && item.rarity == invItem.rarity
- && item.name == invItem.name
- && item.plus + invItem.plus < 5 + 5 * item.rarity ) {
- var primary = item;
- var secondary = invItem;
- if (primary.ts > secondary.ts) {
- primary = invItem;
- secondary = item;
- };
- ScriptAPI.$craftingService.craftItems(primary, secondary);
- };
- };
- // Merging stops on the line above this one
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement