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

Help fixing a simple /dnd plugin

Cukie

Active Member
Joined
Dec 3, 2011
Messages
1,255
Reaction score
3
I had a simple dnd plugin someone wrote for me that simply puts up a /dnd message when enabled, but it has broken during one of the previous HB updates, and now I am getting compile errors! Please help!!

Code:
Compiler Error: f:\HB\Plugins\DND\DND.cs(15,30) : error CS0115: 'DND.DND.Initialize()': no suitable method found to override
Compiler Error: f:\HB\Plugins\DND\DND.cs(16,30) : error CS0115: 'DND.DND.Dispose()': no suitable method found to override



Code:
using System;
using System.Windows.Media;
using System.Threading;

using Styx.Common;
using Styx.Common.Helpers;
using Styx.Plugins;
using Styx.WoWInternals;

namespace DND
{
    public partial class DND : HBPlugin
    {
    #region Overrides of HBPlugin 
        public override void Initialize(){}
        public override void Dispose(){}

        public override string  ButtonText { get { return "No Settings"; } }
        public override bool    WantButton { get { return false; } }
        public override void OnButtonPress() {}
        public override string  Name { get { return "DND"; } }
        public override string  Author { get { return "Powa"; } }
        public override Version Version { get { return new Version(0, 1); } }

        public override void Pulse()
		{
			
			//getting dnd info
            bool isDND = Lua.GetReturnVal<bool>("return  UnitIsDND(\"player\")",0);
			if(isDND==false)
			{	String msg = "INSERT MESSAGE HERE";   // Choose your message here 
			
	            Lua.DoString("RunMacroText(\"/dnd "+msg+ "\")"); 
				Logging.Write(Colors.SeaGreen, "Your are now Busy : DND");
				Thread.Sleep(1000);
			}
		}

    #endregion
    }
}
 
Remove the lines:

public override void Initialize(){}
public override void Dispose(){}

and it should fix your error...

However, this code will hammer your client with the same LUA request 'return UnitIsDND("player")' many times a second..

adding some code to only to this like once a minute is probs a smart thing.
I think the FPSRefresher plugin do this, would check it out :)

I would also the line saying Thread.Sleep, will just fuck things up..
 
Hmm, I can't seem to find FPSRefresher, do you have a link by chance?
 
Back
Top