What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Item Merge

Status
Not open for further replies.

XetroNew

Member
Joined
Jun 10, 2013
Messages
45
Reaction score
2
Can anybody give a example of the short code? Not the API btw i know the api but i not sure how to use it.

This is my code

Code:
        public void MergeItem()
        {
            foreach (var item in me.getItems())
            {
                if (item.place == ItemPlace.Bag && MergeItems.Exists(s => s == item.id))
                {
                    if (!item.Merge(item)) << This is where i stuck 
                        Log("Items ID " + item.name);
                        Thread.Sleep(500);
                }
            }
        }
 
Last edited:
I try with other code still no luck.

Code:
        public void MergeItem()
        {
            foreach (var item in me.getItems())
            {
                if(item.place == ItemPlace.Bag)
                {
                    if(item.id == 16348)
                    {
                        while(item.count > 0)
                        {
                            item.Merge(item);
                        }
                    }
                }
            }
        }
 
Hi. You should merge item with another item.
For example, you have in your inventory 2x items stacks
First stack = 5
Second stack = 10

Code:
 public void MergeItem()
        {
            Item item1 = null;
            Item item2 = null;
            foreach (var item in me.getItems())
            {
                if(item.place == ItemPlace.Bag)
                {
                    if(item.id == 16348 && item.count == 5)
                       item1 = item;
                    if(item.id == 16348 && item.count == 10)
                       item2 = item;
                    }
                }
            }
            it (item1 != null && item2 != null)
              item1.Merge(item2);
        }

So basically, you can do something like:
foreach all items:
find first item stack. Then found all another items and add them to new List
Then foreach this list and Merge each item from this list with first item
 
Status
Not open for further replies.
Back
Top