Use Wrobot plugin it is better:
using System.Diagnostics;
using wManager.Wow.Helpers;
public class Main : wManager.Plugin.IPlugin
{
public void Initialize()
{
var t = Stopwatch.StartNew();
wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) =>
{
if (t.ElapsedMilliseconds > 1000) // Every second
{
Lua.LuaDoString("QuickHeal()");
t.Restart();
}
};
}
public void Dispose()
{
}
public void Settings()
{
}
}
Or
using System.Diagnostics;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
public class Main : wManager.Plugin.IPlugin
{
public void Initialize()
{
var t = Stopwatch.StartNew();
wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) =>
{
if (t.ElapsedMilliseconds > 1000) // Every second
{
Lua.LuaDoString("QuickHeal()");
if (unit.Guid != ObjectManager.Me.Target) // Target change, cancel fight and start new
{
cancelable.Cancel = true;
Fight.StartFight(ObjectManager.Me.Target);
return;
}
t.Restart();
}
};
}
public void Dispose()
{
}
public void Settings()
{
}
}