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

Open all mail and take attached items plugin

Bobabob

New Member
Joined
Oct 18, 2014
Messages
56
Reaction score
0
I couldn't find anything about this.

Does anyone have a code to enable opening all mail and looting all the gold/items in it?

I know you can do it by opening the mail and scrolling through the pages and clicking everything but if you have multiple pages I thought there might be some easier way.
 
In game, its just 2 clicks per page to get all mails. Check the checkbox to select all mail, then click 3rd option (get all attached.. )

Or:

https://www.thebuddyforum.com/arche...-plugins-example-post1636358.html#post1636358

I use the script in the link, it works okay. But I think it would be even better if you used it like opening a real mailbox.

Example:
Get mail & attachments for x amount of mails (x amount is the amount of mails per page ingame) as fast as possible, no delay.
Sleep 2 seconds, repeat.
 
Try this:
I cant test atm, but i think its ok.
Group by pages, then receive/delete all from 1st page, wait 2 seconds, continues...

Code:
var itensPerPage = 10;
            
            RequestMailList();
            var mailsGroupedByPage = getAllMails().Select((mail, index) => new { Index = index, Mail = mail })
                .GroupBy(item => item.Index / itensPerPage)
                .Select(chunk => chunk.Select(item => item.Mail).ToList())
                .ToList();
            
            foreach (var group in mailsGroupedByPage) 
            {
                foreach(var mail in group)
                {
                    mail.OpenMail();
                    if (!mail.isSent)
                    {
                        mail.ReceiveGoldFromMail();
                        foreach (var item in mail.getItems())
                            mail.ReceiveItemFromMail(item);
                        mail.DeleteMail();
                    }
                }
                Thread.Sleep(2000);
            }
 
Tried the two codes. 1st one doesn't even launch and the 2nd one I kinda copied and pasted it into Out's code after removing the corresponding part.

Lotsa errors though. No idea what I'm doing wrong. ANyone willing to post the full code? I'll test it for you.

Thanks!
 
Back
Top