Hello, I'm sorry to disturb you with my 2nd question but here it is:
Code:
private void ClickToMove(float newX, float newY, float newZ)
{
BlackMagic wow = new BlackMagic();
IntPtr BaseWoW = wow.MainModule.BaseAddress;
wow.WriteFloat(0xD02C00 + 0x8C, newX);
wow.WriteFloat(0xD02C00 + 0x8C + 0x4, newY);
wow.WriteFloat(0xD02C00 + 0x8C + 0x4 + 0x4, newZ);
wow.WriteUInt(0xD02C00, 4);
}
for some reason this causes an error:
Code:
system.nullreferenceexception object reference not set to an instance of an object
while doing
Code:
ClickToMove(-585.155f,-4245.82f,38.3248f);
This is rather weird and I see no reason for this not working.
SOLUTION: (Thanks to JuJuBoSc and Yellowspark)
Code:
private void ClickToMove(float newX, float newY, float newZ)
{
var wowProc = (from Process p in Process.GetProcesses() where p.MainWindowTitle.Contains("World of Warcraft") select p.Id).FirstOrDefault();
BlackMagic wow = new BlackMagic();
wow.OpenProcessAndThread(wowProc);
IntPtr BaseWoW = wow.MainModule.BaseAddress;
wow.WriteFloat((uint)BaseWoW + 0xD02C00 + 0x8C, newX);
wow.WriteFloat((uint)BaseWoW + 0xD02C00 + 0x8C + 0x4, newY);
wow.WriteFloat((uint)BaseWoW + 0xD02C00 + 0x8C + 0x4 + 0x4, newZ);
wow.WriteInt((uint)BaseWoW + 0xD02C00 + 0x1C, 4);
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
Also if you don't mind answering another question I have a function which I'd like to return a string but it has some problems with doing that:
Code:
private void GetCharName()
{
BlackMagic wow = new BlackMagic();
IntPtr BaseWoW = wow.MainModule.BaseAddress;
wow.ReadASCIIString((uint)BaseWoW + 0xEAEAA8, 256);
}
Cannot convert 'void' to 'string' is the error.
SOLUTION: (Thank you Yellowspark)
Code:
private string GetCharName()
{
var wowProc = (from Process p in Process.GetProcesses() where p.MainWindowTitle.Contains("World of Warcraft") select p.Id).FirstOrDefault();
BlackMagic wow = new BlackMagic();
wow.OpenProcessAndThread(wowProc);
IntPtr BaseWoW = wow.MainModule.BaseAddress;
return wow.ReadASCIIString((uint)BaseWoW + 0xEAEAA8, 256);
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
I hope you guys will help me with these small problems, thanks in advance! ^^