What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Plugin][Example] Simple farm mobs

How to set up the priority murder mob, named mob or ID?
How the code will look?
(Как выставить приоритет атаки моба по ID или по имени моба, как хотя бы примерно будет выглядеть код)
 
How to set up the priority murder mob, named mob or ID?
How the code will look?
(Как выставить приоритет атаки моба по ID или по имени моба, как хотя бы примерно будет выглядеть код)

If I understand ure question right: (with this if statement you will only attac one specific mob)

Code:
if(bestMob.name=="Put Name of Creature you want to attac here")
{
  attachfunction;
}
 
Try
Code:
if (mpp() < 50) 
{
	UseSkill("Play Dead");  
	//skill used, we on the ground
  while ((mpp() < 99) && mobsCountThatAttackUs() == 0 && GetGroupStatus("autoexp") && isAlive())   
	  Thread.Sleep(100); //just waiting, while condition true. mpp() 99 - becouse ArcheBuddy can calculate hp\mp inaccuracy
}

How do I plug it into my script?
 
PickupAllDrop(bestMob);

The script I am using changes the mob target before picking up the loot. Is there an alternate way to just loot anything I am standing near?
 
any1 got problem from liek 7-8h taht he just get soem delays beetwen changing targets(3-5sec) or even with using skills ?

coze my character just start die liek mad..... and i'm on same spot from 1month+ and it was never dieing here at all !! :/
 
//Try to pickup drop from mob, if drop available
while (bestMob != null && !isAlive(bestMob) && isExists(bestMob) && bestMob.type == BotTypes.Npc && ((Npc)bestMob).dropAvailable && GetGroupStatus("autoexp") && isAlive())
{
if (me.dist(bestMob) > 3)
ComeTo(bestMob, 1);
PickupAllDrop(bestMob);
}

Чтобы собирал все кроме определенных вещей- что надо добавить / исправить?

That collected all but certain item that it is necessary to add / correct?
 
could anyone change it so it can be used in a party because it keeps pulling other mobs and not attack the same mob as everyone else
 
Code:
if (buffTime("Гимн Мудрости") < 0 && skillCooldown("Гимн Мудрости") == 0)
                UseSkillAndWait("Гимн Мудрости", true);

Что-то тут не так, после каждого убитого моба бот бафает снова Гимн
 
I wrote a routine for Primeval, it'll use the common CD abilities then close the gab till the CDs are reset with endless arrows.
It will also use overwhelm + backflip when an enemy gets < 8m.
I still have some problems with it, for example I can't get the bot to walk backwards until 25m (only out of combat) after the mob was targeted and turned to.
Sometimes it doesn't even do anything.

If you like to give advice or have some general input, I'll appreciate it.


Code:
using System;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;

namespace YourNamespace
{
    public class YourClass : Core
    {
        public static string GetPluginAuthor()
        {
            return "ArcheBuddy";
        }

        public static string GetPluginVersion()
        {
            return "1.0";
        }

        public static string GetPluginDescription()
        {
            return "Simple mobs farm, Modified for Primeval class";
        }
        
        //Try to find best mob in farm zone.
        public Creature GetBestNearestMob(Zone zone)
        {
            Creature mob = null;
            double dist = 999999;
            foreach (var obj in getCreatures())
            {      
                //If creature Npc and we can attack him and creature alive and distance to this creature less than other and creature have 100% hp or creature want to kill out character.
                if (obj.type == BotTypes.Npc && isAttackable(obj) && (obj.firstHitter == null || obj.firstHitter == me) && isAlive(obj) && me.dist(obj) < dist && zone.ObjInZone(obj)
                    && (hpp(obj) == 100 || obj.aggroTarget == me))
                {
                    mob = obj;
                    dist = me.dist(obj);
                }
            }
            return mob;
        }
        
        //Cancel skill if mob which we want to kill already attacked by another player.
        public void CancelAttacksOnAnothersMobs()
        {
            while (true)
            {
                if (me.isCasting && me.target != null && me.target.firstHitter != null && me.target.firstHitter != me)
                    CancelSkill();
                Thread.Sleep(100);
            }
        }  
        
        //Check our buffs
        public void CheckBuffs()
        {  
            if (buffTime("Double Recurve (Rank 4)") == 0 && skillCooldown("Double Recurve") == 0)
                UseSkillAndWait("Double Recurve", true);
        }
        
        public void CheckMana()
        {  
            if ((mpp() < 70) && skillCooldown("Meditate") == 0)
                UseSkillAndWait("Meditate", true);
        }
        
        public void UseSkillAndWait(string skillName, bool selfTarget = false)
        {
            //wait cooldowns 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 cooldown again, after we start cast skill
            while (me.isCasting || me.isGlobalCooldown)
                Thread.Sleep(50);
        }

//        public void MoveAway()
//        {
//            if (dist(me.target) < 20)
//            {
//                MoveBackward();
//            }
//        }
        

        public void PluginRun()
        {   
            new Task(() => { CancelAttacksOnAnothersMobs(); }).Start(); //Starting new thread
            RoundZone zone = new RoundZone(me.X, me.Y, 100); //Make new zone where we will farm. Its circle with center where your character stand at this moment with 100m radius.
            SetGroupStatus("autoexp", false); //Add checkbox to our character widget
            while (true)
            {   
                //If autoexp checkbox enabled in widget and our character alive
                if (GetGroupStatus("autoexp") && me.isAlive())
                {
                    CheckMana();
                    CheckBuffs();
                    Creature bestMob = null;
                    //if we have enouth mp and hp, or mobs want to kill us - try to find bestMob.
                    if ((mpp() > 40 && hpp() > 60) || getAggroMobs().Count > 0)
                        bestMob = GetBestNearestMob(zone);    
                    //if mob exists
                    if (bestMob != null) 
                    {
                        try
                        {
                            //while this mob alive and our character alive and checkbox in widget enabled
                            while (bestMob != null && isAlive(bestMob) && isExists(bestMob) && GetGroupStatus("autoexp") && isAlive())
                            {      
                                //if another player attack this mob before our character.
                                if (bestMob.aggroTarget != me && bestMob.firstHitter != null && bestMob.firstHitter != me)
                                {
                                    bestMob = null;
                                    break;
                                }    
                                
                                //if we still dont attack our best mob, but another mob want to kill us
                                if (bestMob.firstHitter == null && getAggroMobs().Count > 0 && bestMob != GetBestNearestMob(zone)) 
                                    bestMob = GetBestNearestMob(zone);
                                
                                //Target our mob, if necessary
                                if (me.target != bestMob)
                                    SetTarget(bestMob);  
                                //Turn to our mob, if necessary
                                if (angle(bestMob, me) > 45 && angle(bestMob, me) < 315)
                                        TurnDirectly(bestMob);
                               
                                
                                if (buffTime("Intensity (Rank 1)") == 0 && skillCooldown("Intensity") == 0)
                                    UseSkillAndWait("Intensity", true);
                                
                                if (me.dist(bestMob) < 8 && isAlive(bestMob))
                                    UseSkillAndWait("Overwhelm", true);
                                    UseSkillAndWait("Drop Back", true);
                                
                                if (skillCooldown("Toxic Shot") > 0 && skillCooldown("Stalker's Mark") > 0 && skillCooldown("Charged Bolt") > 0 && skillCooldown("Piecring Shot") > 0)
                                {   
                                    UseSkillAndWait("Endless Arrows", true);
                                }
                                else
                                {
                                    if (skillCooldown("Toxic Shot") == 0)
                                    {
                                        UseSkillAndWait("Toxic Shot", true);
                                    }
                                    if (skillCooldown("Stalker's Mark") == 0)
                                    {
                                        UseSkillAndWait("Stalker's Mark", true);
                                    }
                                    if (skillCooldown("Charged Bolt") == 0)
                                    {
                                        UseSkillAndWait("Charged Bolt", true);
                                    }
                                    if (skillCooldown("Piercing Shot") == 0)
                                    {
                                        UseSkillAndWait("Piercing Shot", true);
                                    }
                                }
                                   
                                //Small delay, do not load the processor
                                Thread.Sleep(10); 
                            }
                        
                            //Try to pickup drop from mob, if drop available
                            while (bestMob != null && !isAlive(bestMob) && isExists(bestMob) && bestMob.type == BotTypes.Npc && ((Npc)bestMob).dropAvailable && GetGroupStatus("autoexp") && isAlive())
                            {
                                if (me.dist(bestMob) > 3)
                                   ComeTo(bestMob, 1);
                                PickupAllDrop(bestMob);     
                            }
                        } 
                        catch {}
                        
                    }
                }
                //Small delay, do not load the processor
                Thread.Sleep(10);
            }
        }
    }
}
 
Back
Top