Jump to content

Matenia

Elite user
  • Posts

    2226
  • Joined

  • Last visited

Posts posted by Matenia

  1. 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.

  2. You are supposed to have minimal understanding of what you're doing. The code can't just be copy pasted as Csharp. 

     

    Take the Lua part of it, so everything in green until the first comma. Then do a Lua condition, as search you put hasMainHandEnchant and as result, you put true (or 1, I'm not 100% sure, but you can look at the API documentation of GetWeaponEnchantInfo to see what it returns). 

    I really think it's time for you to understand the things you're doing here. You constantly expect people to do work for you, so you may profit of it. You expect to be given code snippets that are copy paste ready. 

    The only reason I'm still helping is because you've shared fightclass before and I hope you will contribute to do so. 

    I highly recommend looking at a basic programming course. Even if it's just the first chapter, it would be very useful if you understood variables, functions and types. It would help you read Lua documentation on your own and better understand the code snippets people are giving you. 

    There are some cheap and free JavaScript courses out there. It's extremely similar to Lua and will teach you the basics. 

  3. 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.

  4. 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");
        }

     

  5. 25 minutes ago, reapler said:

    @apexx Namespace System.Linq is not referenced. So you need to copy this on the top of your code:

    
    using System.Linq;

    Both .Where() & .Count() are included in Linq, that's the reason why .Count() couldn't work because it doesn't had an overload available.

    So in the end you can use this:

    
                if (ObjectManager.GetUnitAttackPlayer().Count(u => u.GetDistance <= 6) > 2)
                {
                }

    Or use other Linq methods.

    Didn't know Linq hatd Count() - for some reason I had gotten compile errors before. iMod recently told me I could use .NET later than 4.0 too, maybe that's why I hadn't noticed it so far.

  6. My comment as to it being broken on Warmane is incorrect as of today. I have used it several times successfully.
    If you still have issues, repair the bot as Droidz advised (or better yet do a full reinstall).

    If you have problems with the bot reloading your UI, you most likely have faulty addons fucking with your addon memory. Disable all addons. If this is not the case, the fightclass you chose might be overloading your addon memory.

    I highly recommend using a fightclass that's been proven to work. In @eniac86's log I can clearly see he is trying to use a retail hunter fightclass for 1.12. Things like that can easily mess with the bot.

  7. I think it's finally time you convert your fightclass to C# or buy Jasabi's. 

    What you'll have to do is cancel all events in the fight loop, while your pet (and begin fight, I believe), while your pet has the feeding buff. 

    You can find how to do that on the forums, but you can't easily make that part of an XML fightclass. 

    wManager.Events.FightEvents.OnFightLoop += (WoWUnit unit, CancelEventArgs args) =>
            {
                    while(ObjectManager.Pet.HaveBuff("Feed Pet")
                    {
                        Thread.Sleep(500);
                    }
            };

    Haven't tested this. You might have to use OnFightStart instead of OnFightLoop.

×
×
  • Create New...