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

[Plugin][Example] Simple farm mobs

Everyone that is not able to start their script. Read the line where it says this;
PHP:
SetGroupStatus("autoexp", false); //Add checkbox to our character widget
This means that you need to tick it in the CHARACTER WIDGET. It is a gray popup when you first join the game with the bot attached. You will have a new option enabled there if you have started the Farming routine plugin, where you can enable/disable the script.
 
Last edited:
Epic thank you for this [Out] most appreciated!

Could Insulating Lens be added to this to cast initially would be a great to have a shield up while this goes to town on mobs.
 
Last edited:
Epic thank you for this [Out] most appreciated!

Could Insulating Lens be added to this to cast initially would be a great to have a shield up while this goes to town on mobs.
It has been said many times. Add the following code to your CheckBuffs() function.

PHP:
//Use Insulating Lens
            if (buffTime("Insulating Lens (Rank 3)") == 0)
            {
                UseSkillAndWait("Insulating Lens");
            }
 
oh guys is there a way to modify the loot system so that it can move on and attack mobs if it can't get the loot (while people in your party roll) cause mine usually just stand there waiting for it to be done before moving on to the next target.
 
I made some changes and for the life of me cant figure out why it won't work. It won't even set the auto exp box to blank. It does nothing.

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";
        }
        
        //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("Insulating Lens (Rank 5)") == 0 && skillCooldown("Insulating Lens") == 0)
            UseSkillAndWait("Insulating Lens", true);
            //if (mpp() < 50)
            //    UseItem("Morning Dew");
            //if (mpp() < 40 && skillCooldown("Whole Grain Soup") == 0)
            //    UseItem("Whole Grain Soup");
        }
        
        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 PluginRun()
        {   
            new Task(() => { CancelAttacksOnAnothersMobs(); }).Start(); //Starting new thread
            RoundZone zone = new RoundZone(me.X, me.Y, 60); //Make new zone where we will farm. Its circle with center where your character stand at this moment with 80m radius.
            SetGroupStatus("autoexp", false); //Add checkbox to our character widget
            //If autoexp checkbox enabled in widget and our character alive
                if (me.isAlive())
                {
                    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() > 75) || 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 (skillCooldown("Magic Circle") == 0 && dist(bestMob) <= 20 && hpp(bestMob) > 40)
                                {
                                        UseSkill("Magic Circle", true);  
                                        Thread.Sleep(100);
                                 }
                                    if (mpp() <= 60 && skillCooldown("Enervate") == 0 &&hpp(bestMob) >40)
                                {
                                        UseSkill("Enervate", true);
                                        Thread.Sleep(100);
                                 }                                
                                if (skillCooldown("Freezing Arrow") == 0)
                                {
                                    UseSkill("Freezing Arrow", true);  
                                    Thread.Sleep(100);
                                 } 
                                if (skillCooldown("Freezing Arrow") != 0 && hpp() > 75)
                                {
                                    for (int i=0;i<2;i++)
                                    UseSkillAndWait("Flamebolt");
                                } 
                                if (skillCooldown("Freezing Arrow") != 0 && hpp() <= 75 && skillCooldown("Enervate") == 0)
                                {
                                    UseSkill("Enervate", true);
                                    Thread.Sleep(100);
                                    UseSkill("Earthen Grip", true);
                                   Thread.Sleep(100);
                                } 
                                if (skillCooldown("Freezing Arrow") != 0 && mpp() <= 55 && skillCooldown("Enervate") == 0)
                                {
                                        UseSkill("Enervate", true);
                                       Thread.Sleep(100);
                                 }
                               
                                   
                                //Small delay, do not load the processor
                                Thread.Sleep(100); 
                            }
                        
                            //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);
            }
        }
    }
}
 
How to make the character when moving to the point used songs "Quickstep","Ode to Recovery" and skills mount?
(Как заставить персонажа при движении к точке использовать песни "Походный марш","Песнь исцеления" и скилы маунта?)
Move to a point like that:
(Двигаюсь к точке так)
Code:
                            Gps gps = new Gps(this);
                            gps.LoadDataBase("******");
                            MoveTo(me.X+3,me.Y,me.Z);
                            UseItem("******", true);
                            Thread.Sleep(1000);
                            SitToMount();
                            gps.GpsMove("*****"); 
                            DespawnMount();
 
How to make the character when moving to the point used songs "Quickstep","Ode to Recovery" and skills mount?
(Как заставить персонажа при движении к точке использовать песни "Походный марш","Песнь исцеления" и скилы маунта?)
Move to a point like that:
(Двигаюсь к точке так)
Code:
                            Gps gps = new Gps(this);
                            gps.LoadDataBase("******");
                            MoveTo(me.X+3,me.Y,me.Z);
                            UseItem("******", true);
                            Thread.Sleep(1000);
                            SitToMount();
                            gps.GpsMove("*****"); 
                            DespawnMount();
нужно при старте движения запустить отдельный поток, в котором по циклу юзать UseSkill("Название скила");
и выгружать этот поток, когда приходишь в конечную точку
 
Code:
        //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("Hummingbird Ditty (Rank 1)") == 0 && skillCooldown("Hummingbird Ditty") == 0)
                UseSkillAndWait("Hummingbird Ditty", 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 PluginRun()
        {   
            new Task(() => { CancelAttacksOnAnothersMobs(); }).Start(); //Starting new thread
            RoundZone zone = new RoundZone(me.X, me.Y, 80); //Make new zone where we will farm. Its circle with center where your character stand at this moment with 80m 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())
                {
                    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() > 75) || 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 (me.dist(bestMob) < 4 && isAlive(bestMob))
                                    UseSkillAndWait("Hell Spear");
                                UseSkillAndWait("Freezing Arrow");
                                for (int i=0;i<2;i++)
                                    UseSkillAndWait("Flamebolt");
                                   
                                //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);
            }
        }
    }
}

I have a grind party , how can i change these code to all my party members hit same target ?
 
Now every time I try to run this. The green arrow immediately comes back. No error messages. This is extremely frustrating and will be refunding if issue is not resolved
 
Sometimes the bot gets stuck on a dead mob and it waits until it despawns before it targets another. How do I fix?
 
WiderG99.cs(12,18) : error CS0101: The namespace 'YourNamespace' already contains a definition for 'YourClass'

Any ideas gents? :)

Thanks
 
to run back after dead i follow
Code:
if(!isAlive())
{       
    Log(DateTime.Now + " I`m die");
    while(me.resurrectionWaitingTime>0)
        Thread.Sleep(100);
    Thread.Sleep(3000);
    ResToRespoint();
    Thread.Sleep(10000);
    RestoreExp();
    Thread.Sleep(2000);;
    MoveTo();
    MoveTo();
    MoveTo();
    MoveTo();
    MoveTo();
    Thread.Sleep(1000);
}

where to copy and paste this? in which section? i never get it to work... please help
 
If I wanted to add like
if(mpp() < 50)
UseSkill("Play Instrument");

but have it do this after looting mob or after killing it.
Where would i put that in I have been having trouble because i tried a few places and then all it would do is play for instrument for a second then stop wouldnt let it channel.
 
Last edited:
1. How do I make my bot run back to grind pos after death?

2. Does anyone know why after my bot kills a mob it stops for like 5-10s before targetting another one? I checked the radius already and there is surely a mob inside of that radius.
 
If I wanted to add like
if(mpp() < 50)
UseSkill("Play Instrument");

but have it do this after looting mob or after killing it.
Where would i put that in I have been having trouble because i tried a few places and then all it would do is play for instrument for a second then stop wouldnt let it channel.

You will need to add a sleep after the skill use.
UseSkill("Play Instrument");
Thread.Sleep(5000);

That will sleep for 5 seconds. Not sure how long the Instrument plays for you but you can figure it out.
 
Does anyone have any good places to farm without much terrain to get stuck on?
Or
Does anyone have code that might help with getting unstuck. I keep having issues where the mobs that are being targeted get immune do to where my character is standing and then I die.
 
Back
Top