Disclaimer, I didn't test this at all just coded it and compiled it here you go I_ShaunY_I.
Edited: Version 1.0.0.2 // Forgot to start checkBuffs and prepareforCombat functions and changed your if statement to only check if the target is with in 20m before fighting it, the rest is useless since we already know the target is aggro from the first if statement
Edited: Version 1.0.0.2 // Forgot to start checkBuffs and prepareforCombat functions and changed your if statement to only check if the target is with in 20m before fighting it, the rest is useless since we already know the target is aggro from the first if statement
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 SafeMiner{
public class SafeMiner : Core
{
public static string GetPluginAuthor()
{
return "I_ShaunY_I / Sintal1ty";
}
public static string GetPluginVersion()
{
return "1.0.0.2";
}
public static string GetPluginDescription()
{
return "SafeMiner for Sorcery & Witchcraft based classes";
}
private Gps gps;
public void PluginRun()
{
gps = new Gps(this);
gps.LoadDataBase(Application.StartupPath + "\\Plugins\\SafeMiner\\SafeMiner.db3");
gps.GpsMove("Mine");
List<Creature> mobs = getAggroMobs();
RoundZone z = new RoundZone(me.X,me.Y,40);
while(true)
{
if(getAggroMobs().Count > 0)
{
prepareForCombat () ;
checkBuffs();
if (dist(me.target) <= 20) // Works just fine
/* if (dist(me.target) <= 20 && skillCooldown("Enervate") == 0 && getAggroMobs().Count >= 0 && skillCooldown("Earthen Grip") != 0)
another change this really isn't needed */
// Code by sintal1ty special bubble trap fun!
if (skillCooldown("Bubble Trap") == 0 && skillCooldown("Flamebolt") == 0 && dist(me.target) <= 16 && hpp(me.target) >= 50)
{
if((hpp() < 80) && (skillCooldown("Enervate") == 0) && (skillCooldown("Earthen Grip") == 0))
{
UseSkillAndWait("Enervate");
Thread.Sleep(250);
UseSkillAndWait("Earthen Grip");
Thread.Sleep(50);
}
Thread.Sleep(1000);
UseSkillAndWait("Flamebolt");
Thread.Sleep(1000);
UseSkillAndWait("Bubble Trap");
Log("Used: Flamebolt , Bubble Trap Combo - Waiting 4 seconds for fall damage");
Thread.Sleep(3500);
}
// Heal combo :: sintal1ty
if((hpp() < 75) && (skillCooldown("Enervate") == 0) && (skillCooldown("Earthen Grip") == 0))
{
Thread.Sleep(1000);
UseSkillAndWait("Enervate");
Thread.Sleep(250);
UseSkillAndWait("Earthen Grip");
Thread.Sleep(50);
}
if (skillCooldown("Freezing Arrow") ==0)
// Cast "Freezing Arrow" if not on cooldown
{
UseSkillAndWait("Freezing Arrow");
Log("Used: Freezing Arrow");
Thread.Sleep(100);
}
for(int i = 0; i < 2; i++)
UseSkillAndWait("Flamebolt");
Thread.Sleep(10);
}
}
CollectItemsInZone("Fortuna Vein","Mining: Spend up to 20 Labor to extract ore.",z);
CollectItemsInZone("Iron Vein","Mining: Spend up to 10 Labor to extract ore.",z);
}
// Prepare for combat cast Magic Circle < 17 yards
public void prepareForCombat ()
{
while(dist(me.target) >= 21)
ComeTo(me.target, 17);
if(skillCooldown("Magic Circle") == 0 && dist(me.target) <= 20)
{
UseSkillAndWait("Magic Circle");
Thread.Sleep(100);
}
}
// Check buffs function
public void checkBuffs ()
{
if(buffTime("Magic Defense Boost") == 0 && skillCooldown("Purge") == 0)
UseSkillAndWait("Purge", true);
if(skillCooldown("Insulating Lens") == 0)
UseSkillAndWait("Insulating Lens", true);
}
// Skill function credit Out
public void UseSkillAndWait (string skillName, bool selfTarget = false)
{
while(me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
if(!UseSkill(skillName, true, selfTarget))
{
if(me.target != null && GetLastError() == LastError.NoLineOfSight)
{
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);
}
}
while(me.isCasting || me.isGlobalCooldown)
Thread.Sleep(50);
}
//Call on plugin stop
public void PluginStop()
{
}
}
}
Last edited: