Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 "nick1988";
- }
- public static string GetPluginVersion()
- {
- return "0.1.0";
- }
- public static string GetPluginDescription()
- {
- return "LazyRaider for Daggerspell";
- }
- 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);
- }
- if (skillCooldown("Insulating Lens") == 0)
- // Casting "insulating lens", if its not on cooldown
- {
- UseSkillAndWait("Insulating Lens", true);
- Log("Used: Insulating Lens - Now immunte to damage for a while");
- Thread.Sleep(100);
- }
- if (skillCooldown("Magic Circle") == 0 && dist(me.target) <= 20 && hpp(me.target) >= 20)
- //casting "magic circle", if its not on cooldown and if we are within 20m of the target.
- //this way we make sure, that we are in range of the target and won't leave the magic circle and loose the buff.
- {
- UseSkillAndWait("Magic Circle");
- Log("Used: Magic Circle - Damage boost activated");
- Thread.Sleep(100);
- }
- if (hpp(me) <= 25 && skillCooldown("Banshee Wail") == 0)
- {
- UseSkillAndWait("Banshee Wail");
- Thread.Sleep(100);
- Log("Used: Banshee Wail - Defense CC");
- if (hpp(me.target) <= 20 && skillCooldown("Envervate") == 0)
- {
- UseSkillAndWait("Enervate");
- Thread.Sleep(50);
- if (skillCooldown("Earthen Grip") == 0)
- {
- UseSkillAndWait("Earthen Grip");
- }
- }
- else
- {
- Thread.Sleep(1900);
- }
- }
- if (skillCooldown("Freezing Arrow") != 0 && hpp(me) <= 75 && skillCooldown("Enervate") == 0 && skillCooldown("Magic Circle") >= 1)
- // if "freezing arrow" is on CD and our hp is below 75% we look for the cd of "enervate" if its available we will cast it.
- // since eneverate will give us an "+xxx life" on a hit of "Earthen Grip" we will us it as well, to regain some life.
- {
- UseSkillAndWait("Enervate");
- Thread.Sleep(100);
- UseSkillAndWait("Earthen Grip");
- Thread.Sleep(100);
- Log("Used: Enervate + Earthen Grip (Combo) - SelfHeal activated");
- }
- if (skillCooldown("Freezing Arrow") == 0 && skillCooldown("Magic Circle") >= 1)
- // casting "freezing arrow" if not on cd
- {
- UseSkillAndWait("Freezing Arrow");
- Log("Used: Freezing Arrow");
- Thread.Sleep(100);
- }
- if (skillCooldown("Freezing Arrow") != 0 && mpp(me) <= 25 && skillCooldown("Enervate") == 0 && skillCooldown("Magic Circle") >= 1)
- // if our "freezing arrow" is on cooldown, and our mp is below or at 25%, we will also look for enervate cd.
- // if the cd is 0, we will cast enervate. This will cause our flamebolts to regenerate mana, when hitting the affected target
- {
- UseSkillAndWait("Enervate");
- Log("Used: Enervate - Mana regeneration for Flamebold activated");
- Thread.Sleep(100);
- }
- if (skillCooldown("Freezing Arrow") != 0 && hpp(me) > 60 && skillCooldown("Magic Circle") >= 1)
- // if "freezing arrow" is on CD and our HP is above 60%, we use flamebolt
- {
- for (int i = 0; i < 2; i++)
- UseSkillAndWait("Flamebolt");
- Log("Used: Flamebolt - PewPewPew");
- }
- while (me.target != null && !isAlive(me.target) && me.target.dropAvailable && isAlive())
- // we check if we have a target, then check if this target is NOT alive. Then we look if its lootable and finaly whether we are alive or not.
- // if all this is true, we will move towards the target and get our loot.
- {
- if (me.dist(me.target) > 3)
- ComeTo(me.target, 1);
- PickupAllDrop(me.target);
- }
- // once we looted the target, and made sure its dead we will clear our target.
- if (me.target != null && !isAlive(me.target) && !me.target.dropAvailable)
- {
- CancelTarget();
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment