using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace LazyRaider
{
public class LazyRaider : Core
{
public static string GetPluginAuthor()
{
return "Selmia123";
}
public static string GetPluginVersion()
{
return "0.1.0";
}
public static string GetPluginDescription()
{
return "Autoface for pvP";
}
public void UseSkillAndWait(string skillName, bool selfTarget = false)
{
//wait for cooldowns to finish first, before we try to cast skill
while (me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
if (!UseSkill(skillName, true, selfTarget))
{
if (me.target != null && GetLastError() == LastError.NoLineOfSight)
{
//No line of sight, try come to target.
if (dist(me.target) <= 5)
ComeTo(me.target, 2);
else if (dist(me.target) <= 10)
ComeTo(me.target, 3);
else if (dist(me.target) < 20)
ComeTo(me.target, 8);
else
ComeTo(me.target, 8);
}
}
//wait for cooldown again, after we start cast skill
while (me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
}
public void PluginRun()
{
while (true)
{
while (me.target == null)
// while we have no target, this loop will make the bot do nothing, and he will check back every 50ms, to see if we have a target
{
Thread.Sleep(50);
}
while (me.target != null && isAttackable(me.target))
// once we have a target, and this target is attackable (so its no NPC) the bot will jump into this loop.
// this loops contains the "combat routine"
{
if (angle(me.target, me) > 45 && angle(me.target, me) < 315)
// making sure we are faceing the target. If not, we will turn towards it
{
TurnDirectly(me.target);
}
if (dist(me.target) >= 21)
{
ComeTo(me.target, 19);
CancelTarget();
}
}
}
}
}
}