Jump to content
  • [Bug] Overstack overflow Lua


    Sye24
    • Product: WRobot General Type: Bug Status: Unconfirmed
     Share

    Hello @Droidz i was able to find a way for you to find the problem for overstack overflow lua error that causing me problems months ago, 

    the problems comes from EventsLuaWithArgs.OnEventsLuaStringWithArgs, 

     

    how to get the error run this code as a plugin with Wrotation and start fight with two mobs (i used no fightclass) and click both mobs real fast and it will show message stack overflow lua problem.

     

    public class StackOverFlowError
    {
    
        public static void Start()
        {
            EventsLuaWithArgs.OnEventsLuaStringWithArgs += _TargetChanged;
        }
    
        public static void Stop()
        {
            EventsLuaWithArgs.OnEventsLuaStringWithArgs -= _TargetChanged;
        }
    
    
        private static void _TargetChanged(String LuaEvent, List<String> Args)
        {
            if (LuaEvent == "PLAYER_TARGET_CHANGED")
            {
                if (Me.TargetObject != null && Me.TargetObject.IsValid && Me.InCombat)
                {
                    if (Fight.CurrentTarget.Guid != Me.TargetObject.Guid)
                    {
                        Logging.Write("Fight Changed");
                    }
                }
            }
        }
        private static WoWLocalPlayer Me = ObjectManager.Me;
    }

     


     Share


    User Feedback

    Recommended Comments

    18 hours ago, Droidz said:

    Hello, I still can't reproduce your problem, you use updated version?

    image.thumb.png.f96f773d3ef6b50e390d82e8d2497b56.pngYes, all updates. No addons / only this plugin

    no one plugins or fightclass.

    Link to comment
    Share on other sites

    I running this code (plugin) more than 10 minutes and not problem

    using System.Collections.Generic;
    using System.Linq;
    using System.Threading;
    using robotManager.Helpful;
    using wManager.Wow.Helpers;
    using wManager.Wow.ObjectManager;
    
    public class Main : wManager.Plugin.IPlugin
    {
        private static WoWLocalPlayer Me { get { return ObjectManager.Me; } }
        private bool IsRunning { get; set; }
    
        public void Initialize()
        {
            EventsLuaWithArgs.OnEventsLuaStringWithArgs += _TargetChanged;
            IsRunning = true;
            while (IsRunning)
            {
                if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause)
                {
                    try
                    {
                        var ul = ObjectManager.GetWoWUnitAttackables().Where(u => u.IsValid && u.IsAlive && !u.IsMyTarget).ToList();
                        if (!Me.IsMyTarget)
                            ul.Add(Me);
                        if (ul.Count > 0)
                            Interact.InteractGameObject(ul[Others.Random(0, ul.Count - 1)].GetBaseAddress, false, true);
                        else
                            Interact.ClearTarget();
                    } catch {}
                }
                Thread.Sleep(50);
            }
        }
    
        public void Dispose()
        {
            IsRunning = false;
            EventsLuaWithArgs.OnEventsLuaStringWithArgs -= _TargetChanged;
        }
    
        public void Settings() { }
        
        private static void _TargetChanged(string LuaEvent, List<string> Args)
        {
            if (LuaEvent == "PLAYER_TARGET_CHANGED")
            {
                if (Me.TargetObject != null && Me.TargetObject.IsValid && Me.InCombat)
                {
                    if (Fight.CurrentTarget.Guid != Me.TargetObject.Guid)
                    {
                        Logging.Write("Fight Changed");
                    }
                }
            }
        }
    }

     

    Link to comment
    Share on other sites



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...