I've searched through the forum here to try to find out what I've done wrong, but can't figure it out. I've looked at several examples, such as WoWXFramework, Apoc's Lua wrapper, and briefly at cleanCore. I've injected a DLL and have Endscene pulsing my function every frame (so I assume that confirms I'm in the main thread). From this pulse, I'm trying to call a very simplified version of DoString, since none of the examples including return values are working for me.
Code:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void DoStringDele(string lua, string fileName, uint pState);
public static DoStringDele _do = null;
public static void Pulse()
{
Process.EnterDebugMode();
MemoryOpen();
if (_do == null)
{
MessageBox.Show("Handler nulll. Registering Delegate");
_do = Helper.Magic.RegisterDelegate<DoStringDele>(Helper.WoWBase + 0x3AE6A0);
}
_do("DoEmote(\"dance\")", "Fake.lua", 0);
}
The code isn't really doing anything. I know it's being run, because the messagebox will show once only, even though it continues to pulse through endscene. My character doesn't dance, or anything. What am I doing wrong here?