• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Auctionhouse plugin.

    Discussion in 'Archives' started by morgalis, Feb 10, 2010.

    1. morgalis

      morgalis New Member

      Joined:
      Jan 15, 2010
      Messages:
      54
      Likes Received:
      0
      Trophy Points:
      0
      this plugin was just a test to see if i could work with C# , i am a Delphi coder so I gave it a try.

      These are the basic stuff needed to make an auction house bot. Buying , fetchmail en re-sell it.

      Code:
      namespace Styx.Bot.CustomClasses
      {
          using Logic.Inventory.Frames.MailBox;
          using Logic;
          using System;
          using Helpers;
          using Logic.Pathing;
          using System.Threading;
          using System.Diagnostics;
          using Logic.Common.Combat;
          using Object_Dumping_Enumeration;
          using CustomCombat.CombatInterface;
          using Memory_Read_Write_Inject.Lua;
          using Object_Dumping_Enumeration.WoWObjects;
          using System.Collections.Generic;
          using System.IO;
          using System.Runtime.InteropServices;
          using System.Xml.Linq;
          using System.Linq;
          using System.Net;
          using Styx.Plugins.PluginClass;
          using Styx;
      
          public class AH : HBPlugin
          {
              public int STATE = 2;
              public int TO_AUCTIONEER = 2;
              string Totauctions = "";
              public override void Pulse()
              {
                  switch(STATE){ // temporary statemachine , need better when finishing tests.
      
                      case 2: //TO_AUCTIONEER                    
                          MoveToAuctioneer();
                          if (CheckMail()) 
                          { 
                              STATE = 3;
                          }
                          break;
      
                      case 3://move to mail and fetch.
                          MoveToMail();
                          break;
      
                      case 4:
                          //sell stuff here
                          break;
      
                      case 5:
                          //buying stuff here.
                          break;
      
                      default:
                          Thread.Sleep(1000);
                          break;
                 }
              } 
              //
              //
              //
              //
              public bool TargetUnit(uint Nom)
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
                  
                  foreach (WoWUnit wu in ObjectManager.GetObjectsOfType<WoWUnit>())
                  {                           
                      if (wu.Entry == Nom)
                      {
                          Logging.Write(wu.Name + " is now my target!");
                          wu.Target();                    
                      }
                  }
      
                  Thread.Sleep(1000);
                  if (ObjectManager.Me.CurrentTarget.Entry == Nom)
                  {
                      
                      return true;
                  }
                  return false;
              }
              //
              //
              //
              //
              public bool TargetObj(uint Nom)
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
      
                  foreach (WoWGameObject wa in ObjectManager.GetObjectsOfType<WoWGameObject>())
                  {
                      if (wa.Entry == Nom)
                      {
                          wa.Interact();  
                      }
                  }
                  Thread.Sleep(1000);
                  if (ObjectManager.Me.CurrentTarget.Entry == Nom)
                  {
                      return true;
                  }
                  return false;
              }
      
              public bool MoveToAuctioneer()
              {   
                  //this need better loggic.maybe using Frames
                  var wp = new WoWPoint(1692.761, -4453.158, 19.04647);
      
                  if (wp.Distance(ObjectManager.Me.Location) > 5)
                  {
                      Navigator.GeneratePathFromMe(new WoWPoint(1692.761, -4453.158, 19.04647));
                      Logging.Write("Moving to Auctioneer");
                      
                      while (wp.Distance(ObjectManager.Me.Location) > 5)
                      {
                          Navigator.MoveTo(new WoWPoint(1692.761, -4453.158, 19.04647));
                          Navigator.Pulse();
                      }
                      Thread.Sleep(1000);
                      TargetUnit(9856);
                      ObjectManager.Me.CurrentTarget.Interact();
                      Thread.Sleep(2000);
                      Lua.DoString("QueryAuctionItems(\"Eternal Fire\",\"\",\"\",nil,nil,nil,nil,nil,nil)");// Eternal fire hardcoded. Styx has some AH stuff inside already.
                      Thread.Sleep(1000);
                      Logging.Write("Displayed Auction lines:  " + TotalAuctionLines());                
                  }
                  return (true);
              }
      
              public bool MoveToMail()
              {
                  var wp = new WoWPoint(1616, -4392, 10);
                  var ml = new MailFrame() ;
                  Navigator.GeneratePathFromMe(new WoWPoint(1616, -4392, 10));
                  Logging.Write("Moving to Mail");
                  while (wp.Distance(ObjectManager.Me.Location) > 5)
                  {
                      Navigator.MoveTo(new WoWPoint(1616, -4392, 10));
                      Navigator.Pulse();
                  }
                  if (wp.Distance(ObjectManager.Me.Location) < 5)
                  {                
                      TargetObj(173221);
                      Thread.Sleep(3000);               
                      while (Convert.ToInt32(ml.MailCount.ToString()) > 0)
                      {
                              Logging.Write("Standing at Mailbox for collecting mails: " + ml.MailCount.ToString());
                              Thread.Sleep(1000);
                              ml.GetMailAttachments(1);
                     }
                      STATE = TO_AUCTIONEER;
                  }
                  STATE = TO_AUCTIONEER;
      
                  return true;
      
              }
              public string TotalAuctionLines()
              {
                  Lua.DoString("Totauctions = GetNumAuctionItems(\"list\")");
                  Totauctions = Lua.GetLocalizedText("Totauctions");
      
                  return Totauctions;
              }
      
              public bool CheckMail()
              {
                  int IHave = 0;
                  Lua.DoString("IHave = HasNewMail()");
                  IHave = Convert.ToInt32(Lua.GetLocalizedText("IHave"));
      
                  if (IHave > 0)
                  {
                       STATE = 3;
      
                      return true;
                  }
                  else
                  {
                      return false;
                  }
              }
      
              public override string Name { get { return "Auctioneer"; } }
      
              public override string Author { get { return "Morgalis "; } }
      
              public override Version Version { get { return new Version(1, 1); } }
      
              public override bool WantButton { get { return false; } }
          }
      }
      I heard that the staff will release an version so i quit on it.

      TO DO:

      Buy
      sell
      xml handle
      rules

      Done:
      already goes to auctioneer , open his window , searc for eternals.
      detect new mail , goes to mailbox and fetch all.

      HORDE ONLY ORGRIMMAR !!!

      Maybe ill contineu it , i saw inside the styx all auctionhouse stuff that i need.
       
    2. mindtrapper

      mindtrapper Member

      Joined:
      Jan 15, 2010
      Messages:
      364
      Likes Received:
      1
      Trophy Points:
      18
      Very interesting. I suppose people who play the Glyph market will treasure an AH function.
       
    3. Dreike

      Dreike New Member

      Joined:
      Jan 15, 2010
      Messages:
      91
      Likes Received:
      0
      Trophy Points:
      0
      Eh? :confused:
       
    4. Mess1337

      Mess1337 Active Member

      Joined:
      Jan 15, 2010
      Messages:
      1,385
      Likes Received:
      23
      Trophy Points:
      38
      Looks really nice :D
       
    5. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      Omg, i started building one today lol!

      PS: oh, you released it minutes after i started deving mine.

      PS2: if you want to help me out building this, heres the code i started to put together:
      WARNING I DIDNT TEST IT YET, JUST STARTED PROGRAMMING IT WITH STUFF THAT MAKES SENCE, PROBABLY WONT COMPILE
      Code:
      using Styx;
      using Styx.Bot.CustomClasses;
      using Styx.Logic.Pathing;
      using Styx.Object_Dumping_Enumeration;
      using Styx.Object_Dumping_Enumeration.WoWObjects;
      
      namespace Plugin_qMasta
      {
          using Logic;
          using System;
          using Helpers;
          using Logic.Pathing;
          using System.Threading;
          using System.Diagnostics;
          using Logic.Common.Combat;
          using Object_Dumping_Enumeration;
          using CustomCombat.CombatInterface;
          using Memory_Read_Write_Inject.Lua;
          using Object_Dumping_Enumeration.WoWObjects;
          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.NavMesh;
      
          // uses alot of adapted code from eTrain, left original names =)
      
          public class BigMaintenance : HBPlugin
          {
              bool PermanentAbort = false;
              Styx.Logic.Pathing.NavMesh.NavMesh PlayerMesh;
      
              // name of your mesh
              private string myMesh = "ThunderbluffMaintenance.mesh";
              private WoWUnit AHnpc;
              private WoWUnit mailbox;
              private NavMesh mMesh;
      
              private static Stopwatch sw = new Stopwatch();
      
              public override void Pulse()
              {
                  //AHnpc.Name = "";
      
      
                  // Skip this during combat
                  if (ObjectManager.Me.Combat)
                      return;
      
                  if (safeToStart && !PermanentAbort && !StuckDetector.IsStuck)
                  {
                      PlayerMesh = Navigator.CurrentMesh;
                      mMesh = NavMesh.LoadFromFile(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Plugins\\"+myMesh));
                      NavNode node = PlayerMesh.OverlappingPoint(mMesh);
                      if (node == null)
                      {
                          PermanentAbort = true;
                         // Logging.Write("Could not find suitable place to switch to maintenance mesh! Stopping maintenance!");
                          return;
                      }
                      Navigator.Clear();
                      while (eTrainNavigator.GoToLocation(node.Location))
                      {//go to tansfer point (eTrain mesh)
                      }
                  }
      
                  if (!sw.IsRunning)
                  {
                      sw.Start();
                  }
                  if (sw.Elapsed.TotalSeconds > 30)
                  {
                      // do something
                      AHnpc = null; // clear targets each 30sec
                      mailbox = null;
                  }
              }
      
              public void sellStuff()
              {
                  interactWithAH();
                  // todo: while i am selling stuff wait.
      
      
                  //TrainerHelper.ChooseGossipTrain();
                  //switch to auto sell tab
                  Thread.Sleep(1000);
                  Logging.Write("Training!");
                  //TrainerHelper.TrainAllSkills();
                  //click bulk sell
                  Thread.Sleep(5000);
                  return;
              }
              public void searchAH()
              {
                  interactWithAH();
                  // todo: while i am searching ah, wait.
                  
                  //TrainerHelper.ChooseGossipTrain();
                  //switch to auto sell tab
                  Thread.Sleep(1000);
                  Logging.Write("Training!");
                  //TrainerHelper.TrainAllSkills();
                  //click bulk sell
                  Thread.Sleep(5000);
              }
              public void interactWithAH()
              {
                  if (AHnpc == null)
                      AHnpc = findNearestAH();
      
                  if (eTrainNavigator.IsAtLocation(AHnpc.Location))
                  {
                      //eTrainNavigator.GoToMob(AHnpc);
                      while(eTrainNavigator.GoToLocation(AHnpc.Location))
                      {
                       //wait   
                      }
                  }
                  //if(ObjectManager.Me.CurrentTarget.Name == AHnpc.Name)
                   //   return;
                  AHnpc.Target();
                  Thread.Sleep(2000);
                  ObjectManager.Me.CurrentTarget.Interact();
                  Logging.Write("Talking to NPC " + AHnpc.Name + "!");
                  Thread.Sleep(2000);
              }
      
      
              public void interactWithMailbox()
              {
                  if(mailbox == null)
                      mailbox = findNearestMailbox();
                  Navigator.Clear();
                  while (eTrainNavigator.GoToLocation(mailbox.Location))
                  {
                  }
                  mailbox.Interact();
              }
      
              public WoWUnit findNearestMailbox()
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
                  foreach (WoWUnit wu in ObjectManager.GetObjectsOfType<WoWUnit>())
                  {
                      if (wu.Name == "Mailbox")
                      {
                          return wu;
                      }
                  }
                  return null;
              }
              public WoWUnit findNearestAH()
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
                  foreach (WoWUnit wu in ObjectManager.GetObjectsOfType<WoWUnit>())
                  {
                      if (wu.IsAuctioneer && mMesh.IsPointPathingAvailable(wu.Location))
                      {
                          return wu;
                      }
                  }
                  return null;
              }
      
      
      
      
      
      
      
      
              public bool safeToStart
              {
                  get
                  {
                      if (Global.Honorbuddy != null)
                      {
                          if (!sw.IsRunning)
                          {
                              sw.Start();
                          }
                          if (ObjectManager.Me.Combat || !ObjectManager.Me.IsAlive || !Global.Honorbuddy.IsRunning || Global.Honorbuddy.CurrentState.GetType().Name != "StateMoveToHotSpot")
                          {
                              sw.Reset();
                              sw.Start();
                              return false;
                          }
                          if (sw.Elapsed.Seconds < 2)
                          {
                              return false;
                          }
                          return true;
                      }
                      return false;
                  }
              }
            
      
      
      
              public override string Name { get { return "BigMaintenance"; } }
      
              public override string Author { get { return "MrBig"; } }
      
      
              public override Version Version { get { return new Version(0, 1); } }
      
              public override bool WantButton { get { return false; } }
      
          }
      
          public abstract class Mob
          {
              public WoWPoint Location;
              public string Name;
              public bool Alliance, Kalimdor;
              public List<string> City;
              public int Entry;
              public Mob(WoWPoint location, string name, bool alliance, bool kalimdor, List<string> city, int entry)
              {
                  Location = location;
                  Name = name;
                  Alliance = alliance;
                  Kalimdor = kalimdor;
                  City = city;
                  Entry = entry;
              }
      
              public double Distance
              {
                  get
                  {
                      return ObjectManager.Me.Location.Distance(Location);
                  }
              }
              public bool Accessible
              {
                  get
                  {
                      if (Location.GetPointsAtDistanceOf(10, Navigator.CurrentMesh.FastGetNavNet()).Count > 0)
                      {
                          return true;
                      }
                      return false;
                  }
              }
      
              public bool Target()
              {
                  ObjectManager.Update();
                  Thread.Sleep(5000);
                  foreach (WoWUnit wu in ObjectManager.GetObjectsOfType<WoWUnit>())
                  {
                      if (wu.Entry == Entry)
                      {
                          wu.Target();
                      }
                  }
                  Thread.Sleep(1000);
                  if (ObjectManager.Me.CurrentTarget.Entry == Entry)
                  {
                      return true;
                  }
                  return false;
              }
          }
      
      
      
      
      
          public class Actioneer : Mob
          {
              public WoWClass Class;
              public bool StartTrainer;
      
      
      
              public Actioneer(WoWPoint location, string name, bool alliance, bool kalimdor, WoWClass wowclass, List<string> city, bool startTrainer, int entry)
                  : base(location, name, alliance, kalimdor, city, entry)
              {
                  Class = wowclass;
                  StartTrainer = startTrainer;
              }
      
              public Actioneer(WoWPoint location, string name, bool alliance, bool kalimdor, WoWClass wowclass, string city, bool startTrainer, int entry)
                  : this(location, name, alliance, kalimdor, wowclass, new List<string> { city }, startTrainer, entry)
              {
      
              }
              public Actioneer(double x, double y, double z, string name, bool alliance, bool kalimdor, WoWClass wowclass, string city, bool startTrainer, int entry)
                  : this(new WoWPoint(x, y, z), name, alliance, kalimdor, wowclass, city, startTrainer, entry)
              {
      
              }
      
              public Actioneer(double x, double y, double z, string name, bool alliance, bool kalimdor, WoWClass wowclass, List<string> city, bool startTrainer, int entry)
                  : this(new WoWPoint(x, y, z), name, alliance, kalimdor, wowclass, city, startTrainer, entry)
              {
      
              }
          }
      
      
      
      
      
          public static class eTrainNavigator
          {
              static Stopwatch sw = new Stopwatch();
              static float x, y, z;
              public static bool GoToMob(Mob mob)
              {
                  if (x != ObjectManager.Me.Location.X || y != ObjectManager.Me.Location.Y || z != ObjectManager.Me.Location.Z)
                  {
                      sw.Reset();
                      sw.Start();
                  }
                  x = ObjectManager.Me.Location.X;
                  y = ObjectManager.Me.Location.Y;
                  z = ObjectManager.Me.Location.Z;
                  if (sw.Elapsed.Seconds > 5)
                  {
                      Navigator.Clear();
                      Logging.Write("Why did I stop moving? Thats not fun!");
                      Thread.Sleep(1000);
                      sw.Reset();
                      sw.Start();
                  }
                  if (ObjectManager.Me.Combat || !Global.Honorbuddy.IsRunning || Global.Honorbuddy.CurrentState.GetType().Name != "StateMoveToHotSpot")
                  {
                      Navigator.Clear();
                      return false;
                  }
                  if (mob.Distance > 5)
                  {
                      Navigator.MoveTo(mob.Location);
                      Thread.Sleep(500);
                      return true;
                  }
                  return false;
              }
      
              public static bool GoToLocation(WoWPoint wp)
              {
                  if (x != ObjectManager.Me.Location.X || y != ObjectManager.Me.Location.Y || z != ObjectManager.Me.Location.Z)
                  {
                      sw.Reset();
                      sw.Start();
                  }
                  x = ObjectManager.Me.Location.X;
                  y = ObjectManager.Me.Location.Y;
                  z = ObjectManager.Me.Location.Z;
                  if (sw.Elapsed.Seconds > 5)
                  {
                      Navigator.Clear();
                      Logging.Write("Why did I stop moving? Thats not fun!");
                      Thread.Sleep(1000);
                      sw.Reset();
                      sw.Start();
                  }
                  if (ObjectManager.Me.Combat || !Global.Honorbuddy.IsRunning || Global.Honorbuddy.CurrentState.GetType().Name != "StateMoveToHotSpot")
                  {
                      Navigator.Clear();
                      return false;
                  }
                  if (wp.Distance(ObjectManager.Me.Location) > 5)
                  {
                      Navigator.MoveTo(wp);
                      return true;
                  }
                  return false;
              }
      
              public static bool IsAtLocation(Mob mob)
              {
                  if (ObjectManager.Me.Location.Distance(mob.Location) < 5)
                  {
                      return true;
                  }
                  return false;
              }
      
              public static bool IsAtLocation(WoWPoint wp)
              {
                  if (wp.Distance(ObjectManager.Me.Location) < 8)
                  {
                      return true;
                  }
                  return false;
              }
      
              public static WoWUnit findMob(Mob mob)
              {
                  ObjectManager.Update();
                  List<WoWUnit> closeMobs = ObjectManager.GetObjectsOfType<WoWUnit>();
                  foreach (WoWUnit closeMob in closeMobs)
                  {
                      if (mob.Entry == closeMob.Entry)
                      {
                          return closeMob;
                      }
                  }
                  return null;
              }
          }
      }
      
      
      
      
      
      
      
       
      Last edited: Feb 10, 2010
    6. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      Also, i was wondering, how do you make it start? lol!

      Cant make it start for some reason (your version)

      Problem :
      [9:28:10 PM:452] Unable to read beyond the end of the stream. - From: mscorlib

      I hade a new profile with 2 hotspots, 1 near ah and one near mail... just for filler, and i am trying to make it run the plugin and ignore the rest, also made a mesh from mail to ah

      ... no idea, just load up WSG profile or something
       
      Last edited: Feb 10, 2010
    7. morgalis

      morgalis New Member

      Joined:
      Jan 15, 2010
      Messages:
      54
      Likes Received:
      0
      Trophy Points:
      0
      i have an mesh that is mapped from bank mail to left auctioneer in AH, check his name , it is hardcoded like also the query AH is hardcoded to Eternal Water. I looked into your version and i saw something where i had problems too. Mailbox is not a wowunit but a WoWGameObject.

      I dont get this error.
       
    8. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      Its something todo with the profile i was using, for some reason it gave that, but ignore it, since it got nothing todo with the CCs.

      Also, i took a look at your code, and changed some stuff to be more clean, and, i was trying to add the dynamic searches but i cant seem to get it started just yet.

      Also, i tryed your code, with changed coordinates and NPC guid, but crashes HB xD
       
    9. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      Ok, i fixed some stuff, added other stuff, used your version as starting point and scraped mine.

      Also, added my name to the developers if you dont mind us working together on it.

      Doesnt need specific mailbox position or ah guy, just needs a path.

      Code:
      namespace Styx.Bot.CustomClasses
      {
          using Logic.Inventory.Frames.MailBox;
          using Logic;
          using System;
          using Helpers;
          using Logic.Pathing;
          using System.Threading;
          using System.Diagnostics;
          using Logic.Common.Combat;
          using Object_Dumping_Enumeration;
          using CustomCombat.CombatInterface;
          using Memory_Read_Write_Inject.Lua;
          using Object_Dumping_Enumeration.WoWObjects;
          using System.Collections.Generic;
          using System.IO;
          using System.Runtime.InteropServices;
          using System.Xml.Linq;
          using System.Linq;
          using System.Net;
          using Styx.Plugins.PluginClass;
          using Styx;
      
          public class AH : HBPlugin
          {
              public Status currentAction = Status.MoveToAuctionner;
      
              string Totauctions = "";
      
              //private WoWUnit AHnpc;
              //private WoWGameObject mailbox;
              
              public enum Status
              {
                  Idle             = 0,
                  MoveToAuctionner = 1,
                  MoveToMail       = 2,
                  SellingStuff     = 3,
                  BuyStuff         = 4,
                  Disenchanting    = 5,
                  SearchingAH      = 6,
                  BottomScan       = 7,
                  Waiting          = 8
              }
      
              private static Stopwatch avoidCrashTimer = new Stopwatch();
      
              private static Stopwatch waitTimer = new Stopwatch();
      
              public override void Pulse()
              {
                  if (!avoidCrashTimer.IsRunning)
                  {
                      avoidCrashTimer.Start();
      
                  }
                  if (avoidCrashTimer.Elapsed.Seconds < 1)
                  {
                      return;
                  }
                  avoidCrashTimer.Reset();
      
      
                  
                  switch (currentAction)
                  { // temporary statemachine , need better when finishing tests.
      
                      case Status.MoveToAuctionner: //TO_AUCTIONEER                    
                          MoveToAuctioneer();
                          scanAhWithAuctioneerAddon();
                         
                          break;
      
                      case Status.MoveToMail://move to mail and fetch.
                          MoveToMail();
                          break;
      
                      case Status.SellingStuff:
                          //sell stuff here
                          break;
      
                      case Status.BuyStuff:
                          //buying stuff here.
                          break;
                      case Status.SearchingAH:
                          //should wait until completion
                          //todo: add completion checks
                          
                          break;
                      case Status.Waiting:
                          if (waitTimer.Elapsed.Minutes > 2)
                              currentAction = Status.Idle;
                          break;
                      case Status.Idle:
                          // do something
                          //shouldnt really just move to auctionner, but make maintenance checks
                          if (CheckMail() /*todo: and bags are not full*/)
                          {
                              currentAction = Status.MoveToMail;
                              return;
                          }
                          currentAction = Status.MoveToAuctionner;
                          break;
      
                      default:
                          Thread.Sleep(1000);
                          break;
                  }
              }
              //
              //
              //
              //
              public bool TargetUnit(uint Nom)
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
      
                  foreach (WoWUnit wu in ObjectManager.GetObjectsOfType<WoWUnit>())
                  {
                      if (wu.Entry == Nom)
                      {
                          Logging.Write(wu.Name + " is now my target!");
                          wu.Target();
                      }
                  }
      
                  Thread.Sleep(1000);
                  if (ObjectManager.Me.CurrentTarget.Entry == Nom)
                  {
      
                      return true;
                  }
                  return false;
              }
              //
              //
              //
              //
              public bool TargetObj(uint Nom)
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
      
                  foreach (WoWGameObject wa in ObjectManager.GetObjectsOfType<WoWGameObject>())
                  {
                      if (wa.Entry == Nom)
                      {
                          wa.Interact();
                      }
                  }
                  Thread.Sleep(1000);
                  if (ObjectManager.Me.CurrentTarget.Entry == Nom)
                  {
                      return true;
                  }
                  return false;
              }
      
              public bool MoveToAuctioneer()
              {
                  WoWUnit ahnpc = findNearestAH();
                  //this need better loggic.maybe using Frames
                  var wp = ahnpc.Location;
      
                  if (wp.Distance(ObjectManager.Me.Location) > 5)
                  {
                      Navigator.GeneratePathFromMe(wp);
                      Logging.Write("Moving to Auctioneer");
      
                      while (wp.Distance(ObjectManager.Me.Location) > 5)
                      {
                          Navigator.MoveTo(wp);
                          Navigator.Pulse();
                      }
                      Thread.Sleep(1000);
                      //findNearestAH());
                      //TargetUnit(findNearestAH().Guid);
                      findNearestAH().Target();
                      Thread.Sleep(1000);
                      ObjectManager.Me.CurrentTarget.Interact();
                      Thread.Sleep(2000);
                      Lua.DoString("QueryAuctionItems(\"Eternal Fire\",\"\",\"\",nil,nil,nil,nil,nil,nil)");// Eternal fire hardcoded. Styx has some AH stuff inside already.
                      Thread.Sleep(1000);
                      Logging.Write("Displayed Auction lines:  " + TotalAuctionLines());
                  }
                  return true;
              }
             
              public bool MoveToMail()
              {
                  WoWGameObject mail = findNearestMailbox();
      
                  var wp = mail.Location;
                  var ml = new MailFrame();
                  Navigator.GeneratePathFromMe(mail.Location);
                  Logging.Write("Moving to Mail");
                  while (wp.Distance(ObjectManager.Me.Location) > 5)
                  {
                      Navigator.MoveTo(mail.Location);
                      Navigator.Pulse();
                  }
                  if (wp.Distance(ObjectManager.Me.Location) < 5)
                  {
                      //TargetObj(173221);
                      mail.Interact();
                      Thread.Sleep(3000);
                      while (Convert.ToInt32(ml.MailCount.ToString()) > 0)
                      {
                          Logging.Write("Standing at Mailbox for collecting mails: " + ml.MailCount.ToString());
                          Thread.Sleep(1000);
                          ml.GetMailAttachments(1);
                      }
                      currentAction = Status.MoveToAuctionner;
                  }
                  currentAction = Status.MoveToAuctionner;
      
                  //found greens?
                  GetGreens();
                  return true;
      
              }
              public string TotalAuctionLines()
              {
                  Lua.DoString("Totauctions = GetNumAuctionItems(\"list\")");
                  Totauctions = Lua.GetLocalizedText("Totauctions");
      
                  return Totauctions;
              }
      
              public bool CheckMail()
              {
                  int IHave = 0;
                  Lua.DoString("IHave = HasNewMail()");
                  IHave = Convert.ToInt32(Lua.GetLocalizedText("IHave"));
      
                  if (IHave > 0)
                  {
                      currentAction = Status.MoveToMail;
      
                      return true;
                  }
                  return false;
              }
      
              public WoWGameObject findNearestMailbox()
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
                  foreach (WoWGameObject wu in ObjectManager.GetObjectsOfType<WoWGameObject>())
                  {
                      if (wu.Name == "Mailbox")
                      {
                          Logging.Write("Found " + wu.Name + " at: [" + wu.Location.X + "," + wu.Location.Y + "," + wu.Location.Z+"]");
                          return wu;
                      }
                  }
                  return null;
              }
              public WoWUnit findNearestAH()
              {
                  ObjectManager.Update();
                  Thread.Sleep(1000);
                  foreach (WoWUnit wu in ObjectManager.GetObjectsOfType<WoWUnit>())
                  {
                      if (wu.IsAuctioneer) //&& Navigator.CurrentMesh.IsPointPathingAvailable(wu.Location))
                      {
                          Logging.Write("Found " + wu.Name + " at: [" + wu.Location.X + "," + wu.Location.Y + "," + wu.Location.Z+"]");
                          return wu;
                      }
                  }
                  return null;
              }
      
              public void scanAhWithAuctioneerAddon()
              {
                  Logging.Write("Searching AH");
                  Lua.DoString("if (AucAdvScanButton:IsVisible()) then AucAdvScanButton:Click() end");
                  currentAction = Status.SearchingAH;
                  waitTimer.Reset();
                  waitTimer.Start();
              }
              #region Disenchanting
              //todo: add more
              private void GetGreens()
              {
                  var items = ObjectManager.GetObjectsOfType<WoWItem>(false);
                  var notSoulbound = items.Where(obj => !obj.IsSoulbound &&
                      obj.Quality == WoWItemQuality.Uncommon).ToList();
      
                  foreach (WoWItem item in notSoulbound)
                  {
                      Logging.Write("{0} is not soulbound", item.Name);
                  }
              }
              #endregion
      
      
              public override string Name { get { return "Auctioneer Fixed"; } }
      
              public override string Author { get { return "Morgalis and MrBig"; } }
      
              public override Version Version { get { return new Version(1, 2); } }
      
              public override bool WantButton { get { return false; } }
          }
      }
       
      Last edited: Feb 10, 2010
    10. morgalis

      morgalis New Member

      Joined:
      Jan 15, 2010
      Messages:
      54
      Likes Received:
      0
      Trophy Points:
      0
      We need more control over the core , he is loading CC and so on. I wanna have full control of HB , no need to grind...
       
    11. Mess1337

      Mess1337 Active Member

      Joined:
      Jan 15, 2010
      Messages:
      1,385
      Likes Received:
      23
      Trophy Points:
      38
      Nice job! Keep it up :D
       
    12. hDyz

      hDyz Member

      Joined:
      Jan 15, 2010
      Messages:
      147
      Likes Received:
      1
      Trophy Points:
      18
      I use QuickAuction 3 for all of my Auction house Pricing/Scanning/Posting. It works really well, just press "Post" or use the macro /run QuickAuctions.Manage:postScan(); and it will post all the stuff you've pre-configured.

      It might be easier to use Quickauction 3 in conjunction with a plugin vs coding an AH scanner/poster by hand. Ofcourse the running to and from mailbox/guild bank/AH is still needed for a plugin :)

      here is a REALLY simple AH bot (not really a bot) using macros and a G15 keyboard for automation. http://freewowguide.org/alliance-access-ah-and-mailbox-from-one-spot/
       
    13. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      Nothing wrong with loading the CC, since we can bypass it, takes forever to load ya, but we can fix that with a bogus CC. Make a new folder just for this.
       
    14. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      I have a G15 keyboard xD, use it for controlling my pet as hunter, lock or druid.

      As for quickauction 3, is it as powerfull as auctioneer? Because the CC i posted uses auctioneer for scanning, and will use for posting too, preconfigured stuff i put in the addon

      PS: if you know macros or little LUA scripts that make using AH easier, let us know, we can develop it faster using that.
       
      Last edited: Feb 11, 2010
    15. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      Does anyone remember the macro to make it display the name of the current frame/button/pane your mouse is hovering?
       
    16. mindtrapper

      mindtrapper Member

      Joined:
      Jan 15, 2010
      Messages:
      364
      Likes Received:
      1
      Trophy Points:
      18
      /script DEFAULT_CHAT_FRAME:AddMessage( GetMouseFocus():GetName() );
       
    17. MrBig

      MrBig Member

      Joined:
      Jan 25, 2010
      Messages:
      419
      Likes Received:
      5
      Trophy Points:
      18
      Thanks -=)
       
    18. erenion

      erenion DEVELOPER Buddy Core Dev

      Joined:
      Jan 15, 2010
      Messages:
      321
      Likes Received:
      6
      Trophy Points:
      0
      I've already made one - should be release next week (already done and functional).
       
      Last edited: Feb 11, 2010
    19. morgalis

      morgalis New Member

      Joined:
      Jan 15, 2010
      Messages:
      54
      Likes Received:
      0
      Trophy Points:
      0
      i hope to finish ours before next week , wouldnt be an problem... it is just for fun.
      i have one working too but as stand-alone. need just to port it.
       
    20. bambi_1978

      bambi_1978 Member

      Joined:
      Jan 15, 2010
      Messages:
      325
      Likes Received:
      0
      Trophy Points:
      16
      This will be a great plugin if you can get it up and running :)
       

    Share This Page