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

Get All Mail Plugin

tokyov

Member
Joined
Dec 8, 2010
Messages
69
Reaction score
0
Code:
using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using ArcheBuddy.Bot.Classes;

namespace DefaultNamespace{
    public class DefaultClass : Core
    {
        public void PluginRun()
        {
            RequestMailList();
            foreach (var mail in getMails())
            {
                mail.OpenMail();
                if (!mail.isSent)
                {
                    mail.ReceiveGoldFromMail();
                    foreach (var item in mail.getItems())
                        mail.ReceiveItemFromMail(item);
                    mail.DeleteMail();
                }
                Thread.Sleep(1000);
            }
        }
    }
}

not working after AB update.

Unknown executing error, or plugin was forcibly unloaded.
 
Does this require you to be near a mailbox/have it open?

I don't want to mess with it if its that remote mail one.
 
I noticed it gives that error if u have full Inventory :P. Open Some space
 
Remove Thread.Sleep();
All another server related :)
 
I can confirm that there are some issues with mails.It seems that both getAllMails and getMails (what's the difference between them?) fail to return mails that the client has not "seen", as in mails that you received while not logged on.
The returned mails.count is 0, even if I have new mail when logging in.
If I manually open mailbox and THEN run getAllMails or getMails they work properly.They also work properly with mail delivered while I am logged in.
 
The returned mails.count is 0, even if I have new mail when logging in.
If I manually open mailbox and THEN run getAllMails or getMails they work properly.They also work properly with mail delivered while I am logged in.
Will check this tomorrow, thanks
 
Will check this tomorrow, thanks

You're welcome, but, as it turns out, in my case it was my fault.I wrote the code just from API reference, and it seems I was not calling RequestMailList before trying to get all mails.It seems to be working just fine when I call RequestMailList once, after client login.
Thanks!
 
You're welcome, but, as it turns out, in my case it was my fault.I wrote the code just from API reference, and it seems I was not calling RequestMailList before trying to get all mails.It seems to be working just fine when I call RequestMailList once, after client login.
Thanks!
Yes, you should call RequestMailList once.
 
Back
Top