try
using System.Windows.Forms;
using robotManager.Helpful;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
public class Main : wManager.Plugin.IPlugin
{
public void Initialize()
{
var badCorpsePos = new Vector3(-3362.286f, 4665.728f, -22.70619f);
var enterDungeonPos = new Vector3(-3362.163f, 4636.226f, -101.049f);
Logging.Write("[EnterCorpse] Started.");
wManager.Events.OthersEvents.OnPathFinderFindPathResult += (from, to, path, mpq, success) =>
{
if (ObjectManager.Me.IsDead && to.DistanceTo(badCorpsePos) < 10)
{
path.Clear();
path.AddRange(PathFinder.FindPath(enterDungeonPos));
}
};
}
public void Dispose()
{
Logging.Write("[EnterCorpse] Disposed.");
}
public void Settings()
{
MessageBox.Show("??");
}
}
Looking back at this thread today and here is a rough method that I came up with:
public float TargetTimeToDie;
private double damagePerSecond;
private double targetPreviousHealth;
private Timer timerDPS = new robotManager.Helpful.Timer(1000);
private void FightEvents_OnFightLoop(WoWUnit unit, System.ComponentModel.CancelEventArgs cancelable)
{
if (timerDPS.IsReady)
{
if (ObjectManager.Target.Health < targetPreviousHealth)
{
//How much damage was done since the last second
//Helpers.LogDebug($"targetCurrentHealth({ObjectManager.Target.Health}) - previousHealth({previousHealth})");
damagePerSecond = System.Math.Abs(targetPreviousHealth - ObjectManager.Target.Health);
TargetTimeToDie = (float)System.Math.Round(ObjectManager.Target.Health/ damagePerSecond, 1);
Helpers.LogDebug($"Target will die in ~{TargetTimeToDie} second(s).");
}
targetPreviousHealth = ObjectManager.Target.Health;
}
}
Usage (Maybe you do not want to use large cooldowns on the target if they will die in such time. Or do not place totems, etc..):
if (TargetTimeToDie < 10.0f) return;
Hi, good job. To draw on map you need to use https://wrobot.eu/byme/doc/html/F-wManager.Wow.Forms.UserControlMiniMap.LandmarksMiniMap.htm (it will also draw on 3d radar)
That's normal behaviour.
If you want to control the life cycle of a thread you have created, you need to keep track of it by assigning it to a variable. This way you can start it in Initialize() and then Stop it in Dispose()
// Define the thread and assign it to a variable
Thread myThread = new Thread(() => { });
// Start the thread
myThread.Start();
// Stop the thread
myThread.Abort();
Hello, you can try to read log:
robotManager.Events.LoggingEvents.OnAddLog += delegate(Logging.Log log)
{
if (!string.IsNullOrWhiteSpace(log.Text) && log.Text.StartsWith("[FlightMaster] Try to take taxi at "))
{
// ...
}
};
Hi, I am trying to make a plugin for a relogger that will change account data depending on the conditions. I am facing a problem.
System.Threading.Tasks.Task.Factory.StartNew(() =>
{
for (int i = 0; i < Relogger.Classes.ReloggerGeneralSettings.CurrentSetting.Profiles.Count; i++)
{
try
{
var p = Relogger.Classes.ReloggerGeneralSettings.CurrentSetting.Profiles[i];
if (p.Checked && p.Name.ToLower().Contains("myaccountname"))
{
robotManager.Helpful.Logging.Write("124");
p.CurrentWowAccount.AccountName = "1242";
p.CurrentWowAccount.Password = "1242";
}
}
catch (Exception e)
{
robotManager.Helpful.Logging.WriteError(Name + " > " + e);
}
}
});
When trying to read or change the field CurrentWowAccount.AccountName or CurrentWowAccount.Password I get the error:
[E] 22:26:06 - CHANGEKEY > System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта.
в MyNamespace.MyPlugin.b__0()
Is it possible to implement changing account data through a plugin or is this error a consequence of data protection?
You can try to host http server in relogger (with relogger plugin) (you can get/return values (or xml) from it.
It's sample of http server, but for wrobot plugin :
using System.Net;
using System.Text;
using System.Threading.Tasks;
using robotManager.Helpful;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
public class Main : wManager.Plugin.IPlugin
{
/*
Samples:
http://localhost:8000/name
http://localhost:8000/jump
http://localhost:8000/pos
http://localhost:8000/runlua?code=print(%22test%20from%20web%22)
*/
private readonly bool _debugLog = true;
private HttpListener _listener;
private readonly string _url = "http://localhost:8000/";
private int _requestCount;
private bool _runServer;
public void Initialize()
{
// Create a Http server and start listening for incoming connections
_listener = new HttpListener();
_listener.Prefixes.Add(_url);
_listener.Start();
if (_debugLog)
Logging.WriteDebug("Listening for connections on " + _url);
// Handle requests
var listenTask = HandleIncomingConnections();
listenTask.GetAwaiter().GetResult();
}
public void Dispose()
{
if (_listener != null)
{
_runServer = false;
_listener.Close();
_listener = null;
}
}
public void Settings()
{
}
private async Task HandleIncomingConnections()
{
_runServer = true;
// While a user hasn't visited the `shutdown` url, keep on handling requests
while (_runServer)
{
// Will wait here until we hear from a connection
var ctx = await _listener.GetContextAsync();
// Peel out the requests and response objects
var req = ctx.Request;
var resp = ctx.Response;
// Print out some info about the request
if (_debugLog)
{
Logging.WriteDebug("Request #: " + ++_requestCount);
Logging.WriteDebug(req.Url.ToString());
Logging.WriteDebug(req.HttpMethod);
Logging.WriteDebug(req.UserHostName);
Logging.WriteDebug(req.UserAgent);
Logging.WriteDebug(req.Url.AbsolutePath);
}
var content = string.Empty;
// Parse
if (req.Url.AbsolutePath == "/name")
{
content = ObjectManager.Me.Name;
}
else if (req.Url.AbsolutePath == "/jump")
{
Move.JumpOrAscend();
content = "done";
}
else if (req.Url.AbsolutePath == "/pos")
{
content = ObjectManager.Me.Position.ToStringXml();
}
else if (req.Url.AbsolutePath.StartsWith("/runlua"))
{
//var r = System.Web.HttpUtility.ParseQueryString(req.Url.Query).Get("code");
var r = req.QueryString["code"];
if (!string.IsNullOrWhiteSpace(r))
{
Lua.LuaDoString(r);
content = "ok";
}
else
content = "failed";
}
// Write the response info
byte[] data = Encoding.UTF8.GetBytes(content);
resp.ContentType = "text/html";
resp.ContentEncoding = Encoding.UTF8;
resp.ContentLength64 = data.LongLength;
// Write out to the response stream (asynchronously), then close it
await resp.OutputStream.WriteAsync(data, 0, data.Length);
resp.Close();
}
}
}
Hi everyone, I have a question, how better to change the fight class... When I use the next code
if(ObjectManager.Me.WowClass == WoWClass.Paladin)
{
wManager.wManagerSetting.CurrentSetting.CustomClass = "ret_pal.cs";
}
CustomClass.DisposeCustomClass();
Thread.Sleep(2000);
CustomClass.LoadCustomClass();
Sometimes the fiteclass for some reason does not load, can someone tell me another way without bugs?
And I would also like to understand what the CustomClass.ResetCustomClass() method does?
Hello, use quest type "OverridePulseCSharpCode" with code:
Vector3 fishPosition = new Vector3(-9387.61, -120.2896, 58.53797, "Flying");
float fishRotation = 4;
if (!FishingTask.IsLaunched)
{
if (GoToTask.ToPosition(fishPosition, 1.5f))
{
ObjectManager.Me.Rotation = fishRotation;
FishingTask.LoopFish();
}
}
return true;
(replace "-9387.61, -120.2896, 58.53797" by fishing position and 4 by fishing rotation (you can get position and rotation in WRobot tab "Tools" > "Dev... tools" > "Me/Target Position"))
Don't forget to stop fishing, for it, after pulse fishing quest, in quests order add step type "RunCode" with code:
wManager.Wow.Bot.Tasks.FishingTask.StopLoopFish();
Sample profile: FishingTest.xml
So this is my new updated version.
Add everything in this code box to a Notepad++ ffile or in Visual Studio. and done! Hope you guys benefit from it all.
I used // Comments to add important information so, be sure to check it out.
I hope this helps!
With the release of my new HORDE REMAKE
I have decided to release ALL of my codes i have made over time, all the codes i have found by other users, modified, edited, you name it.
With this any new profile creator should have all the tools necessary to begin writing a script!!
// TBC USe Item On Dead Mob ( Make Interact Quest Helper (dead mobs checked)
wManager.Events.InteractEvents.OnInteractPulse += (target, cancelable) =>
{
var t = wManager.Wow.ObjectManager.ObjectManager.GetObjectByGuid(target);
if (!t.IsValid)
return;
var e = t.Entry;
if (e == 21859 || e == 21846)
{
System.Threading.Tasks.Task.Run(delegate {
System.Threading.Thread.Sleep(wManager.Wow.Helpers.Usefuls.Latency + 100);
wManager.Wow.Helpers.ClickOnTerrain.Item(31769, t.Position);
});
}
};
_____________________________________________________________________________________________________________________________________
// RunCode - Interact with ObjectID - Gather Object RunCode FNV
var pos = new Vector3(199.9151f, 3472.976f, 63.24443f);
int objectId = 184115 ;
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(pos, objectId);
Thread.Sleep(Usefuls.Latency + 10000);
if(ItemsManager.GetItemCountById(23339) < 1)
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(pos, objectId);
Thread.Sleep(Usefuls.Latency + 10000);
}
_____________________________________________________________________________________________________________________________________
// Interact with game object RunCode (Not by me) - https://wrobot.eu/forums/topic/11371-game-object/?tab=comments#comment-54611
var Object = ObjectManager.GetNearestWoWGameObject(ObjectManager.GetWoWGameObjectByEntry(1234));
// or var Object = ObjectManager.GetObjectWoWGameObject().Where(o => o.IsValid && o.Entry == 1234).OrderBy(o => o.GetDistance).FirstOrDefault();
if (GoToTask.ToPosition(new Vector3(1, 2, 3, "None"))) // replace "flying" with "None" to ground move
{
if (Object != null)
{
Interact.InteractGameObject(Object.GetBaseAddress);
Usefuls.WaitIsCasting();
}
}
_____________________________________________________________________________________________________________________________________
// Droidz Code from "Code Snipets - Use Item on Hostile or Weakend Mob"
// Add step type "PickUp" (put quest name in parameter)
// Add step type "RunCode", in parameter put this code:
Thread t = new Thread(() =>
{
uint itemId = 62899;
int questId = 28000;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (!Quest.HasQuest(questId))
break;
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 25)
{
ItemsManager.UseItem(itemId);
}
}
Thread.Sleep(500);
}
});
t.Start();
//(you need to have quest in your questlog, you can replace "62899" but the item id, "28000" by the quest id and "25" by the max target health)
//Add step type "Pulse" (put quest name in parameter) (use quest type kill or interact)
//Add step type "TurnIn" (put quest name in parameter)
_____________________________________________________________________________________________________________________________________
// Use item on Hostile or Weakend Mob -- VERSIOn 2.0 (Channeling Version)
// Use item on Weakend Mob - Have quest + item ID) (Use Kill and Loot, or Interact with NPC..) - Channeling Version - if you need to channel the Item on the
// mob This is a crazy fucking code but it worked great.
// RunCode - Andoido.
Thread t = new Thread(() =>
{
uint itemId = 6436;
int questId = 1435;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (!Quest.HasQuest(questId))
break;
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 35 )
{
Fight.StopFight();
System.Threading.Thread.Sleep(100);
ItemsManager.UseItem(itemId);
Usefuls.WaitIsCasting();
}
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 35 )
{
ItemsManager.UseItem(itemId);
Usefuls.WaitIsCastingAndLooting();
ItemsManager.UseItem(itemId);
}
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 35 )
{
ItemsManager.UseItem(itemId);
Usefuls.WaitIsCastingAndLooting();
ItemsManager.UseItem(itemId);
ItemsManager.UseItem(itemId);
}
}
Thread.Sleep(200);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// has quest, and has item go gather, harvest, useitem
Thread t = new Thread(() =>
{
uint itemId = 62899;
int questId = 28000;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (!Quest.HasQuest(questId))
break;
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 25)
{
ItemsManager.UseItem(itemId);
wManager.wManagerSetting.CurrentSetting.ListHarvest.Add(183933);
}
}
Thread.Sleep(500);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Has Quest go Harvest
Thread t = new Thread(() =>
{
int questId = 28000;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (!Quest.HasQuest(questId))
break;
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 25)
{
wManager.wManagerSetting.CurrentSetting.ListHarvest.Add(183933);
}
}
Thread.Sleep(500);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// BOP Pickup BOP Items non loop, loot bop, no loop - RunCode - me
Thread t = new Thread(() =>
{
uint itemId = 16305;
int questId = 2;
while (robotManager.Products.Products.IsStarted && ItemsManager.GetItemCountById(16305) == 0)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsDead)
{
Lua.LuaDoString("StaticPopup1Button1:Click();");
}
}
Thread.Sleep(100);
}
});
t.Start();
// Part 2 - 2ndary Version - BOP Pickup Items -itemId + questID - Doesnt Have Quest and Item ID == 0 - RuNCode - ME
Thread t = new Thread(() =>
{
uint itemId = 16305;
int questId = 2;
while (robotManager.Products.Products.IsStarted && (itemId == 0) && !Quest.HasQuest(questId))
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsDead)
{
Lua.LuaDoString("StaticPopup1Button1:Click();");
}
}
Thread.Sleep(100);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Auto Delete items from inventory as you farm (requires delete Custom Script in this post..) - Add any item! Every 10 Seconds, it will Auto Delete - When farming, delte thoes pesky, non
// valuable items that piss you off. Best combined with opening Clams (delete the zesty meat!)
// Auto use Scrolls once looted - RunCode
// Mass throw away, mass delete
Thread t = new Thread(() =>
{
uint itemId = 7974;
while (robotManager.Products.Products.IsStarted && (itemId >= 0))
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive)
{
throwAway.DeleteItems("Zesty Clam Meat", 0);
throwAway.DeleteItems("Zesty", 0);
throwAway.DeleteItems("Raw Spinefin Halibut", 0);
throwAway.DeleteItems("Halibut", 0)
throwAway.DeleteItems("Halibut", 0);
throwAway.DeleteItems("Morning Glory Dew", 0);
}
}
Thread.Sleep(10000);
}
});
t.Start();
// Mass Delete Version 2 - Multiple Items, Mass throw away - RunCode - Andoido
Thread t = new Thread(() =>
{
uint itemId = 7974;
uint itemId1 = 4602;
uint itemId2 = 3927;
uint itemId3 = 4601;
uint itemId4 = 4599;
uint itemId5 = 4608;
uint itemId6 = 1645;
uint itemId7 = 8167;
while (robotManager.Products.Products.IsStarted && Quest.HasQuest(2980) && (itemId >= 0 || itemId2 >= 0 || itemId3 >= 0 || itemId4 >= 0 || itemId5 >= 0 || itemId6 >= 0 || itemId7 >= 0))
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive)
{
throwAway.DeleteItems("Zesty Clam Meat", 0);
throwAway.DeleteItems("Zesty", 0);
throwAway.DeleteItems("Raw Spinefin Halibut", 0);
throwAway.DeleteItems("Halibut", 0);
throwAway.DeleteItems("Moon Harvest Pumpkin", 0);
throwAway.DeleteItems("Morning Glory Dew", 0);
throwAway.DeleteItems("Fine Aged Cheddar", 0);
throwAway.DeleteItems("Soft Banana Bread", 0);
throwAway.DeleteItems("Cured Ham Steak", 0);
throwAway.DeleteItems("Raw Black Truffle", 0);
throwAway.DeleteItems("Moonberry Juice", 0);
throwAway.DeleteItems("Turtle Scale", 0);
}
}
Thread.Sleep(10000);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Use item thread (Continuous) - Use Scrolls - Set a timmmer (60 minutes, and it will cast an elixir, etc etc.) make an IF statment, then RUNCODE, then pulse your grind, then ENDIF - RUNCODE - Andoido
Thread t = new Thread(() =>
{
uint itemId = 4425;
uint itemId2 = 4419;
uint itemId3 = 4421;
uint itemId4 = 4424;
uint itemId5 = 4422;
uint itemId6 = 4426;
while (robotManager.Products.Products.IsStarted && (itemId >= 0 || itemId2 >= 0 || itemId3 >= 0 || itemId4 >= 0 || itemId5 >= 0))
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive)
{
ItemsManager.UseItem(itemId);
ItemsManager.UseItem(itemId2);
ItemsManager.UseItem(itemId3);
ItemsManager.UseItem(itemId4);
ItemsManager.UseItem(itemId5);
}
}
Thread.Sleep(5000);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Go to specific location, and Useitem on Object and Harvest + Quest required (RunCode) - me
var pos = new Vector3(-2496.714f, -1632.943f, 91.73521f);
uint itemId = 15710;
int objectId = 177644;
int questId = 6002;
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(pos, objectId);
Thread.Sleep(Usefuls.Latency + 10000);
if (Quest.HasQuest(questId))
{
ItemsManager.UseItem(itemId);
wManager.wManagerSetting.CurrentSetting.ListHarvest.Add(177644);
}
var pos = new Vector3(-2496.714f, -1632.943f, 91.73521f);
uint itemId = 15710;
int objectId = 177644;
int questId = 6002;
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(pos, objectId);
Thread.Sleep(Usefuls.Latency + 5000);
if (Quest.HasQuest(questId))
{
ItemsManager.UseItem(itemId);
}
_____________________________________________________________________________________________________________________________________
// RunCode - If has item, use item - Helboar Quest TBC
int questId = 9361;
if (wManager.Wow.Helpers.Quest.HasQuest(questId))
{
wManager.Events.LootingEvents.OnLootSuccessful += unit =>
{
if (wManager.Wow.Helpers.Quest.HasQuest(questId))
{
if (wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStarted &&
!wManager.Wow.Helpers.Conditions.IsAttackedAndCannotIgnore)
{
if (wManager.Wow.Helpers.ItemsManager.GetItemCountById(23248) > 0) // Purified Helboar Meat
{
wManager.Wow.Helpers.ItemsManager.UseItem(23268); // Purification Mixture
wManager.Wow.Helpers.Usefuls.WaitIsCasting();
}
}
}
};
}
_____________________________________________________________________________________________________________________________________
// Go to Specific Position and Target NPC - UseItem at/on the location - Runcode - Andoido
var position = new Vector3(7848.3f, -2216.35f, 470.8041f);
int npcEntryId = 11832;
uint itemId = 15877;
{
if (!Quest.IsObjectiveComplete(1, 28))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId);
wManager.Wow.Helpers.ItemsManager.UseItem(15877);
wManager.Wow.Helpers.Usefuls.WaitIsCasting();
}
}
_____________________________________________________________________________________________________________________________________
// Go to Location, Target NPC , Turn Quest In. RunCode --- Manually Complete Quest - force complete, forcecomplete, Runcode
if (Quest.GetQuestCompleted(3561))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(3777.06f, -4619.17f, 227.3226f));
}
var u = ObjectManager.GetNearestWoWUnit(ObjectManager.GetWoWUnitByEntry(8399));
if (u.IsValid)
{
Interact.InteractGameObject(u.GetBaseAddress);
Lua.LuaDoString("QuestFrameCompleteQuestButton:Click();");
}
_____________________________________________________________________________________________________________________________________
// Cast spell on target
Thread t = new Thread(() =>
{
uint itemId = 62899;
uint spellId = 62899;
int questId = 28000;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (!Quest.HasQuest(questId))
break;
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive)
{
if (itemId > 0)
ItemsManager.UseItem(itemId); // if it is item
if (spellId > 0)
SpellManager.CastSpellByIdLUA(spellId); // if it is spell
ClickOnTerrain.Pulse(new Vector3(ObjectManager.Target.Position)); // for AOE spell/item
}
}
Thread.Sleep(500);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Stop fight at specific perceent, StopFight - make "Interact with npc" Quest Profile, and run this code before it!
Thread t = new Thread(() =>
{
int questId = 9889;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (!Quest.HasQuest(questId))
break;
if (ObjectManager.Target.IsAlive && ObjectManager.Target.HealthPercent <= 30)
{
wManager.Wow.Helpers.Fight.StopFight();
}
}
Thread.Sleep(500);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// UseItem - DOESNT have Quest, and DOESNT have Buff - Use item if we dont have buff (RunCode) - before you "pulse"
Thread t = new Thread(() =>
{
uint itemId = 62899;
int questId = 93351;
uint buffId = 135855;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (!Quest.HasQuest(questId))
break;
if (!ObjectManager.Me.HaveBuff(buffId))
{
ItemsManager.UseItem(itemId);
}
}
Thread.Sleep(500);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Check objective, go to location. If Objective NOT complete go to goto location
if (!Quest.IsObjectiveComplete(2, 9999))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(9999.262f, -9999.587f, 999.8167f));
}
_____________________________________________________________________________________________________________________________________
// Click BOP Item - BOP Continuous Loop - RuNCode
Thread t = new Thread(() =>
{
uint itemId = 9618;
int questId = 25336;
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsDead)
{
Lua.LuaDoString("StaticPopup1Button1:Click();");
}
}
Thread.Sleep(100);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Force character to MOVE strafe if you get a debuff or buff - runcode
wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) =>
{
var me = wManager.Wow.ObjectManager.ObjectManager.Me;
var target = wManager.Wow.ObjectManager.ObjectManager.Target;
if (me.IsAlive && target.IsAlive && !me.IsCast && me.HaveBuff("Buff name"))
{
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.STRAFELEFT, 1000 * 3); // strage left during 3 secondes
}
};
// You can force the bot to move to a new position , by replacing presskey
wManager.Wow.Helpers.MovementManager.MoveTo(1, 2, 3);
_____________________________________________________________________________________________________________________________________
// use as overridepulse with complete condition.
// Force check iscomplete for quests.
// Force turn in, force turnin , force pickup, force accept queest, acceptquest.
if (!Quest.HasQuest(Quest ID) && !(ObjectManager.Me.Position.DistanceTo2D(new Vector3(x, y, z)) < 20))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(x, y, z));
wManager.Wow.Helpers.Interact.InteractGameObject(ObjectManager.GetWoWGameObjectByEntry(Object ID).FirstOrDefault().GetBaseAddress);
Thread.sleep(100);
wManager.Wow.Helpers.Lua.RunMacroText("/script AcceptQuest();");
}
return;
// complete condition :
return (Quest.HasQuest(Quest ID) && !Quest.GetQuestCompleted(Quest ID));
// turn in code
wManager.Wow.Helpers.Lua.RunMacroText("/click QuestFrameCompleteQuestButton");
_____________________________________________________________________________________________________________________________________
// Force pickup of quest - Runcode
int npcEntryId = 4961;
var position = new Vector3(-8681.93f, 432.901f, 99.0906f);
if(!Quest.HasQuest(1247) && !Quest.GetQuestCompleted(1247))
{
while(!Quest.HasQuest(1247))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(position, npcEntryId);
Thread.Sleep(Usefuls.Latency * 5);
Lua.LuaDoString("AcceptQuest()");
Thread.Sleep(Usefuls.Latency * 5);
}
}
_____________________________________________________________________________________________________________________________________
// RunCode - Used to check an items cooldown remaining time - by droidz - https://wrobot.eu/bugtracker/useitemon-doesnt-work-because-of-item-cooldown-r594/
robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
{
int itemId = 18904;
int questId = 7003;
if (!wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
return;
if (wManager.Wow.Helpers.Conditions.IsAttackedAndCannotIgnore)
return;
if (state.DisplayName == "Quester")
{
if (wManager.Wow.Helpers.Quest.HasQuest(questId) &&
wManager.Wow.Helpers.Lua.LuaDoString<bool>("local start, duration, enable = GetItemCooldown("+ itemId + "); return enable;"))
{
cancelable.Cancel = true;
}
}
};
_____________________________________________________________________________________________________________________________________
// How to let this code run once and how to let it move to a position xyz? - by imod
// Position we want to move to
Vector3 position = new Vector3(1, 1, 1);
// Move to the given position
MovementManager.Go(PathFinder.FindPath(position), false);
// Wait
while (MovementManager.InMovement && Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && ObjectManager.Me.HaveBuff(new Spell("NameOfTheSpell").Ids)
{
// Wait follow path
Thread.Sleep(100);
}
// Another example of moving your character to a new position during fight or getting debuff
wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) =>
{
var pos = 1;
var me = wManager.Wow.ObjectManager.ObjectManager.Me;
var target = wManager.Wow.ObjectManager.ObjectManager.Target;
if (me.IsAlive && target.IsAlive && pos == 1)
{
Vector3 position = new Vector3(3073.848f, -3116.693f, 294.0692f);
// Move to the given position
MovementManager.Go(PathFinder.FindPath(position), false);
// Wait
while (MovementManager.InMovement && Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
// Wait follow path
Thread.Sleep(3000);
pos = 0;
}
}
};
_____________________________________________________________________________________________________________________________________
// Keep from Drowning - Swimming, Drowning, JUMP, Breath, - Runcode -- Change "while" statment to whatever the quest demands (objective wise)
Thread t = new Thread(() =>
{
while (robotManager.Products.Products.IsStarted && ItemsManager.GetItemCountById(15874) != 10)
{
if (ObjectManager.Me.BreathTimerLeft < 10000)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP);
}
wManager.Wow.Helpers.Fight.StopFight();
}
Thread.Sleep(10000);
}
});
t.Start();
_____________________________________________________________________________________________________________________________________
// Under Water Holding Breath - Swimming - fatigue - make into runcode
if (isneedActionbecausebreath())
{
robotManager.Helpful.Keyboard.PressKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle," ");
}
internal bool isneedActionbecausebreath()
{
if (ObjectManager.Me.BreathActive)
{
Logging.WriteFight("isneedActionbecausebreath: "+ObjectManager.Me.BreathTimerLeft);
if (ObjectManager.Me.BreathTimerLeft < 10000)
{
return true;
}
}
return false;
}
// force bot to click Space button
robotManager.Helpful.Keyboard.PressKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.F1);
_____________________________________________________________________________________________________________________________________
// Swimming code
wManager.Events.MovementEvents.OnMoveToLoop += () =>
{
if (wManager.Wow.ObjectManager.ObjectManager.Me.IsSwimming)
wManager.wManagerSetting.CurrentSetting.UseCTM = true;
else
wManager.wManagerSetting.CurrentSetting.UseCTM = false;
};
// Hunter Tame Pet FNV - OverridePulseCSharpCode
// is complete -- (not required in quest log)
return ObjectManager.Pet.IsValid;
var pos = new Vector3(-5421f, -581f, 396f);
int npc = 1126;
if(!ObjectManager.Pet.IsValid)
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(pos);
wManager.wManagerSetting.CurrentSetting.MaxUnitsNear = 100;
var target = ObjectManager.GetObjectWoWUnit().FirstOrDefault(o => o.Entry == npc && o.Position.DistanceTo(ObjectManager.Me.Position) < 50 && o.IsAlive);
if(target != null && target.IsAlive)
{
ObjectManager.Me.Target = target.Guid;
if(ObjectManager.Me.Position.DistanceTo(target.Position) >= 30)
MovementManager.MoveTo(target.Position);
Thread.Sleep(Usefuls.Latency + 250);
SpellManager.CastSpellByNameLUA("Tame Beast");
}
if(ObjectManager.Pet.IsValid)
return true;
}
else
{
return true;
}
return false;
_____________________________________________________________________________________________________________________________________
// Schakas Use Script On - TBC Gathering items (New Life Q example)
ItemsManager.UseItem(22955);
Thread.Sleep(1000);
Interact.InteractGameObject(ObjectManager.GetWoWGameObjectByEntry(181433).First().GetBaseAddress);
Usefuls.WaitIsCastingAndLooting();
// Schakas Use Script On - For NPC's (didnt work for me)
ItemsManager.UseItem(22955);
Thread.Sleep(1000);
Interact.InteractGameObject(ObjectManager.GetWoWUnitByEntry(123, true).First().GetBaseAddress);
Usefuls.WaitIsCastingAndLooting();
_____________________________________________________________________________________________________________________________________
// Use inventory Solot Items
UseInventoryItem( 13 );
UseInventoryItem( 14 );
____________________________________________________________________________________________________________________________________
// Set chat text in game
DEFAULT_CHAT_FRAME:AddMessage("|cFFFFCE2ETramBot|r Zangermarsh Elevator - Go TO and wait")
_____________________________________________________________________________________________________________________________________
// Abandon Remove Quests (RuNCode)
QuestHelper.AbandonQuest("Terokk's Legacy");
_____________________________________________________________________________________________________________________________________
// Has key / Have Key / Key Custom Script - RuNCode
int keyId = 4882;
Logging.Write("Have Key ID (" + keyId + "): " + Key.haveKey(keyId));
_____________________________________________________________________________________________________________________________________
// Is Complete Condition for Items xIsCompletex iscomplete - RunCode
return ItemsManager.GetItemCountById(28513) >= 1;
//is complete - quest compolete or less than x ft - FNV IsComplete
return (Quest.GetQuestCompleted(187) || new Vector3(-11327.88f, -204.1989f, 75.34803f).DistanceTo(ObjectManager.Me.Position) < 10);
// Is Complete Distance to Object, iscomplete, distance - is complete quester code
return ObjectManager.Me.Position.DistanceTo2D(new Vector3(1822.23f, 1416.56f, -7.84571f)) <8;
// If you want complete quest when you don't have item in bag (1234 is item id):
return wManager.Wow.Helpers.ItemsManager.GetItemCountByIdLUA(1234) <= 0;e
// Or if you want complete quest when you have item in bag (1234 is item id):
// (replace 3 by minimun item count)
return wManager.Wow.Helpers.ItemsManager.GetItemCountByIdLUA(1234) >= 3;
// Is Complete Continent Code - iscomplete check continent
return (wManager.Wow.Helpers.Usefuls.ContinentId == (int)wManager.Wow.Enums.ContinentId.Azeroth);
// Is Complete - iscomplete - Dungeon Check - ContinentID
return (wManager.Wow.Helpers.Usefuls.ContinentId == (int)wManager.Wow.Enums.ContinentId.MonasteryInstances);
// Is Complete - Quest Completed, has quest.
return (Quest.HasQuest(1234) && !Quest.GetQuestCompleted(1234));
// Log Writing - Write to the wrobot Log - RunCode
Logging.Write("TEXT HERE");
// Cast spell by name - Cast Spell ID RunLuaCode
CastSpellByName("Renew","target")
// Has item More or Less Than RunCode
ItemsManager.GetItemCountById(11188) < 7
// Does Bot Know Spell - RunCode
!wManager.Wow.Helpers.SpellManager.KnowSpell(688)
// Class Code - ClassCheck - RunCode
ObjectManager.Me.WowClass == WoWClass.Warlock
(ObjectManager.Me.WowClass == WoWClass.Warlock || ObjectManager.Me.WowClass == WoWClass.Paladin || ObjectManager.Me.WowClass == WoWClass.Warrior || ObjectManager.Me.WowClass == WoWClass.Rogue
|| ObjectManager.Me.WowClass == WoWClass.Hunter || ObjectManager.Me.WowClass == WoWClass.Druid || ObjectManager.Me.WowClass == WoWClass.Priest)
// If Has Item xhasitemx- RuNCode
ItemsManager.HasItemById(29912)
// If Statment - hasitem less than , and objective complete, and has quest, and doesnt have quest complete
// RunCode
((Quest.HasQuest(2980)
&&
!Quest.GetQuestCompleted(2980))
&&
(!Quest.IsObjectiveComplete(3, 2980))
&&
(ItemsManager.GetItemCountById(9590) < 7))
-- OR --
// Difference bewteen these two, is this checks for a SPECIFIC item if we have or dont have. Where as the one above, checks for a set Number of items.
// Has Quest, Doesnt Have Quest Completed, Doesnt have Objective for quest completed, Doesnt have ITEM (involved with quest)
// Reccomended to only use this code for quests that use single items (Kill mob for skull, if it was 10 skulls, use the code above!
// RunCode
((Quest.HasQuest(2980)
&&
!Quest.GetQuestCompleted(2980))
&&
(!Quest.IsObjectiveComplete(3, 2980))
&&
(!ItemsManager.HasItemById(29912))
// Use Item (RunCode) -- Used to Use Items in Game.
ItemsManager.UseItem(6948);
wManager.Wow.Helpers.ItemsManager.UseItem(123);
// UseScriptOn - C# - UseItem - Use Item Thread Sleep, Use Item Quester Profile, or RuNCode
ItemsManager.UseItem(1234);
Usefuls.WaitIsCasting();
Thread.Sleep(1000 * 10);
// Has Buff or Doesnt havebuff
ObjectManager.Me.TargetObject.HaveBuff(22807);
// Equip Item By name (runcode)
wManager.Wow.Helpers.ItemsManager.EquipItemByName("Spectrecles");
// Check Player Faction or Race (RunCode)
(ObjectManager.Me.PlayerRace == PlayerFactions.Tauren)
// Check if has item Equiped - weapon Equiped
EquippedItems.GetEquippedItems().Where(x => x.Entry == 2495 || x.Entry == 2488 || x.Entry == 2492 || x.Entry == 2490 || x.Entry == 2509 || x.Entry == 5441 || x.Entry == 2516).Count() == 0
// Check equiped item's rarity (Add to code above)
x.GetItemInfo.ItemRarity <= 1
// Pet is alive and valid - has pet summoned
ObjectManager.Pet.IsAlive && ObjectManager.Pet.IsValid
// Check pet by name (RunCode)
if (ObjectManager.Pet.Name == "Wolf")
return true;
else
return false;
// Is Complete check pet name - not tested
return ObjectManager.Pet.Name == "Wolf"
// Check how much Money we have in bags (RunCode)
ObjectManager.Me.GetMoneyCopper >= 800
// Skillline - Is Complete Condition
return wManager.Wow.Helpers.Skill.GetValue(wManager.Wow.Enums.SkillLine.Lockpicking) >= 75;
Skill.GetValue(SkillLIne.Engineering) < 50
// If Has Quest + If Has Quest Complete RunCode
Quest.HasQuest(10446) && !Quest.GetQuestCompleted(10446)
Quest.HasQuest(10446) && Quest.IsObjectiveComplete(1, 37853)
// CAN CONDITION - Check which continent we are on - Pulse true if we are ON this ContinentId
return Usefuls.ContinentId == (int) ContinentId.Azeroth;
// Check map Zone / Continent / Submap / Sub Continent / zone
/* */
Usefuls.ContinentId == (int) ContinentId.Azeroth
Usefuls.ContinentId == (int) ContinentId.Kalimdor
Usefuls.SubMapZoneName.Contains("theran Village")
(wManager.Wow.Helpers.Usefuls.MapZoneName == "" || wManager.Wow.Helpers.Usefuls.MapZoneName == "")
// Check player race and faction alliance and horde - runcode
ObjectManager.Me.IsAlliance
ObjectManager.Me.IsHorde
// Stop the bot from Moving - StopMoving - RuNCode
if(ObjectManager.Me.GetMove)
MovementManager.StopMoveTo(true, 500);
// Check number of enemies attacking you or attacking pet
ObjectManager.GetWoWUnitAttackables().Where(x => x.Target == ObjectManager.Me.GetBaseAddress || x.Target == ObjectManager.Pet.GetBaseAddress).Count() >= 2
// use spell cast spell on target - Cast spell by id - cast spell by lua RunCode
Hello,you can use lua code:
CastSpellByID(1234)
CastSpellByID(1234, 'target')
or c# code:
wManager.Wow.Helpers.SpellManager.CastSpellByIdLUA(1234);
wManager.Wow.Helpers.SpellManager.CastSpellByIdLUA(1234, "target");
// Target nearest enemy and use spell / use spell on nearest target RunLuaCode
local Sunfire = GetSpellInfo(93402);
if (not Sunfire) then return; end
TargetNearestEnemy();
CastSpellByName(Sunfire);
// cast spell
local spellid=123456 --[[change to the ID-nr of the spell)]]
local spellname=GetSpellInfo(spellid)
if (IsUsableSpell(spellname)) then
local start, duration, enable = GetSpellCooldown(spellname)
if (duration==0) then
CastSpellByName(spellname);
spell=spellname;
break;
end
end
// Target Reactions - Friendly Neutral honored. Checkes the Reaction of the Target in an IF statment.
wManager.Wow.ObjectManager.ObjectManager.Target.Reaction < wManager.Wow.Enums.Reaction.Friendly
// or
wManager.Wow.ObjectManager.ObjectManager.Me.TargetObject.Reaction > Reaction.Neutral
// Reactions IsComplete Statment
return wManager.Wow.ObjectManager.ObjectManager.Me.TargetObject.Reaction > Reaction.Friendly;
// Reactions ORDER
Hated,
Hostile,
Unfriendly,
Neutral,
Friendly,
Honored,
Revered,
Exalted,
_____________________________________________________________________________________________________________________________________
// Force bot to Sit, Force bot to Stand, runcode - Matenia
Lua.LuaDoString("SitOrStand()");
//newer wow versions
Lua.LuaDoString("SitStandOrDescendStart()");
//alternative approach
Lua.LuaDoString("DoEmote('SIT')");
//if you wanna stand up specifically
Lua.LuaDoString("DoEmote('STAND')");
_____________________________________________________________________________________________________________________________________
// Go to specific targets GUID - Spell on Target
var unit = new WoWUnit(ObjectManager.GetObjectByGuid (17379391364021616671).GetBaseAddress);
Fight.StopFight();
ObjectManager.Me.Target = unit.Guid;
Fight.StopFight();
// or
var unit = new WoWUnit(ObjectManager.GetObjectByGuid (17379391364021616671).GetBaseAddress);
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(unit.Position);
_____________________________________________________________________________________________________________________________________
// if you have a quest with a item you need to use on the ground.
if (wManager.Wow.Helpers.ItemsManager.HasItemById(ID))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(z, y, z));
System.Threading.Thread.Sleep(6000);
ItemsManager.UseItem(ItemID);
ClickOnTerrain.Pulse(new Vector3(x, y, z));
System.Threading.Thread.Sleep(1000);
}
return true;
_____________________________________________________________________________________________________________________________________
// Hunter Pet Auto Train - Auto tame hunter pet runcode
if(ObjectManager.Pet.IsValid)
{
Lua.LuaDoString("CastSpellByName('Beast Training')");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("BuyTrainerService(0)");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("TogglePetAutocast(4)");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("TogglePetAutocast(5)");
Thread.Sleep(Usefuls.Latency + 500);
}
_____________________________________________________________________________________________________________________________________
// is complete - Quest Complete condition, Quest log - bettersister
// Check if quest is completed
Quest.GetQuestCompleted(123456)
Quest.GetLogQuestIsComplete(245)
if you're using it as Is Complete condition put it like this:
return Quest.GetLogQuestIsComplete(245);
_____________________________________________________________________________________________________________________________________
// Search and Loot Chests - Find Chests - IMOD - RunCode
//You should not using the index because if there is no chest you will get a out of range exception.
// Search for a chest
List<WoWGameObject> chest = ObjectManager.GetWoWGameObjectByyId(123456).FirstOrDefault();
// Found?
if(chest != null)
{
// Open
Interact.InteractGameObject(chest.GetBaseAddress);
}
_____________________________________________________________________________________________________________________________________
// Click Quest Complete Button - Droidz
//In "Quest order editor" add action "RunCode" after "pulse" with param:
wManager.Wow.Helpers.Quest.CompleteQuest();
You can add wait time to wait then window appear:
Thread.Sleep(3500);
wManager.Wow.Helpers.Quest.CompleteQuest();
_____________________________________________________________________________________________________________________________________
_____________________________________________________________________________________________________________________________________
// Interact with game object and gather
WoWObject _t = ObjectManager.GetWoWGameObjectByName("put here name of herb").OrderBy(o => o.GetDistance).FirstOrDefault();
Interact.InteractGameObject(_t.GetBaseAddress, true, false);
Usefuls.WaitIsCasting();
Usefuls.WaitIsLooting();
// Part 2 - For gathering / mining with bad latency.
WoWObject _t = ObjectManager.GetWoWGameObjectByName("Peacebloom").OrderBy(o => o.GetDistance).FirstOrDefault();
Interact.InteractGameObject(_t.GetBaseAddress, true, false);
Usefuls.WaitIsCasting();
Usefuls.WaitIsLooting();
// wManager.DevelopmentTools.OutPutCSharp=
// Execute time: 703
// Part 3
WoWObject _t = ObjectManager.GetWoWGameObjectByName("Peacebloom").OrderBy(o => o.GetDistance).FirstOrDefault();
Interact.InteractGameObject(_t.GetBaseAddress, true, false);
// this code works like Usefuls.WaitIsCasting();
robotManager.Helpful.Timer timer = new robotManager.Helpful.Timer((double)(Usefuls.Latency + 200));
while (!timer.IsReady && !ObjectManager.Me.IsCast) {
Thread.Sleep(5);
}
Logging.Write("Me.IsCast="+ObjectManager.Me.IsCast);
while (ObjectManager.Me.IsCast) {
Thread.Sleep(30);
}
Usefuls.WaitIsLooting();
Move.JumpOrAscend();
// wManager.DevelopmentTools.OutPutCSharp=
// Execute time: 1438
_____________________________________________________________________________________________________________________________________
// Go to Position - Run to position - Run to spot
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(-304.4424f, 2389.106f, 46.37655f));
// Interact with NPC (RuNCode)
// NORMAL - Interact with NPC
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(-1831.95f, 5298.3f, -12.42768f), 18940);
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(-2917.88f, 4021.48f, 0.4276921f), 19296, 1, false);
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(3373.69f, 994.351f, 5.278372f), 11901, 2, false);
// Interact with OBJECT in Game
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(new Vector3(2552.44, 856.9836, 51.49502), 148917);
// Interact With Game Object V2
wManager.Wow.Helpers.Interact.InteractGameObject(wManager.Wow.ObjectManager.ObjectManager.GetNearestWoWGameObject
(wManager.Wow.ObjectManager.ObjectManager.GetWoWGameObjectByEntry(254241)).GetBaseAddress);
// Interact with DEAD NPC (runcode)
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(-2917.88f, 4021.48f, 0.4276921f), 19296, 1);
// ]Distance - Distance from xdistance -
ObjectManager.Me.Position.DistanceTo2D(new Vector3(199.061f, 4238.42f, 121.7268f)) < 125
__________________________________________________________________________________________________________________________________
// level 5 priest quest - cast spell on target - run code
if (Quest.HasQuest(5648))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(170.596f, -4769.92f, 14.40446f), 12430);
wManager.Wow.Helpers.Lua.RunMacroText("/cast Lesser Heal");
Usefuls.WaitIsCastingAndLooting();
wManager.Wow.Helpers.Lua.RunMacroText("/cast Power Word: Fortitude");
Usefuls.WaitIsCastingAndLooting();
}
return true;
__________________________________________________________________________________________________________________________________
// Interact with Game Object V3 (use quest profile and overidepulse... quest type) https://wrobot.eu/forums/topic/9846-spam-click-specific-object/
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !Conditions.IsAttackedAndCannotIgnore)
{
var o = wManager.Wow.ObjectManager.ObjectManager.GetNearestWoWGameObject(wManager.Wow.ObjectManager.ObjectManager.GetWoWGameObjectByEntry(218889));
if (!o.IsValid)
break;
wManager.Wow.Helpers.Interact.InteractGameObject(o.GetBaseAddress);
Thread.Sleep(100);
}
// Interact with NPC - Talk to NPC (RunCode) - use with GONG / Andoido (One after another) - by Nudl
WoWUnit toTalk =
wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWUnit()
.SingleOrDefault(i => i.Entry == 75746);
if (toTalk != null)
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(toTalk.Position, toTalk.Entry, 1);
}
// Interact with Game Object (RunCode) https://wrobot.eu/forums/topic/8395-clicking-objects-in-dungeons/
WoWGameObject gong = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWGameObject().FirstOrDefault(i => i.Entry == 148917);
if (gong != null)
{
wManager.Wow.Helpers.Interact.InteractGameObject(gong.GetBaseAddress);
}
WoWGameObject andoido = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWGameObject().FirstOrDefault(i => i.Entry == 148917);
if (andoido != null)
{
wManager.Wow.Helpers.Interact.InteractGameObject(andoido.GetBaseAddress);
}
// Interact with Object -- Search for nearest Game Object and Interact
WoWGameObject gong = ObjectManager.GetNearestWoWGameObject(ObjectManager.GetWoWGameObjectById("1234")).GetBaseAddress
if (gong != null)
{
wManager.Wow.Helpers.Interact.InteractGameObject(gong.GetBaseAddress);
}
__________________________________________________________________________________________________________________________________
// Harvest Item - Used to "Pickup, Gather, or GET a Quest item, Herb, Ore anything really ( RunCode)
wManager.wManagerSetting.CurrentSetting.ListHarvest.Add();
__________________________________________________________________________________________________________________________________
// Move Backward (RunCode)
wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey,2000);
// Move Forward (RunCode)
wManager.Wow.Helpers.Move.Forward(Move.MoveAction.PressKey,2000);
__________________________________________________________________________________________________________________________________
// Display Code for my on screen display ( RunLuaCode )
MyFrame.text:SetText("TEXT HERE")
__________________________________________________________________________________________________________________________________
// Is Complete condition for KILLING a MOB
// with the id of the boss dont forget to select "true" in "not required in quest log"
return ObjectManager.GetWoWUnitByEntry(16151).Count == 0;
__________________________________________________________________________________________________________________________________
// Is Quest Objective Complete (If, While, Runcode)
Quest.IsObjectiveComplete(1, 37853)
Quest.IsObjectiveNotComplete(0, 245)
// Replace 1 with the objective number in correct list order
__________________________________________________________________________________________________________________________________
// Change Wrobots Current Settings (RuNCode)
wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = false;
wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = true;
wManager.wManagerSetting.CurrentSetting.AttackBeforeBeingAttacked = true;
wManager.wManagerSetting.CurrentSetting.CanAttackUnitsAlreadyInFight = true;
wManager.wManagerSetting.CurrentSetting.IgnoreCombatWithPet = false;
// Force bot to sell vendor - run to town (runcode) Force Sell, Sell Items Force to Town
wManager.Wow.Bot.States.ToTown.ForceToTown = true;
wManager.Wow.Bot.States.ToTown.ForceToTown = true;
wManager.wManagerSetting.CurrentSetting.Selling = true;
wManager.wManagerSetting.CurrentSetting.SellGray = true;
wManager.wManagerSetting.CurrentSetting.ForceSellList.Add("Item name at force to sell");
// Use only profile NPCs
wManager.Wow.Helpers.NpcDB.AcceptOnlyProfileNpc = true;
// Clear blacklist for session
wManager.wManagerSetting.ClearBlacklistOfCurrentProductSession();
// Force bot to sell at closest saved npc
if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWith(Npc npc, bool skipIfCannotMakePath = false, BooleanDelegate conditionExit = null, bool acceptNpcDead = false))
{
wManager.Wow.Helpers.Vendor.SellItems(List<String> itemSell, List<string> itemNoSell, List<Enums.WoWItemQuality> itemQuality);
}
// Force bot to SELL then go TRAIN
wManager.Wow.Bot.States.ToTown.ForceToTown = true; // run code - Forces bot to go sell.
new wManager.Wow.Bot.States.Trainers().NeedToRun // RunCode - Checks if the bot needs to train or not.
// Forces for to Sell AND Train.
robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
{
if (state != null && state.GetType() == typeof(wManager.Wow.Bot.States.Trainers) && state.NeedToRun)
{
wManager.Wow.Bot.States.ToTown.ForceToTown = true;
}
};
// Clears the NPC Database.
wManager.Wow.Helpers.NpcDB.ListNpc.Clear();
// Check if Resting or Rested Exp
Lua.LuaDoString("return IsResting()");
Lua.LuaDoString("return GetRestState() == 1")
__________________________________________________________________________________________________________________________________
// To unblacklist vendor (add you own condition, check if you are in smart pull): - RunCode
robotManager.Events.LoggingEvents.OnAddLog += delegate(Logging.Log log)
{
if (!log.Text.Contains("[ToTown] Unable to reach the vendor, blacklist it 120 minutes (you can disable this NPC in NPC DB tab 'Tools')."))
return;
foreach (var n in NpcDB.ListNpc)
{
n.BlackList(-1);
}
};
__________________________________________________________________________________________________________________________________
// To add vendor with C# you can use this code:
var npcVendor = new wManager.Wow.Class.Npc
{
ContinentId = (wManager.Wow.Enums.ContinentId)wManager.Wow.Helpers.Usefuls.ContinentId,
Entry = 1234,
Faction = wManager.Wow.Class.Npc.FactionType.Neutral,
Name = "Npc name",
Position = new robotManager.Helpful.Vector3(1, 2, 3),
CanFlyTo = true,
Type = wManager.Wow.Class.Npc.NpcType.Repair, // wManager.Wow.Class.Npc.NpcType.Vendor
};
wManager.Wow.Helpers.NpcDB.AddNpc(npcVendor, false);
__________________________________________________________________________________________________________________________________
//(use step "RunCode" to run all code) - By Droidz
// RunCode (make IF statement, add this below it, then the following in a NEW runcode.)
wManager.Wow.Helpers.NpcDB.AcceptOnlyProfileNpc = true;
// It is not easy way, but add NPC with C# code like this (use this code when you change zone to select good npc for current level/zone):
// RunCode - Removes all NPC's in the NPCDB.
wManager.Wow.Helpers.NpcDB.ListNpc.RemoveAll(n => n.CurrentProfileNpc); // Remove in NPCDB all Npc added on current profile
// Setting a "Repair" npc - RunCode
var npcRepair = new wManager.Wow.Class.Npc // Npc repair info
{
Name = "Npc name",
Entry = 1234,
Faction = wManager.Wow.Class.Npc.FactionType.Neutral,
ContinentId = wManager.Wow.Enums.ContinentId.Azeroth,
Position = new robotManager.Helpful.Vector3(1, 2, 3),
CanFlyTo = true,
Type = wManager.Wow.Class.Npc.NpcType.Repair,
};
wManager.Wow.Helpers.NpcDB.AddNpc(npcRepair, false, true); // Add npc repair to npcdb
// Setting a "Vendor" npc.= (food)
var npcVendor = new wManager.Wow.Class.Npc // Npc vendor info
{
Name = "Npc name",
Entry = 1234,
Faction = wManager.Wow.Class.Npc.FactionType.Neutral,
ContinentId = wManager.Wow.Enums.ContinentId.Azeroth,
Position = new robotManager.Helpful.Vector3(1, 2, 3),
CanFlyTo = true,
Type = wManager.Wow.Class.Npc.NpcType.Vendor,
};
wManager.Wow.Helpers.NpcDB.AddNpc(npcVendor, false, true); // Add npc vendor to npcdb
// RunCode - Forces bot to go VENDOR -- If you want force WRobot to go to vendor/repair:
wManager.Wow.Bot.States.ToTown.ForceToTown = true;
__________________________________________________________________________________________________________________________________
// Do Not Sell List (TBC) + Vanilla? - runcode
if (!wManager.wManagerSetting.CurrentSetting.DoNotSellList.Contains(""))
{
wManager.wManagerSetting.CurrentSetting.DoNotSellList.Add("");
}
// Do Not Sell List Vanilla runcode
wManager.wManagerSetting.CurrentSetting.DoNotSellList.Add("Larval Acid");
__________________________________________________________________________________________________________________________________
// Opening Objects (Clams, Boxes, Etc) RunCode - https://wrobot.eu/forums/topic/5684-looting-inventory-item-containing-quest-items/
Thread t = new Thread(() =>
{
while (robotManager.Products.Products.IsStarted)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive)
{
robotManager.Helpful.Keyboard.DownKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
ItemsManager.UseItem(7973);
Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
robotManager.Helpful.Keyboard.UpKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
}
}
Thread.Sleep(10000);
}
});
t.Start();
// open clam untill Item ammount obtained
Thread t = new Thread(() =>
{
while (robotManager.Products.Products.IsStarted && ItemsManager.GetItemCountById(15874) != 10)
{
if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
{
if (ObjectManager.Target.IsValid && ObjectManager.Target.IsAlive)
{
robotManager.Helpful.Keyboard.DownKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
ItemsManager.UseItem(15874);
Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
robotManager.Helpful.Keyboard.UpKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.ShiftKey);
Thread.Sleep(robotManager.Helpful.Others.Random(50, 150));
}
}
Thread.Sleep(1000);
}
});
t.Start();
__________________________________________________________________________________________________________________________________
// Check Bind Location (RunCode)
Lua.LuaDoString<string>("bindlocation = GetBindLocation(); return bindlocation;") == "Allerian Stronghold"
&& ObjectManager.Me.Level >= 65 && ObjectManager.Me.Level <= 67
&& (wManager.Wow.Helpers.Usefuls.MapZoneName == "Shattrath City")
&& Quest.HasQuest(9990)
// Check hearthstone timmer
Lua.LuaDoString<bool>("if GetItemCooldown(Heathstone) == 0 then return true end")
____________________________________________________________________________________________________________________________
// How to set your Hearthstone, te professional way.
// Step 1 - Set IF Statment.
IF > IF code in the quest order editor
Lua.LuaDoString<string>("bindlocation = GetBindLocation(); return bindlocation;") != "Orgrimmar"
// Step 2 - RUNCODE - Change the Location + NPC ID of your new innkeeper (using the helper tools)
var position = new Vector3(1633.99f, -4439.37f, 15.43382f);
int npcEntryId = 6929;
{
if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))
System.Threading.Thread.Sleep(3000 * 2);
Lua.LuaDoString("GossipTitleButton1:Click();");
System.Threading.Thread.Sleep(2000 * 2);
Lua.LuaDoString("StaticPopup1Button1:Click();");
System.Threading.Thread.Sleep(3000 * 2);
Lua.LuaDoString("StaticPopup1Button1:Click();");
Lua.LuaDoString("CloseMerchant()");
System.Threading.Thread.Sleep(3000 * 2);
if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))
System.Threading.Thread.Sleep(3000 * 2);
Lua.LuaDoString("GossipTitleButton2:Click();");
System.Threading.Thread.Sleep(3000 * 2);
Lua.LuaDoString("StaticPopup1Button1:Click();");
System.Threading.Thread.Sleep(3000 * 2);
Lua.LuaDoString("StaticPopup1Button1:Click();");
Lua.LuaDoString("CloseMerchant()");
}
// ENDIF -- Add an ENDIF Statment.
//This will force the bot to run to the npc location, it will do each step every 2 seconds (click the bind option) And a 2nd timeincase the bind is on button 2.
// Weaponsmaster Trainer - train Weapons Master - My Code - Andoido - RuNCode
// RunCode 1
if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new robotManager.Helpful.Vector3(2091.02f, -4826.49f, 24.11062f), 11868))
{
Logging.Write("Training level 10 Warlock Weaponsmaster in Orgrimmar - Please do not stop the bot");
{
Lua.LuaDoString("GossipTitleButton1:Click();");;
Lua.LuaDoString("StaticPopup1Button1:Click();");
System.Threading.Thread.Sleep(2000 * 2);
Lua.LuaDoString("StaticPopup1Button1:Click();");
System.Threading.Thread.Sleep(2000 * 2);
Lua.LuaDoString("StaticPopup1Button1:Click();");
Lua.LuaDoString("StaticPopup1Button1:Click();");
Lua.LuaDoString("StaticPopup1Button1:Click();");
Lua.LuaDoString("StaticPopup1Button1:Click();");
}
}
//RunCode 2 (Add both 1 and 2) to make sure 100% the bot trains)
if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new robotManager.Helpful.Vector3(2091.02f, -4826.49f, 24.11062f), 11868))
{
Logging.Write("Training level 10 Warlock Weaponsmaster in Orgrimmar - Please do not stop the bot - Training Sayoc");
{
wManager.Wow.Helpers.Usefuls.SelectGossipOption(wManager.Wow.Enums.GossipOptionsType.trainer);
wManager.Wow.Helpers.Trainer.TrainingSpell();
System.Threading.Thread.Sleep(1000 * 2);
wManager.Wow.Helpers.Trainer.TrainingSpell();
System.Threading.Thread.Sleep(1000 * 2);
wManager.Wow.Helpers.Trainer.TrainingSpell();
wManager.Wow.Helpers.Trainer.TrainingSpell();
wManager.Wow.Helpers.Trainer.TrainingSpell();
wManager.Wow.Helpers.Trainer.TrainingSpell();
}
}
____________________________________________________________________________________________________________________________
// Weaponsmaster Training - FNV
Vector3 posWeaponSkill = new Vector3(-5039.499, -1201.89, 508.9015);
int npcId = 13084;
if(ObjectManager.Me.GetMoneyCopper >= 5000)
{
Logging.Write("[FNV_Quester]: Going to Ironforge Weapon trainer");
if(!wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(posWeaponSkill, npcId))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(posWeaponSkill, npcId);
}
if(wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(posWeaponSkill, npcId))
{
Usefuls.SelectGossipOption(GossipOptionsType.trainer);
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("BuyTrainerService(0)");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("BuyTrainerService(0)");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("BuyTrainerService(0)");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("BuyTrainerService(0)");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("BuyTrainerService(0)");
}
Logging.Write("[FNV_Quester]: Weapon skills learned");
}
else
{
Logging.Write("[FNV_Quester]: Not enough money to buy Weapon skills, skip it");
}
____________________________________________________________________________________________________________________________
// Add ALL Items in BAG to Do Not Sell List - All Items in Bag
foreach (var woWItem in wManager.Wow.Helpers.Bag.GetBagItem())
{
if (!string.IsNullOrWhiteSpace(woWItem.Name) && !wManager.wManagerSetting.CurrentSetting.DoNotSellList.Contains(woWItem.Name))
wManager.wManagerSetting.CurrentSetting.DoNotSellList.Add(woWItem.Name);
}
// Abandon All Quests In Log
for i=1,GetNumQuestLogEntries() do
SelectQuestLogEntry(i);
SetAbandonQuest();
AbandonQuest();
end
// Abandon Quest by IDictionary
local questId = 12345;
for i=1,GetNumQuestLogEntries() do
local _, _, _, _, _, _, _, id = GetQuestLogTitle(i);
if id == questId then
SelectQuestLogEntry(i);
SetAbandonQuest();
AbandonQuest();
end
end
__________________________________________________________________________________________________________________________________
// CUSTOM SCRIPT - Goes into Custom Script Section.
// USAGE - RunCode
throwAway.DeleteItems("Phial of Scrying", 0);
throwAway.DeleteItems("Gyromast's Key", 0);
throwAway.DeleteItems("Barrel of Barleybrew Scalder", 0);
//Abandon Quests - Custom Script
public class abandonQuest
{
public static void abandon(string questName)
{
string name = questName;
wManager.Wow.Helpers.Lua.LuaDoString("local name = '" + name + "' for i=1,GetNumQuestLogEntries() do local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete = GetQuestLogTitle(i) if string.find(questTitle, name) then SelectQuestLogEntry(i) SetAbandonQuest() AbandonQuest() end end");
}
}
//Throw away items - by Reapler - Custom Script
public class throwAway
{
public static int GetItemQuantity(string itemName)
{
var execute =
"local itemCount = 0; " +
"for b=0,4 do " +
"if GetBagName(b) then " +
"for s=1, GetContainerNumSlots(b) do " +
"local itemLink = GetContainerItemLink(b, s) " +
"if itemLink then " +
"local _, stackCount = GetContainerItemInfo(b, s)\t " +
"if string.find(itemLink, \"" + itemName + "\") then " +
"itemCount = itemCount + stackCount; " +
"end " +
"end " +
"end " +
"end " +
"end; " +
"return itemCount; ";
return Lua.LuaDoString<int>(execute);
}
/// <summary>
/// Used to delete all items by name.
/// </summary>
/// <param name="itemName">The item to delete.</param>
/// <param name="leaveAmount">The amount of items which remain in the bag.</param>
/// <remarks>Bug at links with "-"</remarks>
public static void DeleteItems(string itemName, int leaveAmount)
{
var itemQuantity = GetItemQuantity(itemName) - leaveAmount;
if(string.IsNullOrWhiteSpace(itemName) || itemQuantity <= 0)
return;
var execute =
"local itemCount = " + itemQuantity + "; " +
"local deleted = 0; " +
"for b=0,4 do " +
"if GetBagName(b) then " +
"for s=1, GetContainerNumSlots(b) do " +
"local itemLink = GetContainerItemLink(b, s) " +
"if itemLink then " +
"local _, stackCount = GetContainerItemInfo(b, s)\t " +
"local leftItems = itemCount - deleted; " +
"if string.find(itemLink, \"" + itemName + "\") and leftItems > 0 then " +
"if stackCount <= 1 then " +
"PickupContainerItem(b, s); " +
"DeleteCursorItem(); " +
"deleted = deleted + 1; " +
"else " +
"if (leftItems > stackCount) then " +
"SplitContainerItem(b, s, stackCount); " +
"DeleteCursorItem(); " +
"deleted = deleted + stackCount; " +
"else " +
"SplitContainerItem(b, s, leftItems); " +
"DeleteCursorItem(); " +
"deleted = deleted + leftItems; " +
"end " +
"end " +
"end " +
"end " +
"end " +
"end " +
"end; ";
Lua.LuaDoString(execute);
}
}
// Delete Item from Inventory - RunCode
/run for bag=0,4,1 do for slot=1,36,1 do local name=GetContainerItemLink(bag,slot);if (name and string.find(name,"Item1")) or (name and string.find(name,"Item2")) then PickupContainerItem(bag,slot);DeleteCursorItem();end;end;end
// Destroy / Delete Inventory items - RunLuaCode
-- Number= = 5, 3, 5, 21, 1, 5 etc of items in inventory to call.
number = 1;
i=1;
for bag = 0,4,1 do
for slot = 1, GetContainerNumSlots(bag), 1 do
local name = GetContainerItemLink(bag,slot);
if name and string.find(name,"An Old History Book") then
if i > number then PickupContainerItem(bag,slot);
DeleteCursorItem();
end;
end;
i=i+1;
end;
end;
__________________________________________________________________________________________________________________________________
// Time left on Trinket - By Reapler - https://wrobot.eu/forums/topic/7127-trinket-cooldown-time-left/
/// <summary>
/// Used to get the cooldown of an inventory item.
/// </summary>
/// <param name="slotId">The slot to get from.</param>
/// <returns>The left cooldown of the item.</returns>
public int GetInventoryCooldown(WoWInventorySlot slotId)
{
return Lua.LuaDoString<int>(
@"
local start, duration, enable = GetInventoryItemCooldown(""player"", "+(int)slotId+@")
local coolDown = duration-(GetTime()-start);
if (coolDown < 0) then
return 0;
end
return coolDown;
");
}
//Usage:
Logging.Write("Cooldown of Trinket1: "+GetInventoryCooldown(WoWInventorySlot.Trinket1));
__________________________________________________________________________________________________________________________________
// Desolace Kodo Quest Codes.
// [Is Complete Condition for Quest]
return wManager.Wow.ObjectManager.ObjectManager.Target.IsValid && wManager.Wow.ObjectManager.ObjectManager.Target.Reaction >= wManager.Wow.Enums.Reaction.Friendly;
// Target Unit by Name: RunCode
ObjectManager.Me.Target = ObjectManager.GetWoWUnitByName("Tamed Kodo").First().Guid;
// Face your Position ( do 180) RuNCode
MovementManager.Face(ObjectManager.Me.Position)
__________________________________________________________________________________________________________________________________
// Used to farm (Lockpicking Example - // OverridePulseCSharpCode
if (GoToTask.ToPosition(new Vector3(-1455.473f, -3968.029f, 7.562639f)))
{
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && Skill.GetValue(SkillLine.Lockpicking) < 75)
{
var obj = ObjectManager.GetObjectWoWGameObject()
.FirstOrDefault(o => !wManager.wManagerSetting.IsBlackListed(o.Guid) && o.Entry == 123330 || o.Entry == 123333 || o.Entry == 123331);
if (obj != null)
{
Interact.InteractGameObject(obj.GetBaseAddress);
Usefuls.WaitIsCastingAndLooting();
Lua.LuaDoString("LootCloseButton:Click();");
wManager.wManagerSetting.AddBlackList(obj.Guid, 5000, true);
}
}
}
return true;
__________________________________________________________________________________________________________________________________
// Custom code to PickPocket - or used in other situations. - overridePulseCsharpCode
if (!ObjectManager.Me.HaveBuff("Stealth"))
{
Lua.LuaDoString("CastSpellByName('Stealth')");
}
if (GoToTask.ToPosition(new Vector3(-11104.44, 491.9153, 28.40324)))
{
Conditions.ForceIgnoreIsAttacked = true;
var target = ObjectManager.GetObjectWoWUnit().FirstOrDefault(o => o.Entry == 7051);
if (target != null)
{
ObjectManager.Me.Target = target.Guid;
if (!ObjectManager.Me.HaveBuff("Stealth"))
{
Lua.LuaDoString("CastSpellByName('Stealth')");
}
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && target.GetDistance >= 5)
{
MovementManager.MoveTo(target.Position);
Thread.Sleep(100);
}
Lua.LuaDoString("CastSpellByName('Pick Pocket')");
Thread.Sleep(50);
string[] asm = {
"call " + (uint)0x4C1FA0,
wManager.Wow.Memory.WowMemory.RetnToHookCode
};
wManager.Wow.Memory.WowMemory.InjectAndExecute(asm);
Conditions.ForceIgnoreIsAttacked = false;
}
}
return true;
__________________________________________________________________________________________________________________________________
// Custom code to rup up and Sap a mob and then loot chest for Rogue Poisons Quest - OverridePulseCSharpCode
if (Quest.IsObjectiveComplete(1, 2359))
{
return true;
}
Conditions.ForceIgnoreIsAttacked = true;
wManager.wManagerSetting.CurrentSetting.MaxUnitsNear = 100;
var target = ObjectManager.GetObjectWoWUnit().FirstOrDefault(o => o.Entry == 7053);
if (target != null && target.IsAlive)
{
ObjectManager.Me.Target = target.Guid;
if (!ObjectManager.Me.HaveBuff("Stealth"))
{
Lua.LuaDoString("CastSpellByName('Stealth')");
}
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && target.GetDistance >= 5)
{
Lua.LuaDoString("CastSpellByName('Sap')");
Fight.StopFight();
if (target.HaveBuff("Sap"))
{
Lua.LuaDoString("ClearTarget();");
}
MovementManager.MoveTo(target.Position);
Thread.Sleep(50);
}
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !target.HaveBuff("Sap"))
{
Lua.LuaDoString("CastSpellByName('Sap');");
Fight.StopFight();
Thread.Sleep(10);
}
if (target.HaveBuff("Sap"))
{
wManager.wManagerSetting.ClearBlacklistOfCurrentProductSession();
var chest = ObjectManager.GetObjectWoWGameObject().FirstOrDefault(o => o.Entry == 123214);
if (chest != null)
{
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && chest.GetDistance >= 5)
{
if (target.HaveBuff("Sap"))
{
Lua.LuaDoString("ClearTarget();");
Fight.StopFight();
}
MovementManager.MoveTo(chest.Position);
Thread.Sleep(100);
}
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause
&& !Quest.IsObjectiveComplete(1, 2359)
&& !ObjectManager.Me.IsLooting()
&& !ObjectManager.Me.IsCast)
{
Lua.LuaDoString("CastSpellByName('Pick Lock');");
Interact.InteractGameObject(chest.GetBaseAddress, true);
Usefuls.WaitIsCastingAndLooting();
string[] asm =
{
"call " + (uint) 0x4C1FA0,
wManager.Wow.Memory.WowMemory.RetnToHookCode
};
wManager.Wow.Memory.WowMemory.InjectAndExecute(asm);
}
}
}
}
else
{
var chest = ObjectManager.GetObjectWoWGameObject().FirstOrDefault(o => o.Entry == 123214);
if (chest != null)
{
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && chest.GetDistance >= 5)
{
MovementManager.MoveTo(chest.Position);
Thread.Sleep(100);
}
while (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause
&& !Quest.IsObjectiveComplete(1, 2359)
&& !ObjectManager.Me.IsLooting()
&& !ObjectManager.Me.IsCast)
{
Lua.LuaDoString("CastSpellByName('Pick Lock');");
Interact.InteractGameObject(chest.GetBaseAddress, true);
Usefuls.WaitIsCastingAndLooting();
string[] asm =
{
"call " + (uint) 0x4C1FA0,
wManager.Wow.Memory.WowMemory.RetnToHookCode
};
wManager.Wow.Memory.WowMemory.InjectAndExecute(asm);
}
}
}
if (ObjectManager.Me.IsDead)
{
Quest.QuesterCurrentContext.CurrentStep = 1;
}
__________________________________________________________________________________________________________________________________
// Buy From Vendor - RunCode
Lua.LuaDoString("BuyMerchantItem(1,1)"); // version 1
wManager.Wow.Helpers.Vendor.BuyItem("Walking Stick",1); // Version 2 - RunCode
// buy specific item from vendor -- OverridePulseCSharpCode
var npc = new Npc
{
Entry = 1247,
Position = new Vector3(-5601.6, -531.203, 399.6539),
Type = Npc.NpcType.Vendor
};
int itemId = 2894;
if (GoToTask.ToPositionAndIntecractWith(npc))
{
Vendor.BuyItem(ItemsManager.GetNameById(itemId), 1);
}
return true;
// Buy item From Vendor + Use that item + Is Specific Class - RunCode -- https://wrobot.eu/forums/topic/11076-quests-and-buy-equip/
if (ObjectManager.Me.WowClass == WoWClass.class && ObjectManager.Me.Level <= 0) // change "Class" to what class you are. set level to level you want to get item at.
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(x, y, z), NpcID, 1, false);
System.Threading.Thread.Sleep(5000);
wManager.Wow.Helpers.Vendor.BuyItem("Skinning Knife",1); // change Skinning Knife to what item you want. do not remove ""
System.Threading.Thread.Sleep(5000);
}
// if has item useitem, hasitem
if (ItemsManager.HasItemById(3108)) // change 3108 to the item id
{
ItemsManager.UseItem(3108); // change 3108 to the item id
}
// Buy ONLY Item + Has Quest - RunCode
if (Quest.HasQuest(375))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2259.73f, 275.571f, 34.83753f), 2118, 1, false);
System.Threading.Thread.Sleep(5000);
wManager.Wow.Helpers.Vendor.BuyItem("Coarse Thread",1); // change Skinning Knife to what item you want. do not remove ""
System.Threading.Thread.Sleep(5000);
}
// Buy from Vendor - Professional way - RunCode
int npcEntryId = 1464;
var position = new Vector3(-3827.93f, -831.901f, 10.0906f);
while(!Quest.IsObjectiveComplete(1, 288))
{
while(!wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId);
}
if(wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))
{
Usefuls.SelectGossipOption(GossipOptionsType.vendor);
Thread.Sleep(Usefuls.Latency + 500);
if(ItemsManager.GetItemCountById(2594) <= 0)
{
Lua.LuaDoString("BuyMerchantItem(8,1)"); //Or use wManager.Wow.Helpers.Vendor.BuyItem("Coarse Thread",1);
Thread.Sleep(Usefuls.Latency + 500);
return;
}
}
}
__________________________________________________________________________________________________________________________________
// Buy mount , riding trainer, train riding, buy riding mount - runcode
!wManager.Wow.Helpers.Skill.Has(wManager.Wow.Enums.SkillLine.Riding) && Lua.LuaDoString<int>("return GetMoney()") >= 1000000
// buy mount from vendor - runcode
int npcEntryId = 4772;
var pos = new Vector3(-5521.5f, -1347.8f, 398.8f);
if(!wManager.Wow.Helpers.Skill.Has(wManager.Wow.Enums.SkillLine.Riding))
{
while(!wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(pos, npcEntryId))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(pos, npcEntryId);
Thread.Sleep(Usefuls.Latency + 500);
}
Usefuls.SelectGossipOption(GossipOptionsType.trainer);
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("BuyTrainerService(0)");
Thread.Sleep(Usefuls.Latency + 500);
Lua.LuaDoString("CloseTrainer()");
}
__________________________________________________________________________________________________________________________________
// FLY - Custom Fly Code ---- FLYING CODE RunCode
var position = new Vector3(-1770.37f, 3262.19f, 5.10852f);
int npcEntryId = 6726;
if (!ObjectManager.Me.IsOnTaxi)
{
if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))
{
int node;
Usefuls.SelectGossipOption(GossipOptionsType.taxi);
node = wManager.Wow.Helpers.Lua.LuaDoString<int>("for i=0,30 do if string.find(TaxiNodeName(i),'Orgrimmar') then return i end end");
wManager.Wow.Helpers.Lua.LuaDoString("TakeTaxiNode(" + node + ")");
}
}
__________________________________________________________________________________________________________________________________
// Zangermarsh -- Elevator Code
If
if (ObjectManager.GetWoWGameObjectByyId(183177).FirstOrDefault().GetDistance <= 10) {
Logging.Write("Elevator already here.Lets wait - waiting for elevator");
}
while (ObjectManager.GetWoWGameObjectByyId(183177).FirstOrDefault().GetDistance <= 10) {Thread.Sleep(500);};
Logging.Write("Waiting for the Tram");
while (ObjectManager.GetWoWGameObjectByyId(183177).FirstOrDefault().GetDistance > 10) {Thread.Sleep(500);};
// step inside the tram
wManager.Wow.Helpers.Move.Forward(Move.MoveAction.PressKey,1000);
wait 1500
while (ObjectManager.Me.Position.DistanceTo2D( new Vector3(283.8558f, 5945.312f, 149. 8242f, "None")) >10) {Thread.Sleep(100);};
wait 100
wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey,5500);
// Custom Follow Path to run away from Elevator
EndIf
__________________________________________________________________________________________________________________________________
// Click Loot Window - Item # 1 ( RunCode )
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 18);
robotManager.Helpful.Mouse.ClickLeft();
// Click Loot Window - Item # 2 ( RunCode )
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 22);
robotManager.Helpful.Mouse.ClickLeft();
// Mouse Click - Loot window Item # 3 ( RunCode )
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 26);
robotManager.Helpful.Mouse.ClickLeft();
// Click Loot Window - Item # 4 ( RunCode )
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 29);
robotManager.Helpful.Mouse.ClickLeft();
if (wManager.Wow.Helpers.ItemsManager.GetItemCountById(19035) > 0)
{
wManager.Wow.Helpers.ItemsManager.UseItem(19035);
System.Threading.Thread.Sleep(2000);
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 18);
robotManager.Helpful.Mouse.ClickLeft();
System.Threading.Thread.Sleep(2000);
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 22);
robotManager.Helpful.Mouse.ClickLeft();
System.Threading.Thread.Sleep(2000);
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 26);
robotManager.Helpful.Mouse.ClickLeft();
System.Threading.Thread.Sleep(2000);
robotManager.Helpful.Mouse.CurseurWindowPercentagePosition(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, 2, 29);
robotManager.Helpful.Mouse.ClickLeft();
}
__________________________________________________________________________________________________________________________________
// Go to location and Gather - Specific Location and gather / interact - RuNCode
var pos = new Vector3(-4679.763f, -1785.955f, -41.34184f);
int objectId = 19861;
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(pos, objectId);
Thread.Sleep(Usefuls.Latency + 10000);
if(ItemsManager.GetItemCountById(5791) < 1 && ItemsManager.GetItemCountById(5790) < 1)
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(pos, objectId);
Thread.Sleep(Usefuls.Latency + 10000);
}
__________________________________________________________________________________________________________________________________
// Use Hearthstone version 2.
if (wManager.Wow.Helpers.Usefuls.ContinentId != (int) wManager.Wow.Enums.ContinentId.Azeroth ||
wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo2D(new robotManager.Helpful.Vector3(1, 2, 3)) > 1000)
{
wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = false;
wManager.Wow.Helpers.ItemsManager.UseItem(6948); // http://www.wowhead.com/item=6948/hearthstone
System.Threading.Thread.Sleep(1000 * 20); // 20 secondes
wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = true;
}
// Check timmer on HS
Lua.LuaDoString<bool>("if GetItemCooldown(Heathstone) == 0 then return true end")
__________________________________________________________________________________________________________________________________
// Add target to Blacklist -- For professional Profile creators.. this can cause you some drama!
WoWUnit unit = new WoWUnit(0);
if (unit.IsValid && !wManager.Wow.ObjectManager.ObjectManager.BlackListObjectManagerGuid.Contains(unit.Guid))
wManager.Wow.ObjectManager.ObjectManager.BlackListObjectManagerGuid.Add(unit.Guid);
__________________________________________________________________________________________________________________________________
// For dungeons mostly ---- Blacklist looting ALL MOBS, except for the boss (rename 12345, by boss id.)
var _units = new List<wManager.Wow.ObjectManager.WoWUnit>();
var tUnit = wManager.Wow.ObjectManager.ObjectManager.GetWoWUnitLootable();
foreach (var woWUnit in tUnit)
{
if (!wManager.wManagerSetting.IsBlackListedAllConditions(woWUnit) && woWUnit.Entry == 12345)
_units.Add(woWUnit);
}
if (_units.Count > 0)
wManager.Wow.Bot.Tasks.LootingTask.Pulse(_units);
__________________________________________________________________________________________________________________________________
// Select gossip option 1 and click all the text after that
var position = new Vector3(-6679.93f, -1194.36f, 240.2135f);
int npcEntryId = 8479;
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId);
System.Threading.Thread.Sleep(1000 * 2);
System.Threading.Thread.Sleep(1000 * 2);
Usefuls.SelectGossipOption(1);
System.Threading.Thread.Sleep(1000 * 2);
Usefuls.SelectGossipOption(1);
System.Threading.Thread.Sleep(1000 * 2);
Usefuls.SelectGossipOption(1);
System.Threading.Thread.Sleep(1000 * 2);
Usefuls.SelectGossipOption(1);
System.Threading.Thread.Sleep(1000 * 2);
wManager.Wow.Helpers.Move.Forward(Move.MoveAction.PressKey, 3000);
__________________________________________________________________________________________________________________________________
// if in Regeneration State - force bot to sitdown - Runcode -- credit - https://wrobot.eu/forums/topic/9777-sitting-during-regeneration/
if (robotManager.Helpful.Logging.Status == "Regeneration")
{
if (!wManager.Wow.ObjectManager.ObjectManager.Me.IsSitting)
{
wManager.Wow.Helpers.Move.SitStandOrDescend();
Thread.Sleep(1000);
}
}
// Force bot to SIT DOWN
if (!wManager.Wow.ObjectManager.ObjectManager.Me.IsSitting)
{
wManager.Wow.Helpers.Move.SitStandOrDescend();
Thread.Sleep(1000);
}
__________________________________________________________________________________________________________________________________
// Check Reputation Faction level - IF STATEMENT - Rep Faction level
Lua.LuaDoString<bool>(@"
for factionIndex = 1, GetNumFactions() do
local name, description, standingId, bottomValue, topValue, earnedValue, atWarWith, canToggleAtWar,
isHeader, isCollapsed, hasRep, isWatched, isChild, factionID = GetFactionInfo(factionIndex)
if name == ""The Mag'har"" and standingId < 4 then
return true
end
end
")
__________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________
if (!(Quest.HasQuest(12733)) && !(Quest.GetQuestCompleted(12733)) && !(ObjectManager.Me.Position.DistanceTo2D(new Vector3(-3095.85f, -2890.54f, 34.583f)) < 50))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(-3095.85f, -2890.54f, 34.583f), 13476, 1, false);
System.Threading.Thread.Sleep(2000);
wManager.Wow.Helpers.Vendor.BuyItem("Healing Potion",4);
System.Threading.Thread.Sleep(2000);
wManager.Wow.Helpers.Vendor.BuyItem("Scroll of Intellect II",2);
wManager.Wow.Helpers.Vendor.BuyItem("Scroll of Agility",2);
System.Threading.Thread.Sleep(2000);
wManager.Wow.Helpers.ItemsManager.UseItem(2290);
System.Threading.Thread.Sleep(2000);
wManager.Wow.Helpers.ItemsManager.UseItem(3012);
}
// Script to accept quest and turn in - manual turn in, manual accept quest
if (!(Quest.HasQuest(12733)) && !(Quest.GetQuestCompleted(12733)) && !(ObjectManager.Me.Position.DistanceTo2D(new Vector3(2368.922f, -5776.345f, 151.3674f)) < 20))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(2368.922f, -5776.345f, 151.3674f));
}
var u = ObjectManager.GetNearestWoWUnit(ObjectManager.GetWoWUnitByEntry(29047));
if (u.IsValid)
{
Interact.InteractGameObject(u.GetBaseAddress);
wManager.Wow.Helpers.Lua.RunMacroText("/script AcceptQuest();");
}
if ((Quest.HasQuest(12733)) && !(Quest.IsObjectiveComplete(1, 12733)) && !(ObjectManager.Me.InCombat));
{
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2336.52f, -5699.58f, 153.9225f), 28406, 1, false);
System.Threading.Thread.Sleep(000);
wManager.Wow.Helpers.SpellManager.CastSpellByIdLUA(45477);
}
if (Quest.HasQuest(12733) && !(Quest.GetQuestCompleted(12733)) && !(ObjectManager.Me.Position.DistanceTo2D(new Vector3(2368.922f, -5776.345f, 151.3674f)) < 20))
{
wManager.Wow.Bot.Tasks.GoToTask.ToPosition(new Vector3(2368.922f, -5776.345f, 151.3674f));
}
if (u.IsValid)
{
Interact.InteractGameObject(u.GetBaseAddress);
wManager.Wow.Helpers.Lua.RunMacroText("/click QuestFrameCompleteQuestButton");
}
return true;
__________________________________________________________________________________________________________________________________
// Play sound in game - sound file
// Run Lua Code
Lua.LuaDoString("PlaySoundFile("Interface\\AddOns\\MyAddOn\\MySound.ogg")");
// Run Lua Macro
Lua.RunMacroText("/console Sound_EnableSFX 1");
// Play sound in wrobot C#
var myPlayer = new System.Media.SoundPlayer
{
SoundLocation = Application.StartupPath + "\\Data\\newWhisper.wav"
};
var tPlay = new robotManager.Helpful.Timer(1000 * 5); // 5 sec = 5000 ms
while (!tPlay.IsReady)
{
myPlayer.PlaySync();
}
myPlayer.Stop();
__________________________________________________________________________________________________________________________________
// Fishing test - Fishing rotation OverridePulseCSharpCode
Vector3 pos1 = new Vector3(-1475.103, -226.9858, 4.822745, "Flying");
float fishRotation = 5.77f;
uint itemId = 211160;
if (!FishingTask.IsLaunched)
{
if (GoToTask.ToPosition(pos1, 1.5f))
{
ObjectManager.Me.Rotation = fishRotation;
ItemsManager.UseItem(itemId);
FishingTask.LoopFish();
}
}
return true;
__________________________________________________________________________________________________________________________________
// Mail Items *custom script* - By Reapler
public static int InteractItems(List<string> itemNames, int interactions = int.MaxValue)
{
if (!itemNames.Any())
return -1;
var execute =
"local counter = 0; " +
"local leftStacks = 0; " +
"for b=0,4 do " +
"if GetBagName(b) then " +
"for s=1, GetContainerNumSlots(b) do " +
"local itemLink = GetContainerItemLink(b, s) " +
"if itemLink then " +
"local _, stackCount = GetContainerItemInfo(b, s)\t" +
"if string.find(itemLink, \""+ itemNames.FirstOrDefault() + "\") ";
if (itemNames.Count > 1)
{
execute = itemNames.Where(obj => itemNames.FirstOrDefault() != obj).Aggregate(execute, (current, obj) => current + "or string.find(itemLink, \"" + obj + "\") ");
}
execute = execute +
"then " +
"if (counter < "+interactions+") then " +
"UseContainerItem(b, s); " +
"counter = counter + 1; " +
"else " +
"leftStacks = leftStacks + 1;" +
"end " +
"\tend\tend\tend end end return leftStacks;";
return Lua.LuaDoString<int>(execute);
}
/// <summary>
/// Sends a mail to a recipient.
/// </summary>
/// <param name="recipient">The recipient.</param>
/// <param name="subject">The subject.</param>
/// <param name="itemNames">The items to send as names.</param>
/// <returns>true if successful ; false if no mailbox available or stacks are left.</returns>
public bool SendItems(string recipient, string subject, List<string> itemNames)
{
var mailBox = ObjectManager.GetObjectWoWGameObject().FirstOrDefault(i => i.IsMailbox && i.GetDistance <= 5);
if (mailBox == null || string.IsNullOrWhiteSpace(recipient))
return false;
if (subject.Length == 0)
subject = "-";
if (mailBox)
{
const int delayMs = 800;
var timeOut = DateTime.Now.AddSeconds(40);
Interact.InteractGameObject(mailBox.GetBaseAddress);
Thread.Sleep(delayMs);
Lua.LuaDoString("RunMacroText('/click MailFrameTab2');");
Thread.Sleep(delayMs);
var leftStack = InteractItems(itemNames, 12);
Thread.Sleep(delayMs);
Lua.LuaDoString($"SendMail(\"{recipient}\",\"{subject}\",\" \");");
Thread.Sleep(delayMs*3);
while (leftStack != 0 && DateTime.Now < timeOut)
{
leftStack = InteractItems(itemNames, 12);
Thread.Sleep(delayMs);
Lua.LuaDoString($"SendMail(\"{recipient}\",\"{subject}\",\" \");");
Thread.Sleep(delayMs*3);
}
Lua.LuaDoString("CloseMail();");
if (leftStack != 0)
return false;
}
return true;
}
// Usage: runcode
SendItems("Reapler", "items for you",
new List<string>
{
"Super Healing Potion",
"Heavy Netherweave Bandage",
"Super Mana Potion",
});
__________________________________________________________________________________________________________________________________
//runluacode - equip ammo
var QuiverAmmoBagsId = new List<int>
{
29143,
29144,
29118,
18714,
44447,
44448,
34105,
34106,
34099,
34100,
19319,
19320,
2662,
2663,
8217,
8218,
7371,
7372,
3604,
3605,
3573,
3574,
11362,
11363,
5439,
5441,
7278,
7279,
2101,
2102,
};
var freeSlots = 0;
var bags = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWContainer();
foreach (var b in bags)
{
if (b.IsValid &&
QuiverAmmoBagsId.Contains(b.Entry) &&
b.Owner == wManager.Wow.ObjectManager.ObjectManager.Me.Guid &&
(b.ContainedIn == 0 || b.ContainedIn == wManager.Wow.ObjectManager.ObjectManager.Me.Guid) &&
!string.IsNullOrWhiteSpace(b.Name))
{
freeSlots += Lua.LuaDoString<int>($@"
local freeSlots = 0;
for bagID = 1, 4 do
if GetBagName(bagID) ~= nil and GetBagName(bagID) == '{b.Name.Replace("'", "\'")}' then
for s=1,GetContainerNumSlots(bagID) do
local i = GetContainerItemInfo(bagID,s);
if not i then
freeSlots = freeSlots + 1
end
end
end
end
return freeSlots;");
}
}
__________________________________________________________________________________________________________________________________
// Polymorph on multiple attackers - Mars -https://wrobot.eu/forums/topic/7541-switch-target-polymorph-switch-to-original-target/?tab=comments#comment-34382
List<WoWUnit> attackers = ObjectManager.GetUnitAttackPlayer();
FightEvents.OnFightLoop += (unit, cancelable) =>
{
if (attackers.Count > 1 && Polymorph.KnownSpell && Polymorph.IsSpellUsable && ObjectManager.Target.GetDistance <= 25 && presence.KnownSpell && presence.IsSpellUsable)
{
WoWUnit mainTarget = attackers.Where(u => u.HealthPercent == attackers.Min(x => x.HealthPercent)).FirstOrDefault();
WoWUnit polyTarget = attackers.Where(u => u.HealthPercent == attackers.Max(x => x.HealthPercent)).FirstOrDefault();
if (!polyTarget.HaveBuff("Polymorph") && polyTarget != mainTarget)
{
SpellManager.CastSpellByNameOn("Polymorph", polyTarget.Name);
Usefuls.WaitIsCasting();
return;
}
}
};
// secondary - Semiko
List<WoWUnit> attackers = ObjectManager.GetUnitAttackPlayer();
if (attackers.Count > 1)
{
WoWUnit mainTarget = attackers.Where(u => u.HealthPercent == attackers.Min(x => x.HealthPercent)).FirstOrDefault();
WoWUnit polyTarget = attackers.Where(u => u.HealthPercent == attackers.Max(x => x.HealthPercent)).FirstOrDefault();
if (!polyTarget.HaveBuff("Polymorph") && polyTarget != mainTarget)
{
Interact.InteractGameObject(polyTarget.GetBaseAddress);
SpellManager.CastSpellByNameLUA("Polymorph");
Thread.Sleep(500);
Interact.InteractGameObject(mainTarget.GetBaseAddress);
}
}
__________________________________________________________________________________________________________________________________
// the missing diplomat
CAN CONDITION
return Quests.hasFailed("The Missing Diplomat");
// IS COMPLETE
return Quests.isComplete("The Missing Diplomat") || Quests.hasFailed("The Missing Diplomat");
// isfailed custom script code - timmer quests - run code
if(!Quest.GetQuestCompleted(1447))
{
bool missingDiplomatFailed = false;
if(Quests.isFailed("The Missing Diplomat"))
{
Logging.Write("Quest failed. Going to abandon and restart, hold on...");
missingDiplomatFailed = true;
Thread.Sleep(Usefuls.Latency + 2000);
Quests.abandon("The Missing Diplomat");
Thread.Sleep(Usefuls.Latency + 10000);
}
if(wManager.Wow.Helpers.FinishedQuestsSettings.CurrentSetting.FinishedQuest.Contains(1447) && missingDiplomatFailed)
{
Logging.Write("[FNV_Quester]: Going to remove The Missing Diplomat from the list of finished quest ids...");
Thread.Sleep(Usefuls.Latency + 500);
wManager.Wow.Helpers.FinishedQuestsSettings.CurrentSetting.FinishedQuest.Remove(1447);
Thread.Sleep(Usefuls.Latency + 500);
Logging.Write("[FNV_Quester]: Success? A: " + !wManager.Wow.Helpers.FinishedQuestsSettings.CurrentSetting.FinishedQuest.Contains(1447));
}
}
__________________________________________________________________________________________________________________________________
// Next RunCode for IsFailed
wManager.wManagerSetting.ClearBlacklistOfCurrentProductSession();
wManager.Wow.Helpers.Conditions.ForceIgnoreIsAttacked = false;
Thread d = new Thread(() =>
{
while(!Quest.HasQuest(1447) && !Quest.GetQuestCompleted(1447))
{
Thread.Sleep(100);
}
if(Quest.HasQuest(1447))
{
while(ObjectManager.Me.WowClass == WoWClass.Druid && !ObjectManager.Me.HaveBuff("Bear Form") && !ObjectManager.Me.HaveBuff("Cat Form"))
{
Thread.Sleep(25);
Logging.Write("[FNV_Quester]: Forcing Bear Form");
Lua.LuaDoString("CastSpellByName('Bear Form')");
Thread.Sleep(500);
break;
}
}
});
if(ObjectManager.Me.WowClass == WoWClass.Druid)
d.Start();
---------------
// Pickup Quest
// Pulse Quest
// RunCode
if(!Quest.GetQuestCompleted(1447))
{
if(!Quests.hasFailed("The Missing Diplomat") && !Quests.isComplete("The Missing Diplomat"))
{
int npcId = 4961;
Vector3 pos = new Vector3(-8681.17, 433.618, 99.8117);
var unit = ObjectManager.GetWoWUnitByEntry(npcId).FirstOrDefault();
wManager.wManagerSetting.ClearBlacklistOfCurrentProductSession();
ObjectManager.Me.Target = unit.Guid;
Fight.StartFight();
}
}
// if quest
Quests.isComplete("The Missing Diplomat")
//turn in quest
It would be great if wrobot can start some profile by default. For example when i create new acc, and start new bot, it trying start with empty profile. And then i need choose my profile by hands. It gets tiring if you have to do it 20 times in a row.
What if a new option comes up in WRobotGlobalSetting.xml:
<IfProfileStringEmptyLoad>\Profiles\Quester\Autoload.xml</IfProfileStringEmptyLoad>
private void initializeEnemiesList()
{
if (_settings.enemyAlertEnabled)
{
string[] enemySplit = _settings.enemyNamesList.Split(',');
myEnemyList = new List<string>(enemySplit);
}
}
public void enemyAlert()
{
var enemiesNearMe = GetEnemiesNearMe(_settings.enemyScanRange, myEnemyList);
if (!(ObjectManager.Me.InCombatFlagOnly) && enemiesNearMe.Count > 0 && (DateTime.Now > nextEnemyAlertTime))
{
nextEnemyAlertTime = DateTime.Now.AddSeconds(_settings.enemyAlertWaitTime);
var enemyNames = "";
foreach (var enemy in enemiesNearMe)
{
enemyNames += (enemy.Name + " ");
}
moveto();
Logging.Write("[RoboAlert] Enemies Near Me ");
wManager.Wow.Helpers.Lua.LuaDoString("BasicScriptErrors:SetScale(6) if BasicScriptErrors:IsShown() then BasicScriptErrors:Hide() end message('HATER " + enemyNames + "')");
}
private void moveto()
{
wManager.Events.FightEvents.OnFightLoop += delegate (WoWUnit unit, CancelEventArgs cancelable)
{
var enemiesNearMe = GetEnemiesNearMe(_settings.enemyScanRange, myEnemyList);
if (enemiesNearMe.Count > 0)
{
var toPosition = new Vector3(4286.155, -884.4277, 251.7935, "Flying");
wManager.Wow.Helpers.MovementManager.MoveTo(toPosition);
while (wManager.Wow.Helpers.MovementManager.InMoveTo && toPosition.DistanceTo(wManager.Wow.ObjectManager.ObjectManager.Me.Position) > 17)
{
System.Threading.Thread.Sleep(10000);
}
}
};
}
What code could be placed in the body of the method moveto() so that the bot flew to a specific point if the enemy suddenly appeared nearby, And after that the bot returned
I think Warmane anty-bot system work very simply. If you watched bots, started in one time - you may have noticed what all chars moves always the same hotspots accurate to 0.1
So all what need for detect bots - its make "traps" like this:
int BotScore;
if(UnitPlayer.Position.DistanceTo(x111.1, y101.2, z121.2) < 0.1) BotScore ++;
if(UnitPlayer.Position.DistanceTo(x111.1, y101.3 z121.2) < 0.1) BotScore ++;
if(UnitPlayer.Position.DistanceTo(x111.2, y101.3 z121.2) < 0.1) BotScore ++;
.................
if(BotScore >= 1337){ //this boy got 1337 score in last 2 hours
Logging.Write("One ban for this kid, please");
youDied();
}
Hello,
Use an Fightclass is not a good way to manage target at attack. It is more recommended to make an "Custom Profile" or the best is to make an "Product" (bot) (you can activate option "Dont Start Fighting" in general settings but I recommand to not use Fightclass for this).
I have make sample of custom class with your code (if this works like you want say me it I'll give code to join queue and enter in bg) (you can after use this code with small edit to make product dll):
using System;
using System.Collections.Generic;
using System.Linq;
using robotManager.FiniteStateMachine;
using robotManager.Helpful;
using robotManager.Products;
using wManager;
using wManager.Wow.Bot.States;
using wManager.Wow.Enums;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
public class CustomProfile : Custom_Profile.ICustomProfile
{
private static readonly Engine Fsm = new Engine();
// Start custom profile
public void Pulse()
{
try
{
// Update spell list
SpellManager.UpdateSpellBook();
// Load CC:
wManager.Wow.Helpers.CustomClass.LoadCustomClass();
// FSM : http://en.wikipedia.org/wiki/Finite-state_machine
Fsm.States.Clear();
Fsm.AddState(new wManager.Wow.Bot.States.Relogger { Priority = 200 }); // Relog if disconnected
Fsm.AddState(new wManager.Wow.Bot.States.Pause { Priority = 13 }); // Manage bot pause
Fsm.AddState(new wManager.Wow.Bot.States.ResurrectBG { Priority = 12 }); // Resurrect player (bg mode)
Fsm.AddState(new wManager.Wow.Bot.States.Resurrect { Priority = 12 }); // Resurrect player (b=normal mode)
Fsm.AddState(new wManager.Wow.Bot.States.MyMacro { Priority = 11 }); // Manage MyMacro (user settings in general settings)
Fsm.AddState(new wManager.Wow.Bot.States.FarmingBG { Priority = 10 }); // Farm in BG (for flag, door, ...)
Fsm.AddState(new ManageTargetBG { Priority = 9, DistanceSearch = 150 }); // Search target at attacked (THIS CLASS IS AT TGE END OF THIS PAGE)
//Fsm.AddState(new wManager.Wow.Bot.States.GrindingBG { Priority = 9, DistanceSearch = 150 }); // Search target at attacked
Fsm.AddState(new wManager.Wow.Bot.States.IsAttacked { Priority = 8 }); // Launch combat if player attacked
//Fsm.AddState(new wManager.Wow.Bot.States.Regeneration {Priority = 8}); // Regen health/mana
//Fsm.AddState(new wManager.Wow.Bot.States.Looting { Priority = 7 }); // Loot npc dead
//Fsm.AddState(new wManager.Wow.Bot.States.Farming { Priority = 6 }); // farm mines/herbs/...
Fsm.AddState(new wManager.Wow.Bot.States.AntiAfk { Priority = 5 }); // Anti AFK
Fsm.AddState(new wManager.Wow.Bot.States.Idle { Priority = 0 }); // If not states need to run, wait
Fsm.States.Sort(); // Order states by Prority
Fsm.StartEngine(10, "_customProfile"); // Launch FSN (with all added states)
StopBotIf.LaunchNewThread(); // Launch bot security (tab "security" in general settings)
// Attach onlevelup for spell book:
EventsLua.AttachEventLua(LuaEventsId.PLAYER_LEVEL_UP, m => OnLevelUp()); // Follow lua event for get when player level up
// Move during combat:
//FightBG.MoveDuringCombat = true;
Logging.Write("Custom Profile Started.");
}
catch (Exception e)
{
try
{
Dispose();
}
catch
{
}
Logging.WriteError("Bot > Pulse(): " + e);
}
}
// Stop custom profile
public void Dispose()
{
try
{
wManager.Wow.Helpers.CustomClass.DisposeCustomClass();
Fsm.StopEngine();
Fight.StopFight();
MovementManager.StopMove();
}
catch (Exception e)
{
Logging.WriteError("Bot > Dispose(): " + e);
}
}
// When player levelup
void OnLevelUp()
{
Logging.Write("Level UP! Reload Fight Class.");
// Update spell list
SpellManager.UpdateSpellBook();
// Load CC:
wManager.Wow.Helpers.CustomClass.ResetCustomClass();
}
// Fsm state to manage target at attack
public class ManageTargetBG : State
{
public override string DisplayName
{
get { return "Manage target BG"; }
}
public override int Priority
{
get { return _priority; }
set { _priority = value; }
}
private int _priority;
public override List<State> NextStates
{
get { return new List<State>(); }
}
public override List<State> BeforeStates
{
get { return new List<State>(); }
}
public List<int> EntryTarget = new List<int>();
public List<uint> FactionsTarget = new List<uint>();
public float DistanceSearch = 150;
private WoWUnit _unit;
// If this method return true, wrobot launch method Run(), if return false wrobot go to next state in FSM
public override bool NeedToRun
{
get
{
if (wManagerSetting.CurrentSetting.DontStartFighting)
return false;
if (!Battleground.IsInBattleground() || !Battleground.BattlegroundIsStarted()) // Not run is not in bg
return false;
if (!Usefuls.InGame ||
Usefuls.IsLoadingOrConnecting ||
ObjectManager.Me.IsDeadMe ||
!ObjectManager.Me.IsValid ||
!Products.IsStarted)
return false;
// Get unit:
_unit = new WoWUnit(0);
var enemyPlayerList = new List<WoWUnit>();
if (FactionsTarget.Count > 0)
enemyPlayerList.AddRange(ObjectManager.GetWoWUnitByFaction(FactionsTarget));
if (EntryTarget.Count > 0)
enemyPlayerList.AddRange(ObjectManager.GetWoWUnitByEntry(EntryTarget));
if (ObjectManager.Me.PlayerFaction == "Alliance")
enemyPlayerList.AddRange(ObjectManager.GetWoWUnitHorde());
if (ObjectManager.Me.PlayerFaction == "Horde")
enemyPlayerList.AddRange(ObjectManager.GetWoWUnitAlliance());
// Your code
WoWUnit[] cibles = new WoWUnit[enemyPlayerList.Count];
long[] ciblePv = new long[enemyPlayerList.Count];
int offset = 0;
foreach (WoWUnit adversaire in enemyPlayerList)
{
cibles[offset] = adversaire;
ciblePv[offset] = adversaire.Health;
offset++;
}
Array.Sort(ciblePv, cibles);
// You can replace your code to sort players by:
// cibles = enemyPlayerList.OrderBy(p => p.Health).ToArray();
// And I think it is more appropriate to use HealthPercent instead Health
for (int x = 0; x < enemyPlayerList.Count; x++)
{
if (cibles[x].IsValid &&
cibles[x].GetDistance < DistanceSearch &&
cibles[x].IsAlive &&
_unit.SummonedBy <= 0 && // Avoid pet
_unit.Guid != ObjectManager.Pet.Guid &&
!wManagerSetting.IsBlackListedAllConditions(_unit)) // Check if blacklisted
{
bool result;
PathFinder.FindPath(_unit.Position, out result); // Test if wrobot can make path to the target to avoid stuck
if (result)
{
_unit = cibles[x];
return true;
}
}
}
_unit = new WoWUnit(0);
return false;
}
}
// If NeedToRun() == true
public override void Run()
{
if (!_unit.IsValid)
return;
Logging.Write("Player Attack " + _unit.Name + " (lvl " + _unit.Level + ")");
FightBG.StartFight(_unit.Guid); // Launch Fight
if (_unit.IsDead)
{
Statistics.Kills++;
}
FightBG.StopFight();
}
}
}
ps: I haven't time to test it now, tell me if this don't works, save this file in "WRobot\Profiles\Custom Profile\" (.cs file) and use product "Custom Product).
You need to stop saying stuff like "Warmane detected the bot" without having proof.
Example: Before last updates, every time a char leveled to level 10 using wrobot, people would get a instant ban. THIS is detection. This is how tauri detected wrobot.
IF you get instant banned at x point, THEN wrobot is detected. If you get banned between level 20-30 or 40-50 or 50-60.That means you have been reported by players, the GM looked at you play and decided that you were a bot.
IF you get 5 accounts banned at the same time, it either means that all your 5 bots were reported, and then when they handed out ban hammers, all 5 bots was on their "paper".
OR it means that your 5 bots were connected someway, this could be IP or something else.
Yes i do not want to know that you use proxy etc. I am sure you are taking your precautions.
To those who use proxy, and think that they are safe behind a HTTP proxy. You are wrong... The only place wow uses http is your log in. as soon as you get ON the server with a char. a HTTP proxy is no longer hiding you.
Hi all,
I figured I'd post some things that I have learned during my time of developing in C#. Perhaps some of this is obvious for some of the more experienced WRobot C# writers, but for me, I had to do a lot of forum searching and experimenting to make progress on any of my work.
How do I get started?
Please see this post by @Droidz
How can I see what Functions are available to me in the WRobot API?
I recommend using some sort of decompiler in order to see what functions are available in the WRobot API. That is, use something such as dotPeek from jetbrains. See this URL: https://www.jetbrains.com/decompiler/ . Once you have this downloaded, open the WRobot Binaries located in the (C:\WRobot\Bin) folder in dotPeek. I cannot even begin to explain how many times the recompiled helped me find useful things I could re-use. As a quick tip, I would suggest taking a look at the wManager.wManager.Wow.Helpers functions that are available. Anything listed as public static <variable type> will be available to use from a Plugin/Profile/Fightclass etc.
What if WRobot doesn't have an available function that I will need?
WRobot doesn't have everything instantly available, so you may need to resort to using some Lua Functions to get information back from the WoW Client. An example of this that I ran into at some point was getting the number of Character Macros someone has.. Of course this is very specific, but please bear with me for the sake of this example :).
WoW Lua Reference: http://wowprogramming.com/docs/api_categories
Using Lua in C#:
This snippet will return a List of integers and set the C# variable numberOfMacros equal to the returned list of the DoString function. To be more specific, it will provide a list of the number of Global account Macros , and the number of Personal Character Macros.
var numberOfMacros = Lua.LuaDoString<List<int>>("return numCharacterMacros");
The below will return just the number Character Macros someone has. If you need a specific variable from a Lua Function, then do the following:
var numPersonalMacros = Lua.LuaDoString<int>("local numAccountMacros, numCharacterMacros = GetNumMacros(); return numCharacterMacros");
The above snippet will set the C# variable numPersonalMacros equal to numCharacterMacros from the lua return value.
Using a Variable in the Lua.LuaDoString. The below will return the text body of the macro that has the id of 121.
var _macroID = 121
string macroBody = Lua.LuaDoString<string>("return GetMacroBody(" + _macroID + ")");
Executing Lua Code in C#
This will leave the party (if the player is in one).
wManager.Wow.Helpers.Lua.RunMacroText("/run LeaveParty()");
What is the difference between Lua.LuaDoString() and RunMacroText()?
The difference is in can be understand in how you think about them. Lua.LuaDoString should be seen as a way to retrieve information.. More specifically, the Lua.LuaDoString's purpose is to have a value returned to it, so that you can assign it to a C# Variable. RunMacroText can be used to do something in game. More specifically, RunMacroText should be used when trying to run some sort of in-game script (such as /cast spell).
Plugin Template C#: Plugin-Template.cs
I have attached a basic plugin template that can be used. In it, I have provided an example of:
A Basic Implementation of the wManager.Plugin.IPlugin Class (including Settings/Initialize/Dispose)
Basic loop that will occur while WRobot is running
Settings that can be configured from Plugin Page
A Category/Short Description for the Plugin Settings
An example of Watching for Game Events.
An example of OnRunState / OnAfterRunState for WRobot States
Watching For Game Events
Sometimes you may find that you need to wait for something to occur in game before you can take a specific action. In WoW / WRobot world, these things are called events. Below are two examples of events. The first event will occur when either the Group Loot Settings change, or a Player Enters/Joins the current Party.The second Event will occur when a System Message is received. I recommend adding this watchForEvents Function in the Initialize function of a plugin, or somewhere where it will only be called once. For an example of this, please see my Plugin Template.
private void watchForEvents()
{
EventsLuaWithArgs.OnEventsLuaWithArgs += (LuaEventsId id, List<string> args) =>
{
if (id == wManager.Wow.Enums.LuaEventsId.PARTY_MEMBERS_CHANGED)
{
Logging.Write("Joined Group or something about the current group was changed.");
}
if (id == wManager.Wow.Enums.LuaEventsId.CHAT_MSG_SYSTEM)
{
Logging.Write("We Received a System Message.");
}
};
}
Finding the list of available Game Events:
Each version of the game is different here, so this is where you will need to be careful. By that I mean, some versions of the game may have an event type, but a different version may not. Blizzard was not always consistent in their name accross different versions of the game, so please be careful to test against multiple versions of the game.
Open DotPeek
Search for "LuaEventsID"
Double Click LuaEventsId in the Assembly Explorer Window.
A window will open displaying a list of Events.
What do each of these Events mean?
WoW Event Reference: http://wowwiki.wikia.com/wiki/Event_API
(Reminder! Some of these may be different in different versions of the game.)
Watching For WRobot State Changes
In addition to in game events, there are also WRobot 'states'. Similar to Game Events, WRobot states are the particular condition that WRobot is in at a specific time. For example, there is a state called 'MillingState', and another called 'Looting' that come out with WRobot. States are managed by the WRobot FiniteStateMachineEvents Engine. When a State occurs/changes/ends/etc, an event is passed to the FiniteStateMachine (pardon my wording here if this is not 100% correct). There are three main events that we can use to manage our States.
State Events that occur:
OnBeforeCheckIfNeedToRunState - This can be used to CANCEL an event if specific conditions are met.
OnRunState - This can be used to do something just as the State is being started.
OnAfterRunState - This can be used to do something just as the State has completed.
Example of OnRunState and OnAfterRunState
In this example we are watching for when WRobot starts the ToTown State and when it finishes it. We create a boolean that is set to true when the state is started, and then set it to false when the State is completed. I recommend adding the initializeToTownWatcher() function in the Initialize function of a plugin, or somewhere where it will only be called once. For example of this, please see my Plugin Template.
bool goToTown = false;
private void initializeToTownWatcher() {
robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
{
if (state != null && state.DisplayName == "To Town")
{
goToTown = true;
Logging.Write("Going to Town State has been initiated.");
}
};
robotManager.Events.FiniteStateMachineEvents.OnAfterRunState += (engine, state) =>
{
if (state != null && state.DisplayName == "To Town")
{
goToTown = false;
Logging.Write("We have completed going To Town State.");
}
};
}
Example of OnBeforeCheckIfNeedToRunState
In this example, we catch the state with the name of To Town and cancel it by setting the passed in cancelable parameter to true.
private void cancelToTownState() {
robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
{
if (state != null && state.DisplayName == "To Town")
{
Logging.Write("We have cancelled the To Town State");
cancelable.Cancel = true;
}
};
}
Where can I find other WRobot States?
Each version of the WRobot is different, so some versions of WRobot may have a state type, but a different version may not. Please be careful to test against multiple versions of the game/WRobot.
Open DotPeek
Expand wManager Module
Expand wManager.Wow.Bot.States namespace.
MORE TBA....
The above is my attempt at trying to help newcomers to WRobot at writing their own plugins / fight classes / etc. If there are any questions , suggestions, or even corrections, please do let me know in the comments and I'll be sure to add/update things as they come up!