Advertisement
Guest User

Raton

a guest
Jul 12th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 8.20 KB | None | 0 0
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. using System.Threading;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using ArcheBuddy.Bot.Classes;
  8.  
  9. namespace Follower
  10. {
  11.     public class LazyRaider : Core
  12.     {
  13.         public static string GetPluginAuthor()
  14.         {
  15.             return "Ferum";
  16.         }
  17.  
  18.         public static string GetPluginVersion()
  19.         {
  20.             return "0.1.0";
  21.         }
  22.  
  23.         public static string GetPluginDescription()
  24.         {
  25.             return "LazyRaider for the DarkRunner Class";
  26.         }
  27.         public void UseSkillAndWait(string skillName, bool selfTarget = false)
  28.         {
  29.             //wait for cooldowns to finish first, before we try to cast skill
  30.             while (me.isCasting || me.isGlobalCooldown)
  31.                 Thread.Sleep(50);
  32.             if (!UseSkill(skillName, true, selfTarget))
  33.             {
  34.                 if (me.target != null && GetLastError() == LastError.NoLineOfSight)
  35.                 {
  36.                     //No line of sight, try come to target.
  37.                     if (dist(me.target) <= 5)
  38.                         ComeTo(me.target, 2);
  39.                     else if (dist(me.target) <= 10)
  40.                         ComeTo(me.target, 3);
  41.                     else if (dist(me.target) < 20)
  42.                         ComeTo(me.target, 8);
  43.                     else
  44.                         ComeTo(me.target, 8);
  45.                 }
  46.             }
  47.             //wait for cooldown again, after we start cast skill
  48.             while (me.isCasting || me.isGlobalCooldown)
  49.                 Thread.Sleep(50);
  50.         }
  51.  
  52.         public void PluginRun()
  53.         {
  54.             while (true)
  55.             {
  56.                 while (me.target == null)
  57.                 // 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
  58.                 {
  59.                     Thread.Sleep(50);
  60.                 }
  61.  
  62.                 while (me.target != null && isAttackable(me.target))
  63.                 // once we have a target, and this target is attackable (so its no NPC) the bot will jump into this loop.
  64.                 // this loops contains the "combat routine"
  65.                 {
  66.                     if (angle(me.target, me) > 45 && angle(me.target, me) < 315)
  67.                     // making sure we are faceing the target. If not, we will turn towards it
  68.                     {
  69.                         TurnDirectly(me.target);
  70.                     }
  71.  
  72.                     //  if(mpp(me) <=25)
  73.                     //   {
  74.                     // UseSkill("Play Instrument", true, true);
  75.                     //  Thread.Sleep(5000);
  76.                     //}
  77.  
  78.                 if (dist(me.target) >= 12 || skillCooldown("Отравленная стрела") != 0)
  79.                     {
  80.                         ComeTo(me.target, 12);
  81.                     }
  82.                     if (skillCooldown("Энергитичский щит") == 0)
  83.                     {
  84.                         UseSkillAndWait("Энергитичский щит");
  85.                         Log("Used: Энергитичский щит");
  86.                     }
  87.                    
  88.                     if (skillCooldown("Адреналин") == 0)
  89.                     {
  90.                         UseSkillAndWait("Адреналин");
  91.                         Log("Used: Адреналин");
  92.                     }
  93.                    
  94.                     if (skillCooldown("Отравленная стрела") == 0)
  95.                     {
  96.                         UseSkillAndWait("Отравленная стрела");
  97.                         Log("Used: Отравленная стрела");
  98.                         if (skillCooldown("Метка преследователя") == 0)
  99.                         {
  100.                             UseSkillAndWait("Метка преследователя");
  101.                             Log("Used: Метка преследователя");
  102.                             if (skillCooldown("Бросок кобры") != 0)
  103.                             {
  104.                                 UseSkillAndWait("Бросок кобры");
  105.                                 Log("Used: Бросок кобры");
  106.                             }
  107.                         }
  108.                     }
  109.                     if (skillCooldown("Рывок") == 0)
  110.                     {
  111.                         UseSkillAndWait("Рывок");
  112.                         Log("Used: Рывок");
  113.                     }
  114.                     if (skillCooldown("Метка преследователя") == 0)
  115.                     {
  116.                         UseSkillAndWait("Метка преследователя");
  117.                         Log("Used: Метка преследователя");
  118.                         if (skillCooldown("Бросок кобры") != 0)
  119.                         {
  120.                             UseSkillAndWait("Бросок кобры");
  121.                             Log("Used: Бросок кобры");
  122.                         }
  123.                     }
  124.                     if (skillCooldown("Превосходство духа") == 0)
  125.                     {
  126.                         if (dist(me.target) >= 5)
  127.                         {
  128.                             ComeTo(me.target, 5);
  129.                             UseSkillAndWait("Превосходство духа");
  130.                             Log("Used: Превосходство духа");
  131.                             if (skillCooldown("Вихрь ударов") == 0 && dist(me.target) <= 5)
  132.                             {
  133.                                 UseSkillAndWait("Вихрь ударов");
  134.                                 Log("Used: Вихрь ударов");
  135.                             }
  136.                         }
  137.                         UseSkillAndWait("Превосходство духа");
  138.                         Log("Used: Превосходство духа");
  139.                         if (skillCooldown("Вихрь ударов") == 0 && dist(me.target) <= 5)
  140.                         {
  141.                             UseSkillAndWait("Вихрь ударов");
  142.                             Log("Used: Вихрь ударов");
  143.                         }
  144.                     }
  145.                     if (skillCooldown("Мясорубка") == 0)
  146.                     {
  147.                         UseSkillAndWait("Мясорубка");
  148.                         Log("Used: Мясорубка");
  149.                     }
  150.                     if (skillCooldown("Тройной удар") == 0)
  151.                     {
  152.                         for (int i = 0; i < 2; i++)
  153.                             UseSkillAndWait("Тройной удар");
  154.                         Log("Used: Тройной удар");
  155.                     }
  156.                  
  157.                    
  158.                     if (mpp(me) <= 20 && skillCooldown("Медитация") == 0)
  159.                     {
  160.                         UseSkillAndWait("Медитация");
  161.                         Log("Used: Медитация");
  162.                         Thread.Sleep(5000);
  163.                     }
  164.                    
  165.                     while (me.target != null && !isAlive(me.target) && me.target.dropAvailable && isAlive())
  166.                     // 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.
  167.                     // if all this is true, we will move towards the target and get our loot.
  168.                     {
  169.                         if (me.dist(me.target) > 3)
  170.                             ComeTo(me.target, 1);
  171.                         PickupAllDrop(me.target);
  172.                     }
  173.  
  174.                     // once we looted the target, and made sure its dead we will clear our target.
  175.                     if (me.target != null && !isAlive(me.target) && !me.target.dropAvailable)
  176.                     {
  177.                         CancelTarget();
  178.                     }
  179.                 }
  180.             }
  181.         }
  182.     }
  183. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement