Skygirl779
-
Posts
4 -
Joined
-
Last visited
Reputation Activity
-
Skygirl779 reacted to reapler in Left click unit
Yes, you can. For example:
//3.3.5a 12340 public void MoveForwardStart() { wManager.Wow.Memory.WowMemory.InjectAndExecute( new [] { //more parameters can be appended by the wrapper wManager.Wow.Memory.WowMemory.CallWrapperCode( (uint)wManager.Wow.Memory.WowMemory.Memory.MainModuleAddress + 0x1FC200), wManager.Wow.Memory.WowMemory.RetnToHookCode, }, true ); }
-
Skygirl779 reacted to reapler in Left click unit
This should gonna do its work:
public void Target(ulong guid) { wManager.Wow.Helpers.Lua.RunMacroText("/target "+wManager.Wow.ObjectManager.ObjectManager.GetObjectByGuid(guid)?.Name+""); } Edit: i reconsider my answer, this may not be a ideal solution.
If you gonna look at the interact function in WRobot, you'll notice it's a direct function call via asm.
So another solution would be to overwrite the guid from the local player's focus and target it via lua:
public void Target(WoWObject obj) { var tmp = ObjectManager.Me.FocusGuid; ObjectManager.Me.FocusGuid = obj.Guid; Lua.RunMacroText("/target focus"); ObjectManager.Me.FocusGuid = tmp; } public void Target(ulong guid) { var tmp = ObjectManager.Me.FocusGuid; ObjectManager.Me.FocusGuid = guid; Lua.RunMacroText("/target focus"); ObjectManager.Me.FocusGuid = tmp; } Usage:
var firstOrDefault = ObjectManager.GetObjectWoWUnit().OrderBy(i => i.GetDistance).FirstOrDefault(); if (firstOrDefault != null) Target(firstOrDefault.Guid);
-
Skygirl779 reacted to Matenia in Left click unit
A SPECIFIC unit? You can take a look at (decompile) how Droidz does it in the "Interact" class in the Helper namespace (lots of memory writing).
If not, use
Lua.LuaDoString(TargetEnemy("name")) (I think) or
Lua.RunMaroText("/target name")