arkhan
-
Posts
131 -
Joined
-
Last visited
Reputation Activity
-
arkhan reacted to Droidz in [TAURI] Wrobot detected
I found how they detect WRobot I'll fix it in next update
-
arkhan got a reaction from Matenia in How is botting at tauri
Tauri is the best MOP server out there.
Months ago, no ban mainly because this was not a priority for the devs and they even claim that on forum and mail (in game).
At this moment, i can't tell you if the devs change their mind.
-
arkhan reacted to Mattrix in bot don't go selling
U can download and use an addon like sell-o-matic for selling items, so if the bot go to the vendor but he doesn't sell items the addon will do it :)
-
arkhan reacted to FNV316 in bot don't go selling
Sometimes plugins aren't fully disposed when stopping the bot. Probably what happened.
Np.
-
arkhan reacted to FNV316 in bot don't go selling
Try to disable the HumanMasterPlugin and check if it it's working. I had some issues with it too, if automatically choose vendor is enabled.
-
arkhan reacted to headcrab in [Battleground] It mounts before buffing
for me this code helps
static Main(){ robotManager.Events.FiniteStateMachineEvents.OnAfterRunState += (engine,state) => { if (state == null) return; if (state is ResurrectBG) { Usefuls.WaitIsCasting(); Usefuls.WaitIsCasting(); Usefuls.WaitIsCasting(); } }; } just need some pause to cast 2-3 buffs
-
arkhan reacted to Matenia in C# Framework for wRobot 1.12.1 Fightclasses
Hey guys,
I recently ported some of my fightclass framework to vanilla. I'm happy with where it currently is but will probably push updates.
You can find a working version (and any future update) in my repository on GitHub. This framework is intended for all the developers on the wRobot Discord channel who keep working on the same issues over and over again. Hopefully this will encourage people to make pull requests and contribute to an overall community effort.
Also, hopefully it will help with some of the more regular Discord users not having to answer a lot of questions over and over.
Enjoy:
https://github.com/Schaka/VanillaFightclassFramework
-
arkhan reacted to camelot10 in Unstuck in fly
wManager.Events.MovementEvents.OnSeemStuck += OnSeemStuck;
-
arkhan reacted to Apexx in Hunter Pet Management (Fight Class)
I added a small sleep time before trying to launch the spell and it seems to help.
public static bool CallPet() { try { if (!Me.IsCast && !Me.IsMounted && _callPet.KnownSpell && _callPet.IsDistanceGood && _callPet.IsSpellUsable) { Thread.Sleep(800); _callPet.Launch(); Thread.Sleep(SpellManager.GlobalCooldownTimeLeft() + Usefuls.Latency); return true; } } catch (Exception e) { Logging.WriteError("CallPet() ERROR: " + Environment.NewLine + e); } return false; } public static bool RevivePet() { try { if (!Me.IsCast && !Me.IsMounted && Me.ManaPercentage > 80 && _revivePet.KnownSpell && _revivePet.IsDistanceGood && _revivePet.IsSpellUsable) { Thread.Sleep(800); _revivePet.Launch(); Thread.Sleep(SpellManager.GlobalCooldownTimeLeft() + Usefuls.Latency); return true; } } catch (Exception e) { Logging.WriteError("RevivePet() ERROR: " + Environment.NewLine + e); } return false; }
-
arkhan got a reaction from Marsbar in move back if... add code in fightclass editor
static Main() { wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => { if (unit.IsValid && ObjectManager.Target.IsTargetingMyPet && ObjectManager.Target.GetDistance <= 5) { wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey, 1500); } }; } 1)not tested, but that doesn't check if they are an obstacle behind you.
2) you could do more properly by using
MovementManager.Go(PathFinder.FindPath(ObjectManager.Me.Position, new Vector3(ObjectManager.Me.Position.X, ObjectManager.Me.Position.Y + 15, ObjectManager.Me.Position.Z))); For example
-
arkhan reacted to kraszus in move back if... add code in fightclass editor
Excellent..will try it out
[EDIT] Works a treat. Thanks Arkhan :)
-
arkhan got a reaction from kraszus in move back if... add code in fightclass editor
static Main() { wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => { if (unit.IsValid && ObjectManager.Target.IsTargetingMyPet && ObjectManager.Target.GetDistance <= 5) { wManager.Wow.Helpers.Move.Backward(Move.MoveAction.PressKey, 1500); } }; } 1)not tested, but that doesn't check if they are an obstacle behind you.
2) you could do more properly by using
MovementManager.Go(PathFinder.FindPath(ObjectManager.Me.Position, new Vector3(ObjectManager.Me.Position.X, ObjectManager.Me.Position.Y + 15, ObjectManager.Me.Position.Z))); For example
-
arkhan reacted to Avvi in Avvi's C# Tips & Tricks with Helpful Code Snippets
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!
Thanks,
- Avvi
-
arkhan reacted to reapler in How to get angle or rotation info?
Hello, this should work:
private static double ActualRotation(double value, double min, double max) { if (value < min) return min; return value > max ? max : value; } public static double CalculateFacingCenter(Vector3 source, float playerRotation, Vector3 destination) { Vector3 v2 = destination - source; v2.Z = 0.0f; Vector3 v1 = new Vector3((float) Math.Cos(playerRotation), (float) Math.Sin(playerRotation), 0.0f); return Math.Acos(ActualRotation(Vector3.Dot(ref v1, ref v2) / (v2.Magnitude() * (double) v1.Magnitude()), -1.0, 1.0)); } And additional snippets which could help you:
/// <summary> /// Used to calculate new position by parameter. /// </summary> /// <param name="from">The position to calculate from.</param> /// <param name="rotation">The rotation of the object in radians.</param> /// <param name="radius">The radius to add.</param> /// <returns></returns> public Vector3 CalculatePosition(Vector3 from, float rotation, float radius) { return new Vector3(System.Math.Sin(rotation) * radius + from.X, System.Math.Cos(rotation) * radius + from.Y, from.Z); } /// <summary> /// Used to calculate atan2 of to positions. /// </summary> /// <param name="from">Position 1.</param> /// <param name="to">Position 2.</param> /// <param name="addRadian">Radians to add.</param> /// <returns></returns> public float Atan2Rotation(Vector3 from, Vector3 to, float addRadian = 0) { return (float) System.Math.Atan2(to.Y - from.Y, to.X - from.X) + addRadian; } /// <summary> /// Used to face to the desired position. /// </summary> /// <param name="to">The position to face.</param> /// <param name="addRadian">Radians to add from the position.</param> public static void Face(Vector3 to, float addRadian = 0) { wManager.Wow.Helpers.ClickToMove.CGPlayer_C__ClickToMove(0, 0, 0, wManager.Wow.ObjectManager.ObjectManager.Me.Guid, 2, (float)System.Math.Atan2(to.Y - wManager.Wow.ObjectManager.ObjectManager.Me.Position.Y, to.X - wManager.Wow.ObjectManager.ObjectManager.Me.Position.X)+addRadian); } Usage for second block(i guess first one should be understandable)
//turn 180° Face(ObjectManager.Target.Position, (float)System.Math.PI); //turn left Face(ObjectManager.Target.Position, 1.53589f);//88° = 1.53589 rad //turn right Face(ObjectManager.Target.Position, -1.53589f);//88° = 1.53589 rad
-
arkhan reacted to reapler in FC - Settings bug
Hello @arkhan, i've re-created it:
public void ShowConfiguration() { CustomClass_ShamanSettings.Load(); CustomClass_ShamanSettings.CurrentSetting.ToForm(); CustomClass_ShamanSettings.CurrentSetting.Save(); } public class CustomClass_ShamanSettings : Settings { public static CustomClass_ShamanSettings CurrentSetting { get; set; } public bool Save() { try { return Save(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName)); } catch (Exception e) { Logging.WriteError("CustomClass_ShamanSettings > Save(): " + e); return false; } } public static bool Load() { try { if (File.Exists(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName))) { CurrentSetting = Load<CustomClass_ShamanSettings>(AdviserFilePathAndName("CustomClass_Shaman", ObjectManager.Me.Name + "." + Usefuls.RealmName)); return true; } CurrentSetting = new CustomClass_ShamanSettings { UGW = true, TGW = 4, MGW = 50 }; } catch (Exception e) { Logging.WriteError("CustomClass_ShamanSettings > Load(): " + e); } return false; } [Setting] [Category("GHOST WOLF SETTINGS")] [DisplayName("Ghost Wolf")] [Description("Use Ghost Wolf")] public bool UGW { get; set; } [Setting] [Category("GHOST WOLF SETTINGS")] [DisplayName("Use after X secondes")] [Description("Use Ghost Wolf after X secondes out of combat")] public int TGW { get; set; } [Setting] [Category("GHOST WOLF SETTINGS")] [DisplayName("Mana required")] [Description("Use Ghost Wolf only if mana is superior or equal")] public int MGW { get; set; } }
-
arkhan got a reaction from reapler in Quest Editor
I've never encounted a situation where i needed to write more than one ID. But I've only do quest 1-80 for cataclysm + mop, so maybe for legion or vanilla is required but i doubt of it.
Same, so far i've tested, only the id is important.
Hum, the only thing who came to my mind is to make quest profile quicker. When i need to fill the quest form (KillandLoot, Gatherer, ...) Find the creatures, GameObject and click again to set up their position is really annoying.
But I've saw in the dev. tools you enter the id/Name of the creature and that return all the position where the bot find this creature/GameObject.
Maybe there is a way to make a button with ID or Name and click on it to fill up the positions automaticaly?
Anyway great job.
-
arkhan reacted to iMod in I'm looking for Distance of target
Distance check:
ObjectManager.Me.TargetObject.GetDistance Unit check:
//Exists? if (ObjectManager.GetWoWUnitHostile().Where(u => u.Entry == 12345).Any()) { // Do something } You can easy extent the conditions for example "&& u.Distance < 40" ect.
-