Jump to content

Droidz

Administrators
  • Posts

    12433
  • Joined

  • Last visited

Posts posted by Droidz

  1. Hello,

    Your code is wrong, the code would look more like this (not tested):

    using System.Linq;
    using System.Windows.Forms;
    using robotManager.Helpful;
    using wManager.Wow.Bot.States;
    using wManager.Wow.Helpers;
    using wManager.Wow.ObjectManager;
    
    public class Main : wManager.Plugin.IPlugin
    {
        public void Initialize()
        {
            robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
            {
                if (state is IsAttacked &&
                    Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
                {
                    var enemies = ObjectManager
                        .GetObjectWoWPlayer()
                        .Where(u =>
                            u.IsValid &&
                            u.IsAlive &&
                            u.PlayerFaction != ObjectManager.Me.PlayerFaction &&
                            u.IsTargetingMe &&
                            u.InCombatFlagOnly
                        );
                    if (enemies.Any())
                    {
                        var enemy = enemies.First();
                        Logging.Write($"Attacking player {enemy.Name} in response to being attacked.");
                        Fight.StartFight(enemy.Guid);
                    }
                }
            };
        }
    
        public void Dispose()
        {
            Logging.Write("Disposed.");
        }
    
        public void Settings()
        {
            MessageBox.Show("No settings for this plugin.");
        }
    }

     

  2. Hi, I'm sorry, but this cannot be implemented securely with a plugin. By default, WRobot should change the machine name (wotlk) (provided that the game is always launched from the Relogger if you want to hide all time the name of your machine).

  3. Hello,

    Have you tried disabling the plugins/fightclass one by one (or replacing them) to see if one of them might be the cause? Also consider WoW addons, the game cache, or even trying with a new client.

    Using the Relogger could be a temporary solution (it will restart the game and the bot in case of a crash).

    But I don't see any errors in the log file.

  4. On 3/12/2024 at 6:50 PM, dravrah said:

    hey  @Droidz

    how to add these codes into the IsCompleteCondition?

    thanks a lot!

    ss.thumb.jpg.8720fc72e3c59f14d61d861f7b59e5aa.jpg

    Hello, you can replace new line by space, or use multiline c# string:
     

    return Lua.LuaDoString<bool>("local id = 6673; local nSearch = GetSpellInfo(id); if nSearch then local i = 1 while true do local spellName, spellRank = GetSpellName(i, BOOKTYPE_SPELL) if not spellName then break end if nSearch == spellName then return true; end i = i + 1 end end return false;");

     

  5. Hello,

    I'm sorry but WRobot does not support custom game clients.

    You can try to change the behavior with a plugin, but it might be complicated, here is an example of code (not tested):

     

    using System.Linq;
    
    public class Main : wManager.Plugin.IPlugin
    {
        public void Initialize()
        {
            robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
            {
                if (state is wManager.Wow.Bot.States.Regeneration)
                {
                    var units = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWUnit();
                    units.AddRange(wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWPlayerTargetMe());
                    foreach (var unit in units.OrderBy(u => u.GetDistance))
                    {
                        if (unit.IsValid &&
                            unit.IsAlive &&
                            unit.GetDistance < 40 &&
                            unit.Reaction <= wManager.Wow.Enums.Reaction.Neutral &&
                            //unit.InCombatFlagOnly &&
                            unit.IsTargetingMe)
                        {
                            var failGuid = wManager.Wow.Helpers.Fight.StartFight(unit.Guid);
                            if (failGuid != 0)
                            {
                                wManager.wManagerSetting.AddBlackList(failGuid, 30*1000);
                            }
    
                            return;
                        }
                    }
                }
            };
        }
    
        public void Dispose()
        {
        }
    
        public void Settings()
        {
        }
    }

     

×
×
  • Create New...