How to catch a result Lua string? I used search but not that have found.
How to catch a result Lua string? I used search but not that have found.
lua_doString returns nothing.
I know it and so I ask how do I get.
Use GetLocalizedText, they are lots of example here
Me need only get result lua.
I understand, but has anyone ever been far as decided to use even go want to do look more like?
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
I do Lua_DoString("GetRealZoneText()").
What should I do to get the result?
Read what JuJuBoSc said.
DoString -> GetTop -> ToLString
Ta Da!
If you use C++
Programming in Lua : 25.3
Bye
Last edited by berserk85; 10-08-2009 at 05:25 AM.
DoString -> GetTop -> ToString
How I can understand me need:
Step 1. Enter (Inject) Lua string in WoW.
Step 2. Searching an argument with help GetTop method.
Step 3. Getting result Lua string with help ToString method.
I am writed method for get result lua from WoW, but he doesn't work for me. Where is my error?
Code:public static string GetLocalizedText(BlackMagic w, string szLuaVariable) { uint g_clientConnection = w.ReadUInt((uint)0x012705B0); uint objectManagerBase = w.ReadUInt((uint)(g_clientConnection + 0x00002D94)); uint localGuid = w.ReadUInt((uint)(objectManagerBase + 0xC0)); uint lpLuaVariable = 0; LUA.Synchronize(w); lpLuaVariable = w.AllocateMemory(); w.Asm.Clear(); w.WriteASCIIString(lpLuaVariable + 0x100, szLuaVariable); w.Asm.AddLine("mov ecx, {0}", localGuid); w.Asm.AddLine("push -1"); w.Asm.AddLine("push {0}", lpLuaVariable); w.Asm.AddLine("call {0}", (uint)0x0069ABF0); w.Asm.AddLine("retn"); w.Asm.InjectAndExecute(lpLuaVariable); ResumeThread(wowmainthread); string lpReturnString = w.ReadASCIIString(lpLuaVariable,60); w.FreeMemory(lpLuaVariable); return lpReturnString; }
It has different reasons.
Mainreason:
- You should learn C++-Concepts before trying to work with them on ASM-level. As GetLocalisedText is a this-call it expects an objects address via ecx. For some reason you load a GUID (or better said a part of a GUID, 32bit registers don't really like 8-Byte vars) which will result in memory violations and errors.
Lulzreason:
- You call the function and you do NOTHING with its return value. What the **** is your point in calling it then?