I wrote some code to do this a while back... I didn't take the time to make it general for everybody but I'll post it here in case any intrepid coders want to fix it up for their class or run with it.
I took someone else's base plugin template for the functions to override and whatnot, don't remember who it was, but just wanted to put it out there. Thanks for help getting me started.
This will buff anyone in line of sight while your character has the preparation buff. It's probably not coded that well, but it was my first try.
To modify it for your class you would just need to go down to the section where it checks the player for Mark of the Wild or Gift of the Wild and change those to the buff you are checking for (make sure to check for group versions of the buff). And then change the cast call for mark of the wild to the buff you want to cast.
Another nice thing about this plugin, is it will move around to hit people that are out of range during the preparation period. So your bot will end up in a different starting location every time.. assuming someone stands out of range

.
I wanted to go further with this pvp plugin and assign dynamic hot spots, but I couldn't get any of my LUA code to check battle ground flag statuses working and no one wanted to help me out on the forums

, so I sort of lost motivation on this project.
Here it is, do with it what you like:
Code:
namespace Styx.Bot.CustomClasses
{
using Styx.Logic;
using System;
using Styx.Helpers;
using Styx.Logic.Pathing;
using Styx.Logic.Combat;
using System.Threading;
using System.Diagnostics;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Magic;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Xml.Linq;
using System.Net;
using System.Windows.Forms;
using System.Drawing;
using Styx.Plugins.PluginClass;
using Styx;
public class BuffU : HBPlugin
{
private void slog(string format, params object[] args)
{ Logging.Write("[Buff U]:" + format, args); }
private readonly LocalPlayer Me = ObjectManager.Me;
public override void Pulse()
{
if(Me.Buffs.ContainsKey("Preparation"))
DoBuff();
}
public void DoBuff()
{
List<WoWPlayer> PlrList = ObjectManager.GetObjectsOfType<WoWPlayer>(false).FindAll(
unit => (unit.InLineOfSight && unit.Distance<60));
foreach(WoWPlayer p in PlrList )
{
if(!Me.Buffs.ContainsKey("Preparation"))
return;
if(!(p.Buffs.ContainsKey("Mark of the Wild") || p.Buffs.ContainsKey("Gift of the Wild")))
{
slog("I found " + p.Name + " missing MotW.");
if(p.Distance>30 && p.InLineOfSight)
{
slog(p.Name + " too far away, moving closer to cast.");
while(p.Distance>30 && p.InLineOfSight)
{
WoWPoint targetLocation = WoWMovement.CalculatePointFrom(p.Location, 0f);
WoWMovement.ClickToMove(targetLocation);
}
WoWMovement.MoveStop();
}
p.Target();
Thread.Sleep(10);
SpellManager.CastSpell("Mark of the Wild");
Thread.Sleep(10);
while(SpellManager.KnownSpells["Mark of the Wild"].Cooldown)
Thread.Sleep(10);
}
}
}
public override string Name { get { return "Buff U"; } }
public override string Author { get { return "jrox"; } }
public override Version Version { get { return new Version(1, 0); } }
public override bool WantButton { get { return true; } }
public override string ButtonText { get { return "Buff U"; } }
public override void OnButtonPress()
{
//FromXYutil form = new FromXYutil();
//form.ShowDialog();
}
}
}