• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • [Help] Attack on aggro plugin

    Discussion in 'Archives' started by Ottomans, Oct 18, 2015.

    1. Ottomans

      Ottomans New Member

      Joined:
      Aug 30, 2015
      Messages:
      27
      Likes Received:
      0
      Trophy Points:
      0
      Hey all

      A friend of mine have helped me and i tough it was working well but now it isn't and i don't understand why, so can anyone help me please?

      What i want is just use this plugin as attack only when aggro and use Wallop And Overwhelm skills
      I want this plugin be activated even in 1 level

      c:\Users\F\Desktop\U\Plugins\C\K.cs(28,32) : error CS1002: ; expected
      c:\Users\Fl\Desktop\U\Plugins\C\K.cs(12,18) : error CS0101: The namespace 'EzMiner' already contains a definition for 'EzMiner'

      I haven't change the official author of the code
      Thanks to the owner

      Code:
      using System;
      using System.Drawing;
      using System.Threading;
      using System.Collections.Generic;
      using System.Linq;
      using ArcheBuddy.Bot.Classes;
      using System.Threading.Tasks;
      using System.Windows.Forms;
      
      namespace EzMiner
      {
      public class EzMiner : Core
      {
      public static string GetPluginAuthor()
      {
      return "http://GameStrats.com";
      }
      
      public static string GetPluginVersion()
      {
      return "1.0.1.0";
      }
      
      public static string GetPluginDescription()
      {
      return "EzMiner - http://GameStrats.com";
      }
      public void ClearMobs()
      {
      RoundZone zone = new RoundZone(me.X, me.Y, 50);
      foreach (Creature mob in getAggroMobs())
      {
      if (mob.type == BotTypes.Npc && isAttackable(mob) && isAlive(mob) && me.dist(mob) < 15 && zone.ObjInZone(mob))
      {
      try
      {
      SetTarget(mob);
      while (isAlive(mob))
      {
      if (SkillReady("Overwhelm"))
      {
      UseSkillAndWait("Overwhelm");
      }
      else if (SkillReady("Wallop"))
      {
      UseSkillAndWait("Wallop");
      }
      }
      }
      catch
      {
      
      }
      
      }
      }
      }
      private void gpsPreMove(GpsPoint point)
      {
      List<Creature> aggroMobs = getAggroMobs();
      if (aggroMobs.Count > 0)
      ClearMobs();
      }
      
      
      public bool SkillReady(string skillName)
      {
      return isSkillLearned(skillName) && (skillCooldown(skillName) == 0);
      }
      
      public void UseSkillAndWait(string skillName, bool selfTarget = false, bool autoRun = true)
      {
      //wait for cooldowns to finish first, before we try to cast skill
      while (me.isCasting || me.isGlobalCooldown)
      Thread.Sleep(50);
      bool success = false;
      if (selfTarget)
      success = UseSkill(skillName, autoRun, selfTarget);
      else if (me.target != null)
      success = UseSkill(skillName, me.target.X, me.target.Y, me.target.Z + 2, autoRun);
      
      if (!success)
      {
      
      if (me.target != null && GetLastError() == LastError.NoLineOfSight)
      {
      //No line of sight, try come to target.
      if (dist(me.target) <= 5)
      ComeTo(me.target, 2, 3);
      else if (dist(me.target) <= 10)
      ComeTo(me.target, 3, 5);
      else if (dist(me.target) < 20)
      ComeTo(me.target, 8, 10);
      else
      ComeTo(me.target, 8, 12);
      }
      }
      //wait for cooldown again, after we start cast skill
      while (me.isCasting || me.isGlobalCooldown)
      Thread.Sleep(50);
      }
      public void PluginRun()
      {
      ClearMobs();
      }
      }
      }
      

      Also this version works with labor check but it can't start by auto run, you have to run this after you see your character in the game

      Code:
      
      using System;
      using System.Drawing;
      using System.Threading;
      using System.Collections.Generic;
      using System.Linq;
      using ArcheBuddy.Bot.Classes;
      using System.Threading.Tasks;
      using System.Windows.Forms;
      
      namespace EzMiner
      {
          public class EzMiner : Core
          {
              public static string GetPluginAuthor()
              {
                  return "http://GameStrats.com";
              }
       
              public static string GetPluginVersion()
              {
                  return "1.0.1.0";
              }
       
              public static string GetPluginDescription()
              {
                  return "EzMiner - http://GameStrats.com";
              }
              public void PluginRun()
              {
      
                  while (me.laborPoints > 0)
                  {
                      ClearMobs();
      
                  }
              }
      
              private void gpsPreMove(GpsPoint point)
              {
                  List<Creature> aggroMobs = getAggroMobs();
                  if (aggroMobs.Count > 0)
                      ClearMobs();
              }
              public void ClearMobs()
              {
                  RoundZone zone = new RoundZone(me.X, me.Y, 50);
                  foreach (Creature mob in getAggroMobs())
                  {
                      if (mob.type == BotTypes.Npc && isAttackable(mob) && isAlive(mob) && me.dist(mob) < 15 && zone.ObjInZone(mob))
                      {
                          try
                          {
                              SetTarget(mob);
                              while (isAlive(mob))
                              {
                                  if (SkillReady("Overwhelm"))
                                  {
                                      UseSkillAndWait("Overwhelm");
                                  }
                                  else if (SkillReady("Wallop"))
                                  {
                                      UseSkillAndWait("Wallop");
                                  }
                              }
                          }
                          catch
                          {
      
                          }
      
                      }
                  }
              }
      
              public bool SkillReady(string skillName)
              {
                  return isSkillLearned(skillName) && (skillCooldown(skillName) == 0);
              }
      
              public void UseSkillAndWait(string skillName, bool selfTarget = false, bool autoRun = true)
              {
                  //wait for cooldowns to finish first, before we try to cast skill
                  while (me.isCasting || me.isGlobalCooldown)
                      Thread.Sleep(50);
                  bool success = false;
                  if (selfTarget)
                      success = UseSkill(skillName, autoRun, selfTarget);
                  else if (me.target != null)
                      success = UseSkill(skillName, me.target.X, me.target.Y, me.target.Z + 2, autoRun);
      
                  if (!success)
                  {
      
                      if (me.target != null && GetLastError() == LastError.NoLineOfSight)
                      {
                          //No line of sight, try come to target.
                          if (dist(me.target) <= 5)
                              ComeTo(me.target, 2, 3);
                          else if (dist(me.target) <= 10)
                              ComeTo(me.target, 3, 5);
                          else if (dist(me.target) < 20)
                              ComeTo(me.target, 8, 10);
                          else
                              ComeTo(me.target, 8, 12);
                      }
                  }
                  //wait for cooldown again, after we start cast skill
                  while (me.isCasting || me.isGlobalCooldown)
                      Thread.Sleep(50);
              }
      
          }
      }
      
       
    2. fredgsanford

      fredgsanford Member

      Joined:
      Jan 2, 2015
      Messages:
      552
      Likes Received:
      0
      Trophy Points:
      16
      not sure but maybe you can try this

      Code:
      public void PluginRun()
              {
      			while (gameState != GameState.Ingame)
      				{
      				Thread.Sleep(2000)
      				}
      			while (me.laborPoints > 0)
                  {
                      ClearMobs();
      
                  }
              }
      no idea if that will work but you can try it
       
      Last edited: Oct 19, 2015
    3. flitch

      flitch New Member

      Joined:
      Jan 7, 2012
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0
      i think it's because you already have another plugin running with the namespace Ezminer... rename it. namespace <newname> {
       
    4. fredgsanford

      fredgsanford Member

      Joined:
      Jan 2, 2015
      Messages:
      552
      Likes Received:
      0
      Trophy Points:
      16
      flitch his problem is its not checking to see if its in game before trying to run so can't really be started before entering game. and i doubt he has ezminer running same time as this although yeah you never know :)
       
    5. flitch

      flitch New Member

      Joined:
      Jan 7, 2012
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      0
      i was replying with a possible fix for his first problem and you are referencing his second problem.
       
    6. fredgsanford

      fredgsanford Member

      Joined:
      Jan 2, 2015
      Messages:
      552
      Likes Received:
      0
      Trophy Points:
      16
      ahh sorry hehe didn't see the other one there.
       

    Share This Page