Taken from: http://gamestrats.com/archeage-discussion/(archebuddy)-ezminer-looped-above-ground-miner
Description: Run's around a mine, clears out mobs, then mines the closest ore. Perfect for low level mining zones. Currently for use on a character who can easily handle the mobs in the zone, most low level mining areas are perfect for a 1-32 quest bot.
Setup: Compile to a folder named "EzMiner" inside of your plugins folder. Create a new GPS database inside of this folder named "gps.db3". To setup the points, start your character at the beginning of the mine, or where you want your loop to begin. Load up the GPS plugin. Check the Auto mode and configure the Distance/Angle, I used the values 20.0/15 respectively. Set the mode to Patch. Now run a full loop around where you are mining, this will create a waypoint system so your bot does not run into walls.
Donate: If you find this script useful or want to see updates to it, please find it in your heart to donate me a few dollars! A coffee goes a long way in the coding world!
Description: Run's around a mine, clears out mobs, then mines the closest ore. Perfect for low level mining zones. Currently for use on a character who can easily handle the mobs in the zone, most low level mining areas are perfect for a 1-32 quest bot.
Setup: Compile to a folder named "EzMiner" inside of your plugins folder. Create a new GPS database inside of this folder named "gps.db3". To setup the points, start your character at the beginning of the mine, or where you want your loop to begin. Load up the GPS plugin. Check the Auto mode and configure the Distance/Angle, I used the values 20.0/15 respectively. Set the mode to Patch. Now run a full loop around where you are mining, this will create a waypoint system so your bot does not run into walls.
Donate: If you find this script useful or want to see updates to it, please find it in your heart to donate me a few dollars! A coffee goes a long way in the coding world!
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
{
Gps gps;
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()
{
gps = new Gps(this);
gps.LoadDataBase(Application.StartupPath + "\\Plugins\\EzMiner\\gps.db3");
gps.onGpsPreMove += gpsPreMove;
while(me.laborPoints > 100)
{
ClearMobs();
HarvestOre();
}
PluginStop();
}
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("Flamebolt"))
{
UseSkillAndWait("Flamebolt");
}
else if(SkillReady("Mana Stars"))
{
UseSkillAndWait("Mana Stars");
}
else if(SkillReady("Endless Arrows"))
{
UseSkillAndWait("Endless Arrows");
}
else if(SkillReady("Rapid Strike"))
{
UseSkillAndWait("Rapid Strike");
}
else if(SkillReady("Triple Slash"))
{
UseSkillAndWait("Triple Slash");
}
else if(SkillReady("Critical Discord"))
{
UseSkillAndWait("Critical Discord");
}
else if(SkillReady("Shoot Arrow"))
{
UseSkillAndWait("Shoot Arrow");
}
}
}
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);
}
public void HarvestOre()
{
RoundZone zone = new RoundZone(me.X, me.Y, 50);
DoodadObject ore = FindClosestOre();
try
{
if (ore != null)
{
GpsPoint gpsPoint = gps.GetNearestPoint(ore.X, ore.Y, ore.Z);
gps.GpsMove(gpsPoint, 5);
MoveTo(ore);
switch(ore.name)
{
case "Fortuna Vein":
UseDoodadSkill("Mining: Spend up to 20 Labor to extract ore.", ore, true, 1.5);
break;
case "Iron Vein":
UseDoodadSkill("Mining: Spend up to 10 Labor to extract ore.", ore, true, 1.5);
break;
}
}
}
catch(Exception)
{
}
}
public DoodadObject FindClosestOre()
{
DoodadObject fortunaVein = getNearestDoodad("Fortuna Vein");
DoodadObject ironVein = getNearestDoodad("Iron Vein");
if (fortunaVein == null && ironVein == null)
{
return null;
}
if (ironVein == null)
return fortunaVein;
if (fortunaVein == null)
return ironVein;
if (me.dist(fortunaVein) < me.dist(ironVein))
{
return fortunaVein;
}
else
{
return ironVein;
}
}
public void PluginStop()
{
}
}
}
Last edited: