Jump to content

Ordush

Elite user
  • Posts

    1167
  • Joined

  • Last visited

Posts posted by Ordush

  1. 14 minutes ago, Zan said:

    This doesn't work?

    
    public float Range { get { return FightClassSettingsHere; } }

     

    Well, yes it does. But since it's read-only i can only set it once. I wanted to change Range based on conditions. :)

    Edit: LoL.Brainfart.. nevermind.. how did i not see the "return" rofl..
    Works fine. :)

  2. Hey all

    I set the combat range in the top of my C# With the code @Droidz has provided.

    public float Range { get { return CombatRange; } }

    It seems that, it doesn't work if i don't set it as read-only (get).
    I want to be able to change the range from fightclass settings, does anyone know how to get this to work? :)

    Added this here, since it's more a all around thing, than vanilla only. :)

  3. 9 minutes ago, Marsbar said:

    I say you do it the LoS way with TraceLine, you wouldn't want to walk around a wall and then not be able to shoot your target right? Because the result success would give you a true if it can make a path even if that means going around a wall.

    Then if you don't have LoS adjust your vector either direction until you do, sort of how I explained here: https://wrobot.eu/forums/topic/7507-solved-move-after-frost-nova-is-it-really-that-hard/?do=findComment&comment=34304

    THEN to make it even better check if there are hostiles where your path will go and adjust again. Maybe also add a failsafe so that if it cannot find a path, stay in melee? It's what a legitimate user would do too rather than run into other mobs.

    Mine is checking for both, so if it can't find a path, but it is in LoS then it won't try.
    I gave it 4 seconds to find it's way to a spot it thinks it can go to (failsafe). :)

  4. 12 minutes ago, Matenia said:

    PathFinder.FindPath has an API for checking if the path it made is valid. You can also use !TraceLine.Go(vector3) to check that LoS is available to the vector from your position.
    Using those tools, you should be able to find a vector where no enemy is in sight (by periodicially checking LoS and enemy positions in ObjectManager) around your character. 

    You can also use PathFinder.ReportDangerArea(vector3, radius) to tell the pathfinder to avoid this area (e.g. mob + aggro radius) while running away. But in my experience this is iffy and you should do your own "pathfinding" for small paths when not runnign very far away.

    Cheers @Matenia

    I will try see if i can get something to work with this. :)
    Vector3 to, out bool resultSucess is what i'd use to see if it can go to Vector3 right?

  5. @Droidz

    I thought it would be better to necro this thread, than making a new one

    Is there a way to check if there is any viable spots available?
    Instead of using backtrack I have tried using the pathfinder with
     

    var xvector = (ObjectManager.Me.Position.X) - (ObjectManager.Target.Position.X);
    var yvector = (ObjectManager.Me.Position.Y) - (ObjectManager.Target.Position.Y);
    
    Vector3 newpos = new Vector3()
    {
      	X = ObjectManager.Me.Position.X + (float)((xvector * (25 / ObjectManager.Target.GetDistance) - xvector)),
    	Y = ObjectManager.Me.Position.Y + (float)((yvector * (25 / ObjectManager.Target.GetDistance) - yvector)),
    	Z = ObjectManager.Me.Position.Z
    };
    	MovementManager.Go(PathFinder.FindPath(newpos), false);
    	Thread.Sleep(1700);

    This is ofc. in a loop.
    Now this will move my char 8-9 yards from the target walking in a straight line backwards using the pathfinder. However the issue remains the same, that if i hit a wall it will keep going. Here i can use your code written above to stop moving.

    Instead of this, is there a way that i can, using the pathfinder: Find a place where there is 9 yards free from the target instead?

  6. Imagine your fightclass being a text with instruments, where each instrument can't be read without reading the other instruments coming before it first.
    So it reads form top to buttom, then it repeats. (Loop).

    The amount of instructions it has to read through determines how fast it reads the page.
    So if you have a shit ton of conditions, it'll slow down the reading process. Reading from memory goes faster than looking for in-game lua conditions.
    So if you want the 'reading speed' to increase, you want to decrease the amount of in-game lua conditions or make your overall conditions smarter.
    I will make an example here for you on how you can make your conditions smarter (faster).

    Say you have 4 spells after eachother.
    Spell1 (Cast this if if not in combat, cast this if mana is x%)
    Spell2 (Cast this if not in combat, cast this if mana is y%)
    Spell3 (Cast this if not in combat, cast this if mana is z%)
    Spell4 (Cast this if not in combat, cast this if mana is w%)
    You change this to be smarter like this:
    My4Spells (Cast this if not in combat)
    {
    Spell1 (Cast this if mana is x%)
    Spell2 (cast this if mana is y%)
    Spell3 (cast this if mana is z%)
    Spell4 (cast this if mana is w%)
    }

    this is a very very rough and stupid example, but it should get the point out.
    So in short, to speed up the condition reading. You want:
    1. Memory > Lua conditions
    2. Smart code
    3. If you look at my Vanilla/TBC hunter fightclasses (or any fightclass i have made) you will see right away that i have used TONS of Lua.
    So it can be done, but you want to read through lua as few times as possible. :)
    4. The higher FPS your fightclass has the faster it reads through the page (FRAMES). So increasing the FPS both for the fightclass AND in-game will add a little speed (just like Droidz said it).

    Hope this helps.

  7. Your in-game macro is not using UseItemByName, it's taking what you have in container slot 0,1. This means it will only try to feed your pet with whatever is in that slot.

    You can do the same with your bot with the following Code:

    if GetPetHappiness() < 3 then
      CastSpellByName("Feed Pet")
      PickupContainerItem(0,1)
    end  

    This will make the bot feed the pet with whatever you have in slot 0,1 in your bags (like your macro) if the pet is not happy. :)

    Edit: For the first code snippet to work, you could make a foreach loop and check every slot in your bag for itemname. :)

  8. 4 hours ago, Droidz said:

    Hello, WRobot method "IsSpellUsable" check if spell is not gray in action bar (mana, cooldown, usable on target, ...: https://wow.gamepedia.com/API_IsUsableSpell and https://wow.gamepedia.com/API_GetSpellCooldown ).

    if it is not a spell at cast on self, you need to check if target is in "line of sight" and target distance:

    
    var notInLineOfSight = TraceLine.TraceLineGo(ObjectManager.ObjectManager.Target.Position);
    var isGoodDistance  = spell.IsDistanceGood;

     

    Ah cool.
    @Droidz The most important thing for me was just to know whether or not  it was trying to cast while casting.
    (UnitCastingInfo("player") == nil) :)

  9. Hey all
    i've begun rewritting my fightclases to C#.
    I am using IsSpellUsable which is all nice and good.
    I've looked in the dll, which is obviously obfusticated.
    I can't seem to find heads and toe on what IsSpellUsable does?
    I know that it checks if you have cooldown on spell, and i'm guessing that it checks if target is in line of sight.
    Does it also check if you are already casting something?
    Because i for some spells like frost bolt etc. you don't want to wait with casting till you are not casting, due to the lag making you able to cast faster if you spam the button. :)
    Also what about launch? CastSpellByName ?

  10. 5 minutes ago, Icesythe7 said:

    would it help u any if i could return the name and rank of only known spells?

    Hehe, that's what i wrote above.
    Also easy
    local name, rank = GetSpellInfo("spellID")
    The thing is, i'm a pretty advanced Lua programmer, but the IsSpellKnown is function is what is tricking me.
    I could make it myself and manually add every spellid, then compare the given rank by ID with rank from GetSpellInfo.
    This will take ages, which is why i'm trying to find out how Blizz did it. :)

  11. 1 minute ago, Icesythe7 said:
    
            public bool HasSpellId(int spellId)
            {
                return SpellManager.SpellBook().Any(spell => spell.Id == spellId);
            }

     

    Awesome mate, so it checks the spellbook if it has a spell with given spellid.
    But this is in C#. Is there any way to do this in Lua? (My druid is not made in CS): =/
    I know it can be done in Lua, because blizzard themselves implemented it in WOTLK with the IsSpellKnown Function Which is the one i'm trying to get. :)

  12. Just now, Icesythe7 said:

    So you simply want a function like this 

    
                if (HasSpell(56342))
                {
                    //dosomething
                

     

    Here is EXACTLY what i want to do using my old PQR shadow priest (WOTLK) example. :)

    -- Prayer of Fortitude
    local POFortitude = false
    local POFMat = false
    -- Rank 4
    if IsSpellKnown(48162) then
    	POFortitude = 48162
    	POFMat = "DevoutCandles"
    -- Rank 3
    elseif IsSpellKnown(25392) then
    	POFortitude = 25392
    	POFMat = "SacredCandles"
    -- Rank 2
    elseif IsSpellKnown(21564) then
    	POFortitude = 21564
    	POFMat = "SacredCandles"
    -- Rank 1
    elseif IsSpellKnown(21562) then
    	POFortitude = 21562
    	POFMat = "HolyCandles"
    end

    So i want to check if the player has a spell in a certain rank by ID
    As you can see here: If the player doesn't have Prayer of Fortitude at all, it will make POFortitude false
    If the player does have Prayer of Fortitude rank 2 it will make POFortitude that rank
    Then later when i tell it to cast spell by ID (I cast by ID to make it multi-lang). It will check the bag if it has mat based on POFMat >5 (So it only casts prayer if it has more than 5 mats).
     

  13. 5 minutes ago, Icesythe7 said:

    So you are wanting to input a spell id and return the max rank of that spell if it isknown or nil if it is not known...am i understanding correctly?

    I want to input spell id, then i want it to return true if the player has that spell and nil if the player doesn't.
    If you do GetSpellInfo("AnyID") it will always just post the info in that table no matter if you know the spell or not.
    If you do GetSpellInfo(GetSpellInfo("AnyID")) then IF you know the spell (no matter what rank you have) it will post the table for the highest rank of the spell that spell in your spellbook. (Because you basicly search for name instead of ID).
    What is to check SpellID if player has that spell WITH the rank that follows with the ID then return true
    else return nil, even if it has the Spell but in a lower rank.
    Hope it makes sense. :)

    So in short, not the max rank the player has, that's easy just do GetSpellInfo(GetSpellInfo("AnyID"))
    I want to check for the rank that comes with the ID.

  14. @Matenia

    I figured why this method doesn't work well.
    It sure does work cross language, but you won't be able to rank check with this.
    If you have rank 1 of an ability, it will never do nil no matter what ID you use, be it rank 1 or rank 5 of a spell.
    Reason this has a consequence: Say i want it to buy mats for buffs. Then i won't be able to specify what mats to buy based on what rank is available.

    I could go the long way and check what rank the player has as max (which this will always post if it's not nil). Then set to nil if the known rank (google) for a spell does not mach the rank of the players spell.
    However, it would be a lot easier if i had the wow api function from wotlk+.
    So if anyone knows a way to get the functions from the wow api. (the whole code) please let me know. :)

  15. LOL I just realized i posted in the wrong forum hahaha

    nevermind lol
    The method he posted obviously works fine, he is just using list instead of array.
    My question was simply if i could use array when checking for buffs.
    His answer lead me to the short answer which is no. And the long answer is: Yes if you do a foreach and check every buff 1 buff at a time.
    Sorry Icesythe lol

×
×
  • Create New...