Jump to content
  • NoMemoryEdit shortcut


    Matenia
    • Version: All Product: WRobot General Type: Bug Status: Not a Bug

    Hey Droidz,

    for my framework, I set focus and mouseover units to make casting on off targets more easily possible. 
    Can you add the option to still write mouseover guid via wRobot API? I think ObjectManager.Me.FocusGuid Setter still works just fine. 

    Or is there at least a check like Usefuls.CanWriteToMemory?
    Then MAYBE I can think of a workaround. But currently it breaks some of my stuff.

    For Mouseover via ObjectManager.Me.MouseoverGuid, if you want:
     

    private static void SetMouseoverGuid(ulong guid)
        {
            switch (Usefuls.WowVersion)
            {
                case 5875:
                    Memory.WowMemory.Memory.WriteUInt64((uint)Memory.WowMemory.Memory.MainModuleAddress + 0x74E2C8, guid);
                    break;
                case 8606:
                    Memory.WowMemory.Memory.WriteUInt64((uint)Memory.WowMemory.Memory.MainModuleAddress + 0x86E950, guid);
                    break;
                case 12340:
                    Memory.WowMemory.Memory.WriteUInt64( 0x00BD07A0, guid);
                    break;
                default:
                    throw new Exception("Wow version is not supported!");
            }
        }



     



    User Feedback

    Recommended Comments

    Update: It seems this actually works... It's weird, sometimes it seemed to break. 
    I'd write the mouseover guid, call Lua.LuaDoString($"CastSpellByName('{name}', 'mouseover')") and nothing happens. It seems almost like the WoW client breaks for a bit. Happens on Warmane only I guess and I can't really reproduce it.

    Link to comment
    Share on other sites

    Yes, thank you. I noticed this is a different issue that seems to taint some Lua functions on Warmane somehow. I cannot reproduce it reliably, so for now it's okay.

    Link to comment
    Share on other sites

    Hello @Droidz,

    I found the issue, I think. It's a multi threading issue, I think.
    If you call Lua.LuaDoString twice within the same framelock there are some Lua variables that get restored to their incorrect state.
     

    Pseudo code:

    -- first thread
    local _protectedFunctionSave = protectedFunction;
    protectedFunction = function(abc)
    	return expectedValueForAntiCheat;
    end
    -- do actual lua code here
    -- !first thread
    
    -- before this function is restored another thread comes and does this
    -- second thread:
    local _protectedFunctionSave = protectedFunction; -- this is now the wrong function we are saving
    protectedFunction = function(abc)
    	return expectedValueForAntiCheat;
    end
    -- !second thread
    
    -- first thread
    protectedFunction = _protectedFunctionSave; -- original is restored correctly
    -- !first thread
    
    -- second thread
    -- do actual lua code here
    protectedFunction = _protectedFunctionSave; -- wrong function is restored and breaks client a bit
    -- !second thread

    Is this possible? If yes, maybe thread-lock Lua class?

    Link to comment
    Share on other sites

    No, I do not. But I know you do (CastSpellByName). 
    I think that is causing it eventually to be corrupted. 

    It's just a guess because someone CastSpellByName stops working after a while on WotLK.

    Link to comment
    Share on other sites

    CastSpellByName is modified by some servers.

    WRobot (and wow) run lua script by script (lua is not multithread in wow). 

    Maybe, if you lua code crash sometime you don't restore function?

    try code like:

    if not randomNameProtectedFunctionSave then
    	randomNameProtectedFunctionSave = protectedFunction;
    end
    protectedFunction = function(abc)
    	return expectedValueForAntiCheat;
    end
    
    
    YOUR CODE HERE....
    
    
    protectedFunction = randomNameProtectedFunctionSave

    (for the session use same name for "randomNameProtectedFunctionSave" (and don't use local var))

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...