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

not working how i want it to, what am i doing wrong

IShaunYI

Member
Joined
Sep 24, 2014
Messages
57
Reaction score
0
ok, to put it simply, this is the most recent version of this plug-in alteration that i have quickly put together, it has bits and pieces from 3 different scripts from various authors...

anyway, basically i want it to follow a gps course thats made throughout a cave that goes near veins, once it notices its near for it to run to it and then mine it.

i do think the gps wrong for exactly that. so my question is... do i have to make a gps course that goes directly on top of every vein that i want it to mine ? and if so, do i then have to add every "Mine" to the script below for it to run to that specific piece before trying to mine it ?

sorry for the newby questions, im not exactly a script writer, i just thought i could try and put something together that would many others are doing, but my own variation.

ive used Galio's simple miner, but i had the same issue, so i think it has something to do with the gps that i make...

please guys i know theres many of you out there that has a lot of knowledge when it comes to this, so any/all advice or help is appreciated

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";
       }

       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\\test\\test.db3");     
           gps.GpsMove("mine1"); 
          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)

                               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); 
                                }                               
                                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 insulating lens < 17 yards
             public void prepareForCombat ()
            {
                while(dist(me.target) >= 21)
                    ComeTo(me.target, 17);
                if(skillCooldown("Insulating Lens") == 0 && dist(me.target) <= 20)
                    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()
            {
            }
        }
    }
 
Back
Top