[B]// Auto-cast any vaal skill at the best target as soon as it's usable.[/B]
if (ExampleRoutineForkSettings.Instance.AutoCastVaalSkills && _vaalStopwatch.ElapsedMilliseconds > 1000)
{
foreach (var skill in LokiPoe.InGameState.SkillBarPanel.Skills)
{
if (skill.SkillTags.Contains("vaal"))
{
if (skill.CanUse())
{
if (skill.Name.Contains("Summon Skeletons"))
{
if (cachedRarity == Rarity.Unique)
{
await MiscTasks.DisableAlwaysHiglight();
var err1 = LokiPoe.InGameState.SkillBarPanel.UseAt(skill.Slot, false, cachedPosition);
if (err1 == LokiPoe.InGameState.UseError.None)
{
await Coroutine.Sleep(Utility.LatencySafeValue(250));
await Coroutines.FinishCurrentAction(false);
await Coroutine.Sleep(Utility.LatencySafeValue(250));
return true;
}
Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
}
else
continue;
}
else
{
await MiscTasks.DisableAlwaysHiglight();
var err1 = LokiPoe.InGameState.SkillBarPanel.UseAt(skill.Slot, false, cachedPosition);
if (err1 == LokiPoe.InGameState.UseError.None)
{
await Coroutine.Sleep(Utility.LatencySafeValue(250));
await Coroutines.FinishCurrentAction(false);
await Coroutine.Sleep(Utility.LatencySafeValue(1000));
return true;
}
Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
}
}
}
}
_vaalStopwatch.Restart();
}