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