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

[plugin] Mining bot

@ netorod, thanks your adjusted plugin helped me really much.

I now have 3 bots mining every minute of the day. Although...I don't think mining is that effective anymore in terms of making money. Just my opinion though =/
 
@ netorod, thanks your adjusted plugin helped me really much.

I now have 3 bots mining every minute of the day. Although...I don't think mining is that effective anymore in terms of making money. Just my opinion though =/
~

He is not mining Fortune Vein , lost a lot of raw stone =T
 
Would be nice to have an option to use mount or not, or, a check between 2 points, and if its over a set distance, then use mount.
 
im currently writing a mining plugin . it will be user friendly, it allready support fortuna veins, sprint and it will have some extra too
 
its getting them for me.


The original try to mine quest veins where i dig

So i change it , but with my change, just mine iron veins


im currently writing a mining plugin . it will be user friendly, it allready support fortuna veins, sprint and it will have some extra too

Nice to know, i really need a mining bot to use my 5k labor D:
 
miner.jpg



Almost ready for a beta :)
 
Hi, try this one. I made some improvements to Gajda's code. combined codes of other author like Karls.

Code:
using System;
using System.Drawing;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
using System.Windows.Forms;
using System.Threading.Tasks;
using System.Net;
using System.IO;
using System.Text;
using System.ComponentModel;

namespace Mining
{
    public class DefaultClass : Core
    {
        public static string GetPluginAuthor()
        {
            return "Alarm";
        }

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

        public static string GetPluginDescription()
        {
            return "Arcum Iris Mining Bot. Thanks to Gajda and Karls, I used some of their codes. As with Gajda's script, you also need to have your own path with points named as numbers.";
        }
        private const string _MOUNT_NAME = "Grey Donkey";
        private Gps gps;
        private int minecount;
        private int searchradius = 10;
        private Thread miner;
        private string mountName;
        DateTime lastQuickStep, lastRun;

        private const bool _USE_QUICK_STEP = true; // use quick step (if available) while on mount
        private const bool _USE_RUN = true; // use "Run!" skill from mount
        private const uint _QUICKSTEP = 10723;

        public void DetectMountName()
        {
            mountName = _MOUNT_NAME;
            int highestLevel = 50;

            List<uint> notMounts = new List<uint>() { 144, 139 };

            List<Item> inventory = getAllInvItems();
            foreach (Item item in inventory)
            {
                if (item.mountLevel > 0 && !notMounts.Contains(item.categoryId))
                {
                    Log("Possible mount: " + item.name
                        + "(level: " + item.mountLevel + " " + (item.mountAlive ? "DEAD" : "ALIVE") + ")"
                        + " CatID: " + item.categoryId + " ItemID: " + item.id
                    );

                    if ((item.mountLevel < highestLevel) & (!item.name.Contains("Tabby")))
                    {
                        mountName = item.name;
                        highestLevel = item.mountLevel;
                    }
                }
            }

            Log("MOUNT SELECTED: " + mountName);
        }
        public void Unmount()
        {
            if (me.sitOnMount)
            {
                DespawnMount();
                Thread.Sleep(1500);
            }
        }

        void gps_onGpsPreMove(GpsPoint point)
        {
           
            if (!me.sitOnMount & (GetGroupStatus("Mount")) & DoodsNearbyCount() < 1)
            {
                if (getMount() == null)
                    UseItem(mountName);

   
                if (getMount() != null)
                {
                    if (!getMount().isAlive())
                    {
                        Log("Trying to resurrect mount");
                        ComeTo(getMount(), 1, 1);
                        if (!RessurectMount(false))
                            Log("Failed rezzing mount: " + GetLastError());
                    }
                    Thread.Sleep(2000);
                    SitToMount();
                    //Thread.Sleep(1000);
                }
                else
                    Log("Failed to summon or use the mount");
            }
            else
            {
                // check for speed buffs
                if (_USE_RUN && (DateTime.UtcNow - lastRun).TotalSeconds > 30)
                {
                    Thread.Sleep(3000);
                    new Task(() => { UseSkill("Run!"); }).Start();
                    lastRun = DateTime.UtcNow;
                }
                else if (_USE_QUICK_STEP && (DateTime.UtcNow - lastQuickStep).TotalSeconds > 15)
                {
                    Thread.Sleep(3000);
                    new Task(() => { UseSkill(_QUICKSTEP); }).Start();
                    lastQuickStep = DateTime.UtcNow;
                }
            }
        }

        public void PluginStop()
        {
            Log(DateTime.Now.ToLongTimeString() + " : Total mine count is " + minecount);
            DelGroupStatus("Mount");
            miner.Abort();
        }

        public void PluginRun()
        {
            ClearLogs();
            DetectMountName();
            SetGroupStatus("Mount", false);
            minecount = 0;
            Log(DateTime.Now.ToLongTimeString() + " : Start");
            gps = new Gps(this);
            Log("Loading " + Application.StartupPath + "\\Plugins\\Mining\\mine.db3");
            gps.LoadDataBase(Application.StartupPath + "\\Plugins\\Mining\\mine.db3");
            gps.onGpsPreMove += gps_onGpsPreMove;

            miner = new Thread(Mine);
            miner.Start();

            DoMineRun();

        }

        public int DoodsNearbyCount()
        {
            int count = 0;
            foreach (var dood in getDoodads())
            {
                if (me.dist(dood) < searchradius * 2 & !dood.name.Contains("Remnant") & !dood.name.Contains("Unknown") && dood.name.Contains("ein"))
                {
                    count++;
                }
            }
            return count;
        }

        public DoodadObject NearestDood()
        {
            DoodadObject d = null;
            int dd = 999;
            foreach (var dood in getDoodads())
            {
                if (me.dist(dood) < dd && !dood.name.Contains("Remnant") && !dood.name.Contains("Unknown") && dood.name.Contains("ein")  && me.dist(dood) < searchradius)
                {
                    d = dood;
                }
                
            }
            return d;
        }

        public void DoMineRun()
        {
            Log(DateTime.Now.ToLongTimeString() + " : Total mine count is " + minecount);

            for (int i = 1; i < 8; i++)
            {
                
                Log(DateTime.Now.ToLongTimeString() + " : movint to point " + i.ToString());
                if (skillCooldown("Freerunner") > 0)
                    UseSkill("Dash");
                else
                    UseSkill("Freerunner");
                
                while (!gps.GpsMove(i.ToString()))
                {
                    
                        Thread.Sleep(50);
                }
                //UseSkill("/salute");
                Log(DateTime.Now.ToLongTimeString() + " : at point " + i.ToString() + "; Mine count = " + minecount);
             

            }

            DoMineRun();
        }
        public void Mine()
        {

            DoodadObject doodad = null;
            while (true)
            {
                doodad = NearestDood();

                if (doodad != null)
                {
                    gps.SuspendGpsMove();
                    if (me.sitOnMount)
                        StandFromMount();

                    //Log(DateTime.Now.ToLongTimeString() + " : " + doodad.name + " " + doodad.id.ToString() + "  " + doodad.dist(me));
                    var skills = doodad.getUseSkills();
                    double doodadCastDist = 0;
                    if (skills.Count > 0)
                    {
                        TurnDirectly(doodad);
                        if (UseDoodadSkill(skills[0].id, doodad, true))
                        {
                            minecount++;
                            Thread.Sleep(500);
                            //items = Sort(getDoodads());
                        }
                        
                        while (isCasting())
                            Thread.Sleep(50);
                        
                    }
                }
                Thread.Sleep(500);
                if (gps.gpsMoveSuspended)
                    gps.ResumeGpsMove();
                Thread.Sleep(100);
            }
        }
    
        

      
        public void CheckAggro()
        {
            //Log(DateTime.Now.ToLongTimeString() + " : CheckAggro");
            if (getAggroMobs().Count > 0)
            {
                Log(DateTime.Now.ToLongTimeString() + " : " + getAggroMobs().Count.ToString());
                foreach (var obj in getAggroMobs())
                {
                    Log(DateTime.Now.ToLongTimeString() + " : " + obj.name);
                    SetTarget(obj);
                    TurnDirectly(me.target);
                    Log(DateTime.Now.ToLongTimeString() + " : fighting");
                    while (obj.isAlive())
                    {
                        TurnDirectly(me.target);
                        if (skillCooldown("Freezing Arrow") == 0)
                        {
                            Log(DateTime.Now.ToLongTimeString() + " Endless Arrows");
                            UseSkill("Endless Arrows", false);
                            Thread.Sleep(100);
                        }
                        else
                        {
                            if (skillCooldown("Crippling Mire") == 0)
                            {
                                Log(DateTime.Now.ToLongTimeString() + " Crippling Mire");
                                UseSkill("Crippling Mire", false);
                                Thread.Sleep(100);
                            }
                            else
                            {
                                if (skillCooldown("Flamebolt") == 0)
                                {
                                    Log(DateTime.Now.ToLongTimeString() + " Flame Bolt");
                                    UseSkill("Flamebolt", false);
                                    Thread.Sleep(100);
                                }
                            }
                        }
                        if (!obj.inFight)
                            return;
                    }
                    Log(DateTime.Now.ToLongTimeString() + " : fight is over");
                }
            }
        }

       
    }
}
 
MOUNT SELECTED: Grey Donkey
13:38:27 : Start
Loading D:\buddy\Plugins\Mining\mine.db3
Success load 10 points and 9 links + and 1 polygons.
13:38:28 : Total mine count is 0
13:38:28 : movint to point 1

and nothing happens, why?
How to specify the name of the point?
 
just curious and i see it in almost every script isn't there a way to add variables at the start of the script instead of making people look through them to find the spots that need editing? ie
for(int i=1;i<11;i++)
since the 11 is the number that has to be changed can't you change that in the script to be
for(int i=1;i<NumberofVeins;i++)
or however its done in this language and then near top of script set that variable? Don't know how to myself in this scripting but most it can be done to make things easier?
Just curious mostly on this as need to learn it i guess some at least.
 
Back
Top