Apoc
Well-Known Member
- Joined
- Jan 16, 2010
- Messages
- 2,790
Basically; all this bot does is run your current CC's Heal->CombatBuff->Combat behavior, at 30fps, within a FrameLock.
This is meant to be used for people who use LazyRaider *only* for the "fight for me" support. It makes no claims to deal with targeting, or anything else. It simply runs your entire CC at 30fps (or as close as it can get to it).
Note: I haven't actually messed with this myself, but it should work.
The idea is, since HB by itself tends to be a bit slow due to plugins, and other overhead, it can vastly drop your DPS. Add on top of that some internal complexities, and you gradually slow down how frequently HB can "Pulse". This BotBase works around these issues, by ensuring the entire combat logic is executed within a single frame.
I take no responsibility for any CC not working, or for any bugs you may encounter. Hopefully this may spawn a new set of super-speed CCs designed to run at 30fps (and achieve the top-DPS numbers that normal players can).
I won't bother uploading the .cs file, nor explaining how to install/use it. This is simply some proof-of-concept code to show that HB can run as fast as your game (almost)
This is meant to be used for people who use LazyRaider *only* for the "fight for me" support. It makes no claims to deal with targeting, or anything else. It simply runs your entire CC at 30fps (or as close as it can get to it).
Note: I haven't actually messed with this myself, but it should work.
The idea is, since HB by itself tends to be a bit slow due to plugins, and other overhead, it can vastly drop your DPS. Add on top of that some internal complexities, and you gradually slow down how frequently HB can "Pulse". This BotBase works around these issues, by ensuring the entire combat logic is executed within a single frame.
I take no responsibility for any CC not working, or for any bugs you may encounter. Hopefully this may spawn a new set of super-speed CCs designed to run at 30fps (and achieve the top-DPS numbers that normal players can).
I won't bother uploading the .cs file, nor explaining how to install/use it. This is simply some proof-of-concept code to show that HB can run as fast as your game (almost)
Code:
using Styx;using Styx.Logic.BehaviorTree;
using Styx.Logic.Combat;
using TreeSharp;
namespace RaidBot
{
public class RaidBot : BotBase
{
private byte _oldTps;
private Composite _root;
#region Overrides of BotBase
public override string Name { get { return "Raid Bot"; } }
public override Composite Root { get { return _root; } }
public override PulseFlags PulseFlags { get { return PulseFlags.Objects | PulseFlags.Lua; } }
#endregion
public override void Start()
{
_oldTps = TreeRoot.TicksPerSecond;
TreeRoot.TicksPerSecond = 30;
_root = new Decorator(
ret => StyxWoW.Me.Combat && StyxWoW.Me.GotTarget && !StyxWoW.Me.CurrentTarget.IsFriendly,
new LockSelector(
RoutineManager.Current.HealBehavior,
RoutineManager.Current.CombatBuffBehavior,
RoutineManager.Current.CombatBehavior));
}
public override void Stop()
{
TreeRoot.TicksPerSecond = _oldTps;
}
#region Nested type: LockSelector
private class LockSelector : PrioritySelector
{
public LockSelector(params Composite[] children) : base(children)
{
}
public override RunStatus Tick(object context)
{
using (new FrameLock())
{
return base.Tick(context);
}
}
}
#endregion
}
}