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

Nesox,Main,Enrion or Hawker Help please! or anyone that thinks they have the answer.

bloodlove

Member
Joined
Mar 27, 2010
Messages
91
Reaction score
1
ok so i am building a plugin and everything is working in vs when i build the solution and project but when i paste the cs in the plugin's folder and start hb i get

Plugin BGatherer.cs could not be compiled! Compiler errors:
File: BGatherer.cs Line: 160 Error: Cannot convert method group 'Max' to non-delegate type 'int'. Did you intend to invoke the method?

here is the code

Code:
namespace Styx.Bot.CustomClasses
{
    using Logic;
    using System;
    using Helpers;
    using Logic.Pathing;
    using System.Threading;
    using System.Diagnostics;
    using Styx;
    using System.Collections.Generic;
    using System.IO;
    using System.Runtime.InteropServices;
    using System.Xml.Linq;
    using System.Linq;
    using System.Net;
    using System.Windows.Forms;
    using System.Drawing;
    using Styx.Plugins.PluginClass;
    using System.Reflection;
    using Styx.Logic.Inventory.Frames.Gossip;
    using Styx.Logic.Pathing.Interop;
    using Styx.WoWInternals;
    using Styx.Logic.Profiles;
    using Styx.WoWInternals.WoWObjects;


    public class BSkill : HBPlugin
    {
        /// <summary>
        ///making this for mining for now will expand once it is working. 
        ///doing psuedo code first then going to work through this extreamly unfamiliar dll
        ///end point is to get a working mining section then reiterate it 
        ///for the other skills of herbalism and skinning
        ///credit to CnG for the help with the gui and portal use
        ///MaIN for pointing out my newishness in how to get skills
        ///Ski for well who knows
        ///Oh and my ex C0-worker and friend DigiMajic who taught me what i know about C#
        /// </summary>
        
        #region FilePath
        string HBLocation = @"C:\Users\Alex\Desktop\HB2 Beta 5\Default Profiles";
        private readonly LocalPlayer Me = ObjectManager.Me;
        #endregion

        #region random variables and methods
        private void slog(string format, params object[] args)
        { Logging.Write("BSkill:" + format, args); }

        public override string Author
        {
            get { return "Bloodlove"; }
        }

        public override bool WantButton
        {
            get { return true; }
        }

        public override Version Version
        {
            get { return new Version(0, 1); }
        }

        public override string Name
        {
            get { return "BSkill"; }
        }
        #endregion
        
        #region Startskill method
        public int startSkill()
        {
            int startMiningSkill= Me.GetSkill((SkillLine.Mining)).CurrentValue;
            return startMiningSkill;
        }
        #endregion

        #region Pulse

        public override void Pulse()
        {
            #region pulse variables
            int startMiningSkill2 = startSkill();
            bool firstRun = true;
            #endregion

            
            #region firstRun
            if (firstRun == true)
            {
                //////////////////////////
                //alliance profile loads//   need to learn how to load the profile to hb dynamicaly maybe ask enrion
                ///////////////////////////////////////////////////////////////////////////////////////
                if (Me.IsAlliance && startMiningSkill2 < 75)
                {
                    string _path = (HBLocation + @"\allianceMine_0_75.xml");
                    ProfileManager.LoadNew(_path);
                    slog("Loaded allianceMine_0_75.xml");
                }
                else if (Me.IsAlliance && startMiningSkill2 < 150 && startMiningSkill2 >= 75)
                {
                    string _path = HBLocation + @"\allianceMine_75_150.xml";
                    ProfileManager.LoadNew(_path);
                    slog("Loaded allianceMine_75_150.xml");
                }
                else if (Me.IsAlliance && startMiningSkill2 < 225 && startMiningSkill2 >= 150)
                {
                    string _path = HBLocation + @"\allianceMine_150_225.xml";
                    ProfileManager.LoadNew(_path);
                    slog("Loaded allianceMine_150_225.xml");
                }
                else if (Me.IsAlliance && startMiningSkill2 < 300 && startMiningSkill2 >= 225)
                {
                    string _path = HBLocation + @"\allianceMine_225_300.xml";
                    ProfileManager.LoadNew(_path);
                    slog("Loaded allianceMine_225_300.xml");
                }
                ////////////////////////////////////////////////////////////////////////////////////////
                //////////////////////////
                /////////////////////////
                //Horde profile loads///
                ///////////////////////
                ////////////////////////////////////////////////////////////////////////////////////
                if (Me.IsHorde && startMiningSkill2 < 75)
                {
                    string _path = HBLocation + @"\HordeMine_0_75.xml";
                    ProfileManager.LoadNew(_path);
                    slog("Loaded HordeMine_0_75.xml");
                }
                else if (Me.IsHorde && startMiningSkill2 < 150 && startMiningSkill2 >= 75)
                {
                    string _path = HBLocation + @"\HordeMine_75_150.xml";
                    ProfileManager.LoadNew(_path);
                    slog("Loaded HordeMine_75_150.xml");
                }
                else if (Me.IsHorde && startMiningSkill2 < 225 && startMiningSkill2 >= 150)
                {
                    string _path = HBLocation + @"\HordeMine_150_225.xml";
                    ProfileManager.LoadNew(_path);
                    slog("Loaded HordeMine_150_225.xml");
                }
                else if (Me.IsHorde && startMiningSkill2 < 300 && startMiningSkill2 >= 225)
                {
                    string _path = HBLocation + @"\HordeMine_225_300.xml";
                    ProfileManager.LoadNew(_path);
                    slog("Loaded HordeMine_225_300.xml");
                }
                ///////////////////////////////////////////////////////////////////////////////////////
                firstRun = false;
            }
            #endregion

            #region NotFirstRun
            ///////////////////////////////////////////////////
            //if not first run and profile is already running//
            //////////////////////////////////////////////////////////////////////////////////////////
            if (firstRun == false)
            {
                int curMiningSkill = ObjectManager.Me.GetSkill(SkillLine.Mining).CurrentValue;
                int maxMiningSkill = Me.GetSkill(SkillLine.Mining).Max;//this line right here will build in vs but not when it loads in gatherbuddy
                
                if (curMiningSkill == startMiningSkill2 + 75 && curMiningSkill == maxMiningSkill)
                {
                    //////////////////////
                    //for horde training//
                    //////////////////////

                    if (Me.IsHorde)
                    {
                        if (!Me.ZoneText.Contains("Dalaran"))
                        {
                            Lua.DoString("RunMacroText(\"/cast Hearthstone\")");
                            slog("im not in dalaran lets hearth");
                            Thread.Sleep(10000);
                            string _path = HBLocation + @"\DalMiningTrainer.xml";
                            ProfileManager.LoadNew(_path);
                            if (StyxWoW.AreaManager.CurrentGrindArea.CurrentHotSpot.Equals(ObjectManager.Me.Location))
                            {
                                _path = HBLocation + @"\default.xml";
                            }


                            bool trainingDone = false;
                            /////////////////////////////
                            /////////////////////////////
                            ///put training code here////
                            /////////////////////////////
                            /////////////////////////////
                            trainingDone = true;

                            if (trainingDone == true)
                            {
                                _path = HBLocation + @"\DalHordePortal.xml";
                                ProfileManager.LoadNew(_path);

                                if (StyxWoW.AreaManager.CurrentGrindArea.CurrentHotSpot.Equals(ObjectManager.Me.Location))
                                {
                                    List<wowgameobject> objectsList = ObjectManager.GetObjectsOfType<wowgameobject>(false);

                                    foreach (WoWGameObject Gobject in objectsList)
                                    {
                                        if (Gobject.Entry == 191009 && Gobject.Distance <= 30 && !Gobject.InUse)
                                        {
                                            slog("clicking Org Portal");
                                            Gobject.Interact();
                                        }
                                    }
                                }
                            }
                        }
                        firstRun = true;
                        startSkill();
                    }

                    if (Me.IsAlliance)
                    {
                        if (!Me.ZoneText.Contains("Dalaran"))
                        {
                            Lua.DoString("RunMacroText(\"/cast Hearthstone\")");
                            slog("im not in dalaran lets hearth");
                            Thread.Sleep(10000);
                            string _path = HBLocation + @"\DalMiningTrainer.xml";
                            ProfileManager.LoadNew(_path);

                            if (StyxWoW.AreaManager.CurrentGrindArea.CurrentHotSpot.Equals(ObjectManager.Me.Location))
                            {
                                _path = HBLocation + @"\default.xml";
                            }


                            bool trainingDone = false;

                            /////////////////////////////
                            /////////////////////////////
                            ///put training code here////
                            /////////////////////////////
                            /////////////////////////////

                            trainingDone = true;

                            if (trainingDone == true)
                            {
                                _path = HBLocation + @"\DalAlliPortal.xml";
                                ProfileManager.LoadNew(_path);

                                if (StyxWoW.AreaManager.CurrentGrindArea.CurrentHotSpot.Equals(ObjectManager.Me.Location))
                                {
                                    List<wowgameobject> objectsList = ObjectManager.GetObjectsOfType<wowgameobject>(false);

                                    foreach (WoWGameObject Gobject in objectsList)
                                    {
                                        if (Gobject.Entry == 190960 && Gobject.Distance <= 30 && !Gobject.InUse)
                                        {
                                            slog("clicking Stormwind Portal");
                                            Gobject.Interact();
                                        }
                                    }
                                }
                            }
                            
                        }
                        firstRun = true;
                        startSkill();
                    }
                }
                else if (curMiningSkill == (startMiningSkill2 + 75) && curMiningSkill < maxMiningSkill)
                {
                        startMiningSkill2 = maxMiningSkill - 75;
                        firstRun = true;
                        //start load next profile here. do this by setting first run back to true and it will catch on next pulse
                    }
            #endregion

                }
            }
        }
        #endregion
    }
</wowgameobject></wowgameobject></wowgameobject></wowgameobject>
 
Last edited:
Tried
Code:
int maxMiningSkill = Me.GetSkill(SkillLine.Mining).MaxValue;
instead of Max?
 
no liquid wowskill has to contain a definition for your second argument with me.GetSkill() and MaxValue is not one of them
 
Just figured if CurrentValue is a valid one I guessed MaxValue would be the other one instead of just Max (with which U has the compile error in HB2).

Edit: Just went trough Object Browser, it is MaxValue that is a valid return.
Styx.Logic.WoWSkill.WoWSkill(uint) valid returns are: Bonus, CanLink, CategoryId, CurrentValue, Id, IsValid, MaxValue, Name and SpellIcon
 
Last edited:
Liquid is right. You want to use MaxValue.
 
main that is not a option allowed it will not compile in vs or honorbuddy with that

Error 1 'Styx.Logic.WoWSkill' does not contain a definition for 'MaxValue' and no extension method 'MaxValue' accepting a first argument of type 'Styx.Logic.WoWSkill' could be found (are you missing a using directive or an assembly reference?) C:\Users\----\Documents\Visual Studio 2008\Projects\ClassLibrary4\ClassLibrary4\Class1.cs 160 68 ClassLibrary4
 
also trying Convert.ToInt32(Me.GetSkill(SkillLine.Mining).Max.ToString()) does not work
 
Me.GetSkill() requires 2 arguments 1 of course is SkillLine.Mining and the other actualy comes outside of the parens and has to be one of the defined members provided by Styx.Logic.WoWSkill
 
main that is not a option allowed it will not compile in vs or honorbuddy with that

Error 1 'Styx.Logic.WoWSkill' does not contain a definition for 'MaxValue' and no extension method 'MaxValue' accepting a first argument of type 'Styx.Logic.WoWSkill' could be found (are you missing a using directive or an assembly reference?) C:\Users\----\Documents\Visual Studio 2008\Projects\ClassLibrary4\ClassLibrary4\Class1.cs 160 68 ClassLibrary4

Please learn your language. The solution has been posted multiple times.
ObjectManager.Me.GetSkill(SkillLine.Mining).MaxValue.

Me.GetSkill() requires 2 arguments 1 of course is SkillLine.Mining and the other actualy comes outside of the parens and has to be one of the defined members provided by Styx.Logic.WoWSkill
No, it only requires one - SkillLine.
 
excuse me may fault Main you are correct your honor microsoft is just ignorant
 
Back
Top