Actually, putting it in the Start() method did not work, so I created a new boolean, and within the pulse() method I have it switch off click-to-move if it's enabled.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.POI;
using Styx.CommonBot.Profiles;
using Styx.CommonBot.Routines;
using Styx.Helpers;
using Styx.Pathing;
using Styx.WoWInternals.WoWObjects;
using Styx.TreeSharp;
using Action = Styx.TreeSharp.Action;
using Sequence = Styx.TreeSharp.Sequence;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
namespace HSphereBuddy
{
class HSphereBuddy : BotBase
{
static int healOrbType = 0;
static bool clickToMove = true;
WoWPoint target;
public override string Name
{
get { return "HSphereBuddy"; }
}
public override PulseFlags PulseFlags
{
get { return PulseFlags.All; }
}
public override void Pulse()
{
if (clickToMove)
{
Lua.DoString("SetCVar('autoInteract', '0')");
clickToMove = false;
}
if (Me.CurrentTarget == null)
{
Lua.DoString("healOrbNum = 0;");
healOrbType = 0;
return;
}
if (healOrbType == 1)
{
target = Me.CurrentTarget.WorldLocation;
SpellManager.Cast("Healing Sphere");
SpellManager.ClickRemoteLocation(target);
Lua.DoString("healOrbNum = 0;");
healOrbType = 0;
}
}
private Composite _root;
public override Composite Root
{
get
{
return _root ?? (_root =
new PrioritySelector(
logic()
)
);
}
}
public override void Start()
{
ProfileManager.LoadEmpty();
}
private static LocalPlayer Me { get { return StyxWoW.Me; } }
private static Composite logic()
{
return new Action(delegate { healOrbType = Lua.GetReturnVal<int>("return healOrbNum", 0); });
}
}
}