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
</wowgameobject></wowgameobject></wowgameobject></wowgameobject>
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
}
Last edited: