Jump to content

reapler

Elite user
  • Posts

    288
  • Joined

  • Last visited

Posts posted by reapler

  1. Hello, i tried to reproduce the bug sometimes it happens to me as you can see in the log:

    Spoiler

    13:51:06 - MiningFix:
    farmed Copper Vein (GameObject) : 0x27D54628 : 17370383791809425879 : F1100006C300F1D7
    13:51:07 - [Farming] Farm successful
    13:51:07 - MiningFix:
    Going to farm new node:
    13:51:07 - MiningFix:
    new one is the previous node
    13:51:07 - [Farming] Farm Copper Vein > 360,693 ; 1067,62 ; 105,336 ; "None"
    13:51:11 - MiningFix:
    Going to farm new node:
    13:51:11 - MiningFix:
    new one is the previous node
    13:51:11 - [Farming] Farm Copper Vein > 360,693 ; 1067,62 ; 105,336 ; "None"
    13:51:15 - MiningFix:
    Going to farm new node:
    13:51:15 - MiningFix:
    new one is the previous node
    13:51:15 - [Farming] Farm Copper Vein > 360,693 ; 1067,62 ; 105,336 ; "None"
    13:51:15 - MiningFix:
    check node if still exist
    13:51:15 - MiningFix:
    Node still exist
    =>Cancel mounting
    13:51:19 - MiningFix:
    farmed Copper Vein (GameObject) : 0x27D54628 : 17370383791809425879 : F1100006C300F1D7
    13:51:20 - [Farming] Farm successful
    13:51:20 - MiningFix:
    Going to farm new node:
    13:51:20 - MiningFix:
    new one is the previous node
    13:51:20 - [Farming] Farm Copper Vein > 360,693 ; 1067,62 ; 105,336 ; "None"
    13:51:24 - MiningFix:
    farmed Copper Vein (GameObject) : 0x27D54628 : 17370383791809425879 : F1100006C300F1D7
    13:51:25 - [Farming] Farm successful
    13:51:25 - MiningFix:
    Going to farm new node:
    13:51:25 - MiningFix:
    new one is the previous node
    13:51:25 - [Farming] Farm Copper Vein > 360,693 ; 1067,62 ; 105,336 ; "None"
    13:51:26 - MiningFix:
    farmed Copper Vein (GameObject) : 0x27D54628 : 17370383791809425879 : F1100006C300F1D7
    13:51:27 - [Farming] Farm successful

    I added a delay at farm successful, more log writes & guid condition instead of object. I tested it with stealth as mount but it still worked hehe.

    Hopefully it also works for your flymount: [Tbc]MiningFix.cs

  2. Hello, it is possible. Here's an c# example:

            if (wManager.Statistics.RunningTimeInSec() < 2)
            {
                robotManager.Helpful.Logging.Write("Register OnEventsLuaWithArgs");
                wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs += delegate (LuaEventsId id, List<string> args)
                {
                    if (id == LuaEventsId.UPDATE_MOUSEOVER_UNIT)
                    {
                        string name = Lua.LuaDoString("name = UnitName('mouseover')", "name");
                        int minHealth = 110; //cast heal spells if your mouseover target drops under this value
                        int maxrange = 40; //general range for heal spells
                        WoWUnit unit = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWPlayer().SingleOrDefault(i => i.Name == name);
    
                        if (unit != null
                            && unit.IsValid
                            && unit.IsAlive
                            && unit.GetDistance < maxrange
                            && unit.HealthPercent < minHealth
                            && !TraceLine.TraceLineGo(ObjectManager.Me.Position, unit.Position, CGWorldFrameHitFlags.HitTestSpellLoS))
                        {
                            //here you can add more conditions which spell should be cast
    
                            robotManager.Helpful.Logging.Write("cast heal on mouseover");
                            wManager.Wow.Helpers.SpellManager.CastSpellByNameOn("Flash Heal", "mouseover");
    
                            //here you can start a thread which checks whether you are still mouse over the unit & cast more heals
                        }
    
                    }
                };
                System.Threading.Thread.Sleep(2000);
            }

     

    and the example how it can be implemented in fightclass: mouseover heal example.xml

  3. Hello, for this behavior you need to subscribe lua events with arguments(wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs).

    But i belive the event 'COMBAT_LOG_EVENT_UNFILTERED'  is also not working yet for 2.4.3(https://wrobot.eu/forums/topic/5519-register-combat_log-with-args/).

    If it works you could add a c# code to your fightclass. It could look like this:

            //example
            private void EventsLuaWithArgsOnOnEventsLuaWithArgs(LuaEventsId id, List<string> args)
            {
                if (id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED && args[8] == ObjectManager.Me.Name)
                {
                    if (args[2] == "Polymorph")
                    {
                        Logging.Write("Someone is casting Polymorph on me");
                        ///...
                    }
                }
            }

     

    Otherwise you can use 'UNIT_SPELLCAST_SENT' which should work as intend:

    if (wManager.Statistics.RunningTimeInSec() < 2)
    {
        robotManager.Helpful.Logging.Write("Register OnEventsLuaWithArgs");
        wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs += delegate(wManager.Wow.Enums.LuaEventsId id, System.Collections.Generic.List<string> args)
        {
                if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_SENT && args[3] == wManager.Wow.ObjectManager.ObjectManager.Me.Name)
                {
                    if (args[1] == "Polymorph" || args[1] == "Fear")
                    {
                        robotManager.Helpful.Logging.Write("Someone casts " + args[1] + " on me");
                        wManager.Wow.Helpers.SpellManager.CastSpellByNameOn("Blessing of Sacrifice", "party1");
    			//you could add here a task in case if you are on global cooldown to cast it later
                    }
                }
         };
         System.Threading.Thread.Sleep(2000);
    }

     

     

    and here's an example how you can implement the c# code into your fightclass: BoS example.xml

  4. Hi, for me the mounts are working but maybe this will work for you instead:

                //get the id while mounted
                robotManager.Helpful.Logging.Write("Mount display id: "+ObjectManager.Me.MountDisplayId);
    
    
    
                if (ObjectManager.Me.MountDisplayId == x)//insert id here
                {
                    robotManager.Helpful.Logging.Write("Traveler's Tundra Mammoth found");
                }

     

  5. I think on the grinder side you can't do much more maybe add some spots on the same place maybe. Otherwise you need to write a plugin:

    1. option would be to restart product if player standing still & out of combat & not regen

    2. option would be to write an on behavior to target your npc by entry but so far i've searched you can only get the targetentry by using xml function

    3. option wait til someone fix it up or can offer a better solution ;)

  6. Hello, this should work:

                Grinder.Bot.GrinderSetting.CurrentSetting.ProfileName = "your profile";
                //uncomment here if profile still not changed
                /*
                Grinder.Bot.GrinderSetting.CurrentSetting.Save();
                Grinder.Bot.GrinderSetting.Load();
                Products.ProductRestart(); //maybe needed
                */

     

  7. @jrouten I think you should use 'WriteUInt64'. I guess your returned value from memory is also an ulong(=UInt64) variable like your target.guid. I belive they haven't changed it til legion.

    Otherwise you can check whether the offset is really returning your mouseover guid:

    At first pick any non moving npc and target it. Try to move your character to a position where the npc is on the left corner on the top of your wow window. Now you need to mouse over the npc(tooltip shouldn't disappear) and get out of the window. As next step you can execute this method to check if the offset is returning the right value:

            public void checkoffset()
            {
                uint MouseOverGUID = 0x00F3EDC0;
                if (wManager.Wow.Memory.WowMemory.Memory.ReadUInt64(MouseOverGUID) == ObjectManager.Me.Target)
                {
                    robotManager.Helpful.Logging.Write("offset ok");
                }
                else
                {
                    robotManager.Helpful.Logging.Write("Got different values:\n"
                        +"Read guid from memory: "+ wManager.Wow.Memory.WowMemory.Memory.ReadUInt64(MouseOverGUID) +"\nNeeded guid: "+ ObjectManager.Me.Target);
                }
            }

    If you've done everything right & it still prints different values you have no choice to search it by yourself ;)

    You can take for this task a safe memory tool to search for it or searching it with wrobot in a read loop. First option would be better but i don't know if the tools like cheat engine are safe on live.

     

    In the end i can't offer more help(i have no live-account) so i wish you good luck

  8. So, i wrote a method which works (at least for me):

            [DllImport("user32.dll")]
            static extern bool SetWindowText(IntPtr hWnd, string text);
            public void SetText(string processname, string text)
            {
                IntPtr mainWindowHandle = IntPtr.Zero;
                foreach (var obj in System.Diagnostics.Process.GetProcesses())
                {
                    //or you can search for other parameter / characteristics which wow contains but searching for processname is normaly enough
                    if (obj.ProcessName == processname)// => in my case the executable in my wow folder is Wow.exe
                    {
                        Logging.Write("Process found: " + obj.ProcessName + "[" + obj.Id + "].");
                        mainWindowHandle = obj.MainWindowHandle;
                        break;
                    }
                }
                if (mainWindowHandle != IntPtr.Zero)
                {
                    SetWindowText(mainWindowHandle, text);
                }
                else
                {
                    Logging.Write("No process with the name '" +processname+"' was found.\nPlease check your executable's name.");
                }
            }

    usage:

    SetText("Wow","Hello World!");

     

     

    but remember:

    processname != windowtext => the field "ProcessName" is read only so it can't be changed on running processes. If you really want to change the process' name, you can only influence it on startup or by creating a new process.

     

     

    Edit: this one gets the right one, if several processes exist:

            [DllImport("user32.dll")]
            static extern bool SetWindowText(IntPtr hWnd, string text);
            public void SetText(string processname, string text)
            {
                IntPtr mainWindowHandle = IntPtr.Zero;
                foreach (var obj in System.Diagnostics.Process.GetProcesses())
                {
                    if (obj.ProcessName == processname)// => in my case the executable in my wow folder is Wow.exe
                    {
                        if (wManager.Wow.Memory.PlayerName(obj.Id) == wManager.Wow.ObjectManager.ObjectManager.Me.Name)
                        {
                            Logging.Write("Process found: " + obj.ProcessName + "[" + obj.Id + "][" + wManager.Wow.ObjectManager.ObjectManager.Me.Name+ "]");
                            mainWindowHandle = obj.MainWindowHandle;
                            break;
                        }
                    }
                }
                if (mainWindowHandle != IntPtr.Zero)
                {
                    SetWindowText(mainWindowHandle, text);
                }
                else
                {
                    Logging.Write("No process with the name '" +processname+"' was found.\nPlease check your executable's name.");
                }
            }

     

  9. Hello, it's not possible to change the process name(on runtime => you can retaliate at msdn documentation) and you must specify which IntPtr do you mean:

    There are several IntPtr which you can get from the process but i belive you want the mainwindowhandle? or you can explain for what the IntPtr is needed.

     

    Edit: forgot to write that you can change the process name by simply rename wow.exe but it will doesn't affect the process name while it's running:

    Logging.Write(wManager.Wow.Memory.WowMemory.Memory.GetProcess().ProcessName);

     

  10. Hello, i would like to ask if someone knows an event which fires on generate path requests and also return the start & end position for the requested path.

    The current event which i'm using is "MovementEvents.OnMovementPulse" but it has already generated the path to the destination.

    The reason is why i need that is i want to diminish the effort for my plugin because i don't need the generated path and it's pointless if it takes a few seconds to generate while i only need the start & destination position in the end.

  11. hm i think the database is working as intend maybe it's just the product itself with a missing condition.

    For a workaround you could register the movement events and replace the current moveto/onmovement with your desired npc but it's abit too much work.

    I think you can also resolve the problem with a plugin which lookup the npc database & temporary blacklist the npc by its faction on Initialize():

            foreach (var obj in NpcDB.ListNpc)
            {
                if ((int) obj.Faction != ObjectManager.Me.Faction && obj.Faction != Npc.FactionType.Neutral)
                {
                    wManagerSetting.AddBlackListNpcEntry(obj.Entry, true);
                }
            }

     

  12. Ok @Drumstix66. I've found the problems.

    1. It doesn't started the procedure because your next npc also evaded so it counted to 2000+.

    2. grinder product / internal behavior itself has a bug which is try to regen even while the player was attacked by the blacklisted npc (i belive event-based regen which doesn't check the incombat condition)

    3. it can happen that the behavior that i've written will be ignored by a customclass(but most of the time people play with Fightclasses anyway so i'll take a look into it later)

    I'll implement a better system to support multiple evaded npc & lock regen behavior.

  13. Hello, i made a method in my custom grinder that looks like this:

        public void DoNotDisturb(bool s)
        {
            log("DoNotDisturb: "+s);
            wManagerSetting.CurrentSetting.LootMobs = !s;
            Conditions.ForceIgnoreIsAttacked = s;
            wManagerSetting.CurrentSetting.DontStartFighting = s;
    
            if (s)
            {
                Fight.StopFight();
                Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress);
                Blacklist.AllHostileNpc(30, 10000);
            }
            //if on the way to vendor stop regen
            /*if (s && wManagerSetting.CurrentSetting.FoodPercent != 1)
            {
                //log("Save percent setting: " + wManagerSetting.CurrentSetting.FoodPercent);
                FoodPercent = wManagerSetting.CurrentSetting.FoodPercent;
                DrinkPercent = wManagerSetting.CurrentSetting.DrinkPercent;
                wManagerSetting.CurrentSetting.FoodPercent = 1;
                wManagerSetting.CurrentSetting.DrinkPercent = 1;
            }
            else if (!s)
            {
                //log("restore percent setting" + FoodPercent);
                wManagerSetting.CurrentSetting.FoodPercent = FoodPercent;
                wManagerSetting.CurrentSetting.DrinkPercent = DrinkPercent;
            }*/
        }

    You can uncomment the consumable stuff if you want to use it.

     

    if you wanna check the position of your destination of your path (good to use in a movement event) then this would help you:

                if (MovementManager.CurrentPath.LastOrDefault().DistanceTo(YOURPOSITION) < 5)
                {
                    DoNotDisturb(true);
                }
                else
                {
                    DoNotDisturb(false);
                }

    otherwise this would fit better:

                if (ObjectManager.Me.Position.DistanceTo(YOURPOSITION) > 5)
                {
                    DoNotDisturb(true);
                }
                else
                {
                    DoNotDisturb(false);
                }

     

    Edit:

    I remember that you need the food percent block because the bot will try to regen in combat

  14. Hello you can use this code in quest order editor at runcode:

    ItemsManager.UseItem("Hearthstone");
                        var t = System.Threading.Tasks.Task.Run(async delegate
                        {
                            await System.Threading.Tasks.Task.Delay(10000);
                            //execute this block after 10000ms even after dispose
                            robotManager.Helpful.Logging.Write("execution2");
    
                        });
    //this will be executed immediately
    robotManager.Helpful.Logging.Write("execution1");

    but i guess you just need a simple sleep so it would be:

    ItemsManager.UseItem("Hearthstone");
    System.Threading.Thread.Sleep(10000);
    robotManager.Helpful.Logging.Write("execution1");

     

  15. Hello again, i made a workaround for that if someone is interested(a bit ugly):

        public void Initialize()
        {
            EventsLuaWithArgs.OnEventsLuaWithArgs += Events;
            Lua.LuaDoString
                (
                    "wframe = CreateFrame('Frame') " +
                    "local Frame = true " +
                    "arg = {'1', '2', '3', '4','5', '6', '7', '8', '9', '10', '11', '12','13', '14'} " +
                    "wframe:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') " +
                    "wframe:SetScript('OnEvent', function(self, event, ...) " +
                    
                        "for i=1, 14 " +
                        "do " +
                            "if select(i, ...) == nil or select(i, ...) == '' then " +
                                "arg[i] = '' " +
                            "else " +
                                "arg[i] = select(i, ...) " +
                            "end " +
                        "end " +
                        
                    "RunMacroText('/click '..arg[1]..'§'..arg[2]..'§'..arg[3]..'§'..arg[4]..'§'..arg[5]..'§'..arg[6]..'§'..arg[7]..'§'..arg[8]..'§'..arg[9]..'§'..arg[10]..'§'..arg[11]..'§'..arg[12]..'§'..arg[13]..'§'..arg[14]..'') " +
                    "end) "
                );
    	//...
        }
    
    
    
    
        public void Events(LuaEventsId id, List<string> args)
        {
            //Combatlog
            if (id == LuaEventsId.EXECUTE_CHAT_LINE)
            {
                string[] arg = args[0].Replace("/click", "").Split('§');
                Logging.Write(arg[3]);
                Logging.Write(arg[9]);
            }
        }

     

×
×
  • Create New...