Jump to content

Matenia

Elite user
  • Posts

    2226
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Matenia got a reaction from ScripterQQ in Huge banwave of bots 3.3.5   
    This happened on Outland every day since day 1. They ban at least 50 accounts a day. It means nothing, because the bot isn't detected.
    It's just manual reports adding up. If their GMs actually put in any real work, they'd be banning 200 accounts a day. I've been botting on Warmane since day 1, got banned twice after never really logging out and staying in one spot for days.
  2. Thanks
    Matenia got a reaction from Seminko in Making Range a variable   
    You have it correct.

    Now if you have a bool for your fightclass like this
    private bool _IsLaunched = false; private bool ChangeRange = false; private static WoWLocalPlayer Me = ObjectManager.Me; public float Range { get { if(ChangeRange) { return 29f; } return 5f; } } private void Pulse() { while(_IsLaunched) { //check if player not in combat yet, but bot wants to fight its current target //then set ChangeRange to true if target is further away than 12 yards, otherwise false ChangeRange = !Me.InCombat && Fight.InFight && ObjectManager.Target.GetDistance >= 12; Thread.Sleep(100); } } Then you need to call Pulse once in your Initialize method (in your fightclass).
    Pulse should basically be executing your rotation. You can take a look at existing fightclasses like Eeny's to get a better idea at how they work. 
     
    Anyway, that should change your range accordingly. It's possible, that the bot won't react to this right away. If that's the case, you basically have to intercept events and change the range before they fire.
  3. Like
    Matenia got a reaction from Seminko in Warlock keeping multiple targets dotted   
    public static bool CastSpell(RotationSpell spell, WoWUnit unit, bool force) { // targetfinder function already checks that they are in LoS if (unit != null && spell.IsKnown() && spell.CanCast() && unit.IsValid && !unit.IsDead) { if (wManager.wManagerSetting.CurrentSetting.IgnoreFightGoundMount && ObjectManager.Me.IsMounted) return false; Lua.LuaDoString("if IsMounted() then Dismount() end"); if (ObjectManager.Me.GetMove && spell.Spell.CastTime > 0) MovementManager.StopMoveTo(false, 500); if (ObjectManager.Me.IsCast && !force) return false; if (force) Lua.LuaDoString("SpellStopCasting();"); if (AreaSpells.Contains(spell.Spell.Name)) { /*spell.Launch(true, true, false); Thread.Sleep(Usefuls.Latency + 50); ClickOnTerrain.Pulse(unit.Position);*/ SpellManager.CastSpellByNameOn(spell.FullName(), GetLuaId(unit)); //SpellManager.CastSpellByIDAndPosition(spell.Spell.Id, unit.Position); ClickOnTerrain.Pulse(unit.Position); } else { if (unit.Guid != ObjectManager.Me.Guid) { MovementManager.Face(unit); } SpellManager.CastSpellByNameOn(spell.FullName(), GetLuaId(unit)); //Interact.InteractObject also works and can be used to target another unit } return true; } return false; } This is the function I use to cast spells and make sure my bot stops walking, if required.
    Here, spell.IsKnown() and spell.CanCast() are shorthand functions on my spell class to make sure that the spell is not on cooldown and IsSpellUsable is true.
    AreaSpells is just a list of strings containing spell names like Blizzard, Rain of Fire and other targeting AoE spells.
    Then when deciding whether to use buffs (or like combat spells on an enemy), I just check as follows:
    if(Fight.InFight || ObjectManager.Me.InCombat) { //Rotation here, for example CastSpell("Corruption", ObjectManager.Target) }else { //use buffs }  
  4. Like
    Matenia reacted to reapler in Radar3D How to use it?   
    Hello, you can subscribe your method to the event on initialize and unsubscribe on dispose:
    public void Initialize() { Radar3D.Pulse(); Radar3D.OnDrawEvent += Radar3DOnDrawEvent; } public void Dispose() { Radar3D.OnDrawEvent -= Radar3DOnDrawEvent; Radar3D.Stop(); } private static void Radar3DOnDrawEvent() { if (ObjectManager.Target.IsValid) Radar3D.DrawLine(ObjectManager.Me.Position, ObjectManager.Target.Position, Color.Chocolate); Radar3D.DrawCircle(ObjectManager.Me.Position, 5, Color.Chocolate); }  
  5. Like
    Matenia reacted to reapler in How to get angle or rotation info?   
    This should finally do the desired work while the other method was just for calculating :)
    /// <summary> /// Used to get the facing from two positions based on the origin rotation. /// </summary> /// <param name="from">The 1. position.</param> /// <param name="to">The 2. position.</param> /// <param name="originRotation">The origin rotation.</param> /// <returns>Negative radian on the right; positive on the left.</returns> public float FacingCenter(Vector3 from, Vector3 to, float originRotation) { var face = NormalizeRadian(Atan2Rotation(from, to) - originRotation); if (face < System.Math.PI) return -face; return NormalizeRadian(originRotation-Atan2Rotation(from, to)); } /// <summary> /// Used to normalize the input radian. /// </summary> /// <param name="radian">The radians to normalize.</param> public float NormalizeRadian(float radian) { if (radian < 0.0) return (float) (-(- radian % (2.0 * System.Math.PI)) + 2.0 * System.Math.PI); return radian % 6.283185f; } /// <summary> /// Used to calculate atan2 of to positions. /// </summary> /// <param name="from">The 1. position.</param> /// <param name="to">The 2. position.</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; }  
    Usage:
    var rot = FacingCenter(ObjectManager.Me.Position, ObjectManager.Target.Position, ObjectManager.Me.Rotation); if (rot < 0) Logging.Write("Facing to right: "+rot); Logging.Write("Facing to left: "+rot);  
  6. Like
    Matenia 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  
  7. Thanks
    Matenia got a reaction from Apexx in Alot of questions about FightClass and API   
    Yeah, the error message is very clear. Count is a property, you cannot call it like a method (such as "Count(args...)").
    if (ObjectManager.GetUnitAttackPlayer().Where(u => u.GetDistance <= 6).ToList().Count > 2) Should do the trick
  8. Like
    Matenia reacted to Droidz in Bot is spinning at one place, going forward then back again   
    Hello,
    to use elevator you can use this sample: https://wrobot.eu/forums/topic/2681-snippets-codes-for-quest-profiles/?do=findComment&comment=24442
    In WRobot code, I use offmeshconnection for that like: 
    new PathFinder.OffMeshConnection(new List<Vector3> { new Vector3(1900.185, -4362.321, 43.23154), new Vector3(1901.796, -4370.77, 44.39288) {Action = "c#: Logging.WriteNavigator(\"[OffMeshConnection] Ogrimmar > Wait Elevator\"); while (Conditions.InGameAndConnectedAndProductStartedNotInPause) { var elevator = ObjectManager.GetWoWGameObjectByEntry(206609).OrderBy(o => o.GetDistance).FirstOrDefault(); if (elevator != null && elevator.IsValid && elevator.Position.Z <= 44) break; Thread.Sleep(10); }"}, new Vector3(1903.901, -4382.015, 105.6566) {Action = "c#: Logging.WriteNavigator(\"[OffMeshConnection] Ogrimmar > Wait to leave Elevator\"); while (Conditions.InGameAndConnectedAndProductStartedNotInPause) { var elevator = ObjectManager.GetWoWGameObjectByEntry(206609).OrderBy(o => o.GetDistance).FirstOrDefault(); if (elevator != null && elevator.IsValid && elevator.Position.Z >= 105) break; Thread.Sleep(10); }"}, }, (int)ContinentId.Kalimdor),  
  9. Like
    Matenia reacted to Mykoplazma in The WRobot rant (long)   
    Ahh well becuase you dont understand how the gathering bot works :) Everytime where node is in scan range ( you can set it in global settings ) the bot is breaking the standard route and searching routine is generating shortest way to the node. Sometimes between player and the node are trees rocks or other crap and well the pathfinding routine is 'blind' to that things sometimes? ) (well soooome times) and bot will try to get the node and stuck on that crap. The  solution? Reduce searching range to 20 yards and fly over the ground 20 yards when recording. ( i have a tool to set the point exactly 20 yards above the ground and only when I wish the point is added ) I created a perfect path and the bot can fly around 8 hours without any crazy ideas and the water - yest the water just fly higher to prevent some crazy water digging :P And all above all - the bot is for ground mount not for flying mount and the fly mount's landing procedures and avoiding are well - in beta.
  10. Thanks
    Matenia got a reaction from Asoter in 1 Plugin - 2 or more cs files   
    Compile it yourself in Visual Studio into 1 DLL and it'll work just fine.
  11. Like
    Matenia got a reaction from ScripterQQ in Preventing an istant spell to be casted (UNIT_SPELLCAST_SENT)   
    Actionbuttons use the function "UseAction" as far as I'm aware.
    Could try hooking that. I'm not entirely sure how buttons cast the spell internally, but I know it goes through that function at some point.
  12. Like
    Matenia got a reaction from gramdeck in Npc vendoring   
    You can blacklist vendors (tools => blacklist), remove them from your profile (if that's the source).
    You cannot set a main vendor, but you can set your profile to ONLY use vendors from your profile, not your Bot's database.
    In a quester profile, it looks like this:
    <QuestsSorted Action="RunCode" NameClass="wManager.Wow.Helpers.NpcDB.AcceptOnlyProfileNpc = true;" />  
  13. Like
    Matenia reacted to reapler in Heals Casting Twice With Timer   
    Hello, i've created a small example for this, everything else is explained in the comments:
    using System; using System.Collections.Generic; using System.Threading; using wManager.Plugin; using wManager.Wow.Class; using wManager.Wow.Enums; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using static robotManager.Helpful.Logging; public class Main : IPlugin { #region Variables private bool _isLaunched; private int _msDelay = 200; private DateTime _unlockTime = DateTime.Now; private readonly HashSet<string> _noGcdSpells = new HashSet<string> { "Counterspell", //... //http://wowwiki.wikia.com/wiki/Cooldown => Abilities noted for not affecting nor being affected by the global cooldown: }; #endregion #region Properties public bool GcdActive => DateTime.Now < _unlockTime; #endregion #region WRobot Interface public void Initialize() { var pGuid = ToWoWGuid(ObjectManager.Me.Guid); EventsLuaWithArgs.OnEventsLuaWithArgs += delegate(LuaEventsId id, List<string> args) { if ( id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED && args[2] == pGuid && !_noGcdSpells.Contains(args[9]) && ( args[1] == "SPELL_CAST_SUCCESS" || args[1] == "SPELL_HEAL" || args[1] == "SPELL_DAMAGE" ) ) { Write("lock"); _unlockTime = DateTime.Now.AddMilliseconds(_msDelay); } }; _isLaunched = true; Write("Loaded"); while (_isLaunched) { try { if (Conditions.ProductIsStartedNotInPause) { Pulse(); } } catch (Exception e) { WriteError(e.ToString()); } Thread.Sleep(30); } } public void Dispose() { _isLaunched = false; } public void Settings() { } #endregion #region Pulse public void Pulse() { var spell = new Spell("Lesser Heal"); if (!GcdActive && spell.IsSpellUsable && !ObjectManager.Me.IsCast && ObjectManager.Me.TargetObject.HealthPercent <= 90 ) { spell.Launch(false, false); //will cast the heal if "_msDelay" was passed } /* if (spell.IsSpellUsable && !ObjectManager.Me.IsCast && ObjectManager.Me.TargetObject.HealthPercent <= 90) { spell.Launch(false, false); //.IsSpellUsable is true after gcd was passed but the heal itself can delay //and cause double heal cast if no additional delay is added like above //so ObjectManager.Me.TargetObject.HealthPercent <= 90 would be true for a short time }*/ } #endregion #region Methods public string ToWoWGuid(ulong guid) { var wowGuid = ObjectManager.Me.Guid.ToString("x").ToUpper(); var c = 16 - wowGuid.Length; for (var i = 0; i < c; i++) { wowGuid = "0" + wowGuid; } return "0x" + wowGuid; } #endregion } if you are going to lower the tickspeed this will rarer happens, but it can still happen. Instant spells aren't included.
  14. Thanks
    Matenia got a reaction from Photogenic in Add new step in middle of other steps   
    You have to use the quest editor, then add the step manually in the XML and reload it in the editor.
    There's no way in a quest profile with 500+ steps to do it any other way. Anyone who's used a quester for a good amount of levels before will tell you the same.
  15. Thanks
    Matenia got a reaction from Photogenic in Bot bug sometimes..mount / dismount   
    Should be a latency problem. From what I understand about the source code, the bot sleeps while mounting and doesn't cast any actions until the sleep is over.
    The time to sleep is calculated based on latency, so it checks in <latency> intervals if it needs to sleep for another interval.
  16. Like
    Matenia reacted to reapler in Quest Editor   
    Yes, it will be public. At first only for 3.3.5a then i'm going to continue working on my database for other versions.
  17. Like
    Matenia reacted to reapler in Quest Editor   
    A small update from me:
    Since i'm almost done with the database, i can continue working on my editor again. But my first design wasn't really good. 
    I'm thinking to use a more simpler solution which doesn't require to assign a "Action parameter" at the sorted quests.
    In the end each action define a step which are selectable on the bar like this:
    By the way, if you have a custom pulse like "KillAndLoot",  "Gatherer" or something else which is often used, you are welcome to post it and i can create a seperate setting gui for it.
  18. Like
    Matenia reacted to Richard365 in Droidz - Pathing   
    Droidz, is it possible just to revese the pathing so the WRobot will just walk the pathing in reverse instead of avoid an area?
    I have set certain areas to blacklist, but isn't it simple enough to just make the robot path in reverse?
     
    So in theory:
    it paths forward until it find and area where blockages are high per 10 minutes. Then instead of blacklisting, it will just reverse and walk the pathing the opposite way?
  19. Like
    Matenia reacted to Photogenic in casting mage water?   
    So you can make water but you want to stop it from spamming.
     
    Use condition Item count, and use for example Smaller or equal to 60, so that it casts it when its less than 60. Use item ID.. How to get Item ID ? if you click on development tool, then you click on bag memory info. It will bring the ID numbers of each item exists in your bag. So make some water, do that, get the ID.
     
    or you could use Lua script condition.. see the following link
     
     
  20. Thanks
    Matenia got a reaction from Photogenic in How to use Rogue Poisons?   
    Other people who come here and ask questions are generally willing to put in some time and effort into understanding. I am not asking you to become a programmer. I am not asking you to study software engineering. I am asking you to invest (once!) 2-3 hours to understand the very, very basics, so that you can read/understand (very roughly) the code snippets you are given, as opposed to expecting others to do work for you.
    I know this isn't too much to ask for, because it's no more complicated than learning the fightclass editor (in fact, it's less complicated, because it requires less logic). I also know this isn't too much, because plenty of other people on here and Discord have managed - with zero knowledge - to make something of the code snippets.

    I am not coming at you, but if I didn't feel a general unwillingness to learn, I wouldn't have said anything. Consider this constructive feedback, as I am still trying to help you.

    This one, simple article covers everything you need to know. You'll be able to understand what it is that you're actually doing and the next time someone gives you code that isn't copy-pastable but still correct, you'll know how to apply it.
  21. Thanks
    Matenia got a reaction from Photogenic in How to use Rogue Poisons?   
    private bool HasMainHandEnchant() { return Lua.LuaDoString<bool>("hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = GetWeaponEnchantInfo();", "hasMainHandEnchant"); } This is the C# code I use to determine whether the mainhand is enchanted (has a poison).
    The Lua is right in there. You can choose yourself which language to use.
  22. Like
    Matenia got a reaction from stweily in [Solved] Need Pet happiness macro!   
    if GetPetHappiness() < 3 then CastSpellByName("Feed Pet") UseItemByName("FoodName") end Haven't tested this. Instead of CastSpellByName and UseItemByName you can also just do
    RunMacroText("/cast Feed Pet")
    RunMacroText("/use FoodName")
  23. Like
    Matenia got a reaction from reapler in Condition for Profession   
    This plugin reads profession level through Lua. You can check out the source code.
    Here is the relevant C# code:
    private void SetMiningSkill() { CurrentMining = Lua.LuaDoString<int>(@" miningSkill = 1; for i = 1, GetNumSkillLines() do local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier = GetSkillLineInfo(i) if isHeader and not isExpanded then ExpandSkillHeader(i); end end for i = 1, GetNumSkillLines() do local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier = GetSkillLineInfo(i) if not isHeader and skillName == ""Mining"" then miningSkill = skillRank end end ", "miningSkill"); }  
  24. Thanks
    Matenia got a reaction from nudl in Condition for Profession   
    This plugin reads profession level through Lua. You can check out the source code.
    Here is the relevant C# code:
    private void SetMiningSkill() { CurrentMining = Lua.LuaDoString<int>(@" miningSkill = 1; for i = 1, GetNumSkillLines() do local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier = GetSkillLineInfo(i) if isHeader and not isExpanded then ExpandSkillHeader(i); end end for i = 1, GetNumSkillLines() do local skillName, isHeader, isExpanded, skillRank, numTempPoints, skillModifier = GetSkillLineInfo(i) if not isHeader and skillName == ""Mining"" then miningSkill = skillRank end end ", "miningSkill"); }  
  25. Thanks
    Matenia got a reaction from Photogenic in druid faire fire   
    Spells with () in the name can't be executed by the TBC client unless you add Rank(x). Can confirm what @lonellywolf said, I debugged this last week.
×
×
  • Create New...