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

HonorLogger

hitmanice

Member
Joined
Apr 24, 2011
Messages
57
Reaction score
0
I wanted a plugin that would email me my honor throughout the day, to ensure that my bot ran throughout the day, without error, previously I just remoted into my home PC several times a day, to make sure it was still running, so I figured I'd make something to watch it for me, and keep me updated via email.

I made this in about 5 minutes, I do plan to develop it further... Much further and turn it into a full blown, all-in-one email notification system for every bot.

But I figured someone would find this useful :b
Code:
using System;
using System.Net.Mail;

using Styx.Plugins.PluginClass;

namespace HitManPlugins
{
    public class HonorLogger: HBPlugin
    {
        private bool FirstRun = true;
        private uint HonorPoints;

        public override void Pulse()
        {
            if (FirstRun){
                FirstRun = false;
                HonorPoints = Styx.WoWInternals.WoWCurrency.GetCurrencyByType(Styx.WoWInternals.WoWCurrencyType.HonorPoints).Amount;
	            Push(HonorPoints);
            }

            if (Styx.WoWInternals.WoWCurrency.GetCurrencyByType(Styx.WoWInternals.WoWCurrencyType.HonorPoints).Amount >= HonorPoints + 200)
            {
                Push(Styx.WoWInternals.WoWCurrency.GetCurrencyByType(Styx.WoWInternals.WoWCurrencyType.HonorPoints).Amount);
                HonorPoints = Styx.WoWInternals.WoWCurrency.GetCurrencyByType(Styx.WoWInternals.WoWCurrencyType.HonorPoints).Amount;
            }
        }

        public void Push(uint x)
        {
            MailMessage y = new MailMessage("[email protected]", "[email protected]", "Honor Update!", "Your Honor Has Reached: " + x);
            SmtpClient z = new SmtpClient("smtp.live.com", 587); //This is the SMTP For Windows Live & MSN
            z.Credentials = new System.Net.NetworkCredential("[email protected]", "EmailAddressPassword");
            z.EnableSsl = true;
            z.Send(y);
        }

        public override string Name { 
            get { 
                return "HonorLogger"; 
            } 
        }

        public override string Author { 
            get { 
                return "HitManIce"; 
            } 
        }

        public override Version Version { 
            get { 
                return new Version(1, 0, 0, 0); 
            } 
        }
    }
}

Enjoy :b
 
Back
Top