Jump to content

iMod

Elite user
  • Posts

    581
  • Joined

  • Last visited

Posts posted by iMod

  1. 11 minutes ago, reapler said:

    Hello i have also written something similar on another script language. My method was to register the combatlog and set a timer with a boolean value on it when a spell was cast by me(you can add to this latency & some personal preferences to it).

    I've done this, because (for me) the api function wasn't accurate enough.

     

    and you can also add some overloads to your method if you need them for e.g.

    with list debuffs:

    
    public static bool CastSpell(Spell spell, WoWUnit target, double buffTimeLeft = 0, int stacks = 0, List<Spell> debuffs = null, bool owner = true, bool force = false)
    {
    	//...
    }

     

    or with spellname instead:

    
    public static bool CastSpell(string spellname, WoWUnit target, double buffTimeLeft = 0, int stacks = 0, Spell debuff = null, bool owner = true, bool force = false)
    {
    	//...
    }

     

    Thanks, i still had some other overloads but i never used them so they'r gone. So what kind of language are you using for it? I also thought about to use the ingame function instead of lua. I wish i could just use the hook to load my own object manager and own object classes but it seems i have to write my own for it y.y

  2. 9 minutes ago, Dequality said:

    Erh, i made it so that it says "Predatory Swiftness" now where the id was before, but now it just keeps casting regrowth once in combat?`it doesnt need the buff to cast it apparently? @iMod

    This is out of my scope since i just play WOTLK, I'm sorry.

  3. 6 minutes ago, Dequality said:

    I'm currently trying to "fix" @BetterSister 's Legion drood kitten profile, but i can't make it cast regrowth when ever Predatory swiftness procs ? can anyone help me out here .. :) 

    Picture of setup. - Click it to see..  (i couldnt insert from url using i.imgur.com?..) 

    Any help highly appreciatet. 

     

    Dequality.

    You entered the ID in the Name field at the condition ;) may thats the problem?

  4. Hello, I was writing a small method that handles casting spells for me and I'm looking for some improvements for it. May you see some issues.

            /// <summary>
            /// Cast a spell
            /// </summary>
            /// <param name="spell">The spell you want to cast</param>
            /// <param name="target">The target you want to cast at</param>
            /// <param name="debuff">The debuff we are looking for</param>
            /// <param name="buffTimeLeft">Recast if buff time is under the given time</param>
            /// <param name="stacks">How much stacks you want at the target</param>
            /// <param name="owner">Flag that determines if we need to be the owner</param>
            /// <param name="force">Force use the skill and ignore debuffs</param>
            /// <returns>Returns true if we can cast the spell otherwise false</returns>
            public static bool CastSpell(Spell spell, WoWUnit target, double buffTimeLeft = 0, int stacks = 0, Spell debuff = null, bool owner = true, bool force = false)
            {
                // Check if the spell is known
                if (!Functions.IsSpellKnown(spell) || target == null)
                {
                    // Skip
                    return false;
                }
    
                // Check if buff exists
                bool hasDebuff;
                if (debuff != null)
                {
                    hasDebuff = Functions.HasBuff(debuff, target, buffTimeLeft, stacks, owner);
                }
                else
                {
                    hasDebuff = Functions.HasBuff(spell, target, buffTimeLeft, stacks, owner);
                }
    
                // Validate spell
                if (!ObjectManager.Me.IsStunned && !ObjectManager.Me.IsDead && !ObjectManager.Me.IsCast && !target.IsDead && spell.IsSpellUsable && (ObjectManager.Me.Position.DistanceTo(target.Position) <= spell.MaxRange) && (force || !hasDebuff) && !TraceLine.TraceLineGo(target.Position))
                {
                    if (target.Guid == ObjectManager.Me.Guid)
                    {
                        // Cast on self
                        Lua.LuaDoString($"CastSpellByID({spell.Id}, \"player\")");
                    }
                    else if (ObjectManager.Me.TargetObject.Guid == target.Guid)
                    {
                        // Cast on target
                        Lua.LuaDoString($"CastSpellByID({spell.Id}, \"target\")");
                    }
                    else if (ObjectManager.Me.TargetObject.Guid != target.Guid)
                    {
                        // Offset 3.3.5a
                        uint mouseOverGUID = 0x00BD07A0;
    
                        // Set target
                        Memory.WowMemory.Memory.WriteUInt64(mouseOverGUID, target.Guid);
    
                        // Cast on mouseover
                        Lua.LuaDoString($"CastSpellByID({spell.Id}, \"mouseover\")");
                    }
                    else
                    {
                        throw new Exception("Something went wrong with the targeting.");
                    }
    
                    // Log
                    Logging.WriteDebug($"Cast: {spell.NameInGame} at {target.Name}");
    
                    // Wait until global cooldown is done
                    Thread.Sleep(SpellManager.GlobalCooldownTimeLeft());
    
                    // Return
                    return true;
                }
    
                // Return
                return false;
            }

    Would be glad if someone could overlook it.

    Thanks in andvance
    iMod

  5. 1 hour ago, Chiruca said:

    Hi.

    I am trying to make wrobot strafe after using frost nova with my frost mage fight class.

    I am using following C# code and it kind of works:
    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)
                {
                    wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.STRAFELEFT, 250 * 1); // strafe left during 0.25 seconds
                }
            };

    Problem is that it fires, but keeps on looping. Any ideas how I can cancel it again?

    I would try something like

            Keybindings.DownKeybindings(wManager.Wow.Enums.Keybindings.STRAFELEFT);
            Thread.Sleep(250 * 1);
            Keybindings.UpKeybindings(wManager.Wow.Enums.Keybindings.STRAFELEFT);

     

  6. 2 hours ago, Kalos72 said:

    DOes anyone have an excel or anything that has the WoD/Legion ID's they are willing to share?

    I want to try and start my own quest profile and it appears the ID's are the biggest pain in the ass.

    I would be willing to donate for them if needed.

     

    Thanks!

    just use wowhead.com and search for your quest by name
    after you searched the quest take a look at the URL it should look like
    http://www.wowhead.com/quest=35697/peace-offering

    35697 is the ID you are looking for.

    Same for items (item=1234)
    or NPC's (npc=1234)

    Hope that helps

  7.                 // Listen to events
                    EventsLuaWithArgs.OnEventsLuaWithArgs += (LuaEventsId id, List<string> args) =>
                    {
                        if (id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED)
                        {
                            // Set
                            int timeStamp = int.Parse(args[0]);
                            string eventName = args[1];
                            bool hideCaster = bool.Parse(args[2]);
                            // and so on....
                        }
                    }

    Hope that helps.

    Greez iMod

  8. 3 minutes ago, forerun said:

    How to draw the circle using method from wManager Radar drawcircle ( I know how to draw a circle on the screen) but I have problem to make it permanent ( wanna make a permanent trail on the map for creating the best gathering route ). So how to make that circle permanent like when the 3d radar is on? ( orange circles and lines ). Is there an easy solution to do that? If I use the method once it will only blink and if I use it in loop after some time wrbot will crash ^^.

    Do you have any exception? Maybe a threading issue? Normaly you need to call the method for each frame (loop)

  9. I had the same problem and made a small botbase. Try this botbase (product) and tell me if you still have the problems.
    I'm using it for my rotation but never tested if it is working with the xml files.
    Just select the product and your fight class as usually and hit start.
    There are no settings at all since its just a botbase that starts the internal engine.



    Feedback would be nice.

    Deleted

  10. 39 minutes ago, dragonmase said:

    I've been trying to create a raid farming profile. So far I've been able to get the bot to check if there is an enemy in a certain radius around a coordinate using:

    return ObjectManager.GetWoWUnitHostile().Count(u => u.IsAlive && u.Position.DistanceTo(new Vector3(-4588.846f,207.593f, 63.38676f)) < 40) == 0;

    However, the mob I'm trying to check for includes neutral enemies (yellow nameplates). The GetWowUnitHostile command only detects red nameplates units, so I'm missing out on killing a lot of the yellow neutral units. 

    Does anyone know another command which allows me to check for a neutral enemy, or even better, one that allow me to specify the name of the enemy, and at the same time allow me to incorporate the distance vector command as well? (btw I'm super bad a scripting so forgive me is its simple, I just got the above code by modifying someone's profile)

     

    return !ObjectManager.GetObjectWoWUnit().Any(u => u.Entry == 1234 && u.IsAlive && u.Position.DistanceTo(new Vector3(-4588.846f, 207.593f, 63.38676f)) < 40);

    You can replace
    u.Entry == MobID &&

    With
    u.Name == "MobName" &&

  11. 32 minutes ago, dragonmase said:

    I might be wrong, but maybe because the units are dead and are corpses and so doesn't count has hostile mobs for this function?

    Hm could be a reason. Replace it with

    ObjectManager.GetObjectWoWUnit().Count(u => u.Skinnable && u.GetDistance2D <= 40);

    If you just want dead units that are skinnable you need to add "&& u.IsDead"
    Hope that helps

  12. 2 hours ago, burnii said:

    Hey, is there a function that returns the number of skinnable mobs around the player?  or sth similar?

    int count = ObjectManager.GetWoWUnitHostile().Count(u => u.Type == WoWObjectType.Unit && u.Skinnable && u.GetDistance2D <= 40);

    This would return the count of all unit around you in range of 40 yards who are skinnable.

×
×
  • Create New...