Jump to content

Recommended Posts

  On 5/11/2016 at 11:22 PM, saleh said:

Can you please explain what you need to do ?

Expand  

The end goal is to get the player address so I can interact with it, I was planning to get the player object then get the address from that

  On 5/12/2016 at 12:18 AM, saleh said:
Expand  

The player needing to be targeted is constantly changing and isn't known initially, so I can't make a macro for it.  Can you cast a spell on a specific player with LUA? That would work as well.  I am trying to make a healing fightclass that supports raids, since raids are not supported by the bot, atleast in WOTLK, I can get the correct players name that needs to be healed via LUA, but I just need to cast a spell on him.

  On 5/12/2016 at 12:41 AM, saleh said:
Expand  

Do you play retail? Because I messed around with 

Party.GetPartyHomeAndInstance();

and it didn't work for me.  I got the playername of who I need to heal, just need to know how to target him or get the WoWPlayer object with just a playername

Get player object by name:

WoWPlayer player = ObjectManager.GetObjectWoWPlayer().Where(p => p.IsValid && p.Name == "PlayerName").FirstOrDefault();

 

Target player:

Interact.InteractGameObject(player.GetBaseAddress, true);

Cast spell at the specified target:

string targetName = "blubb";
int spellID = 999;
Lua.LuaDoString($"CastSpellByID({spellID}, \"{targetName}\")");

 

Hope it helps.

  On 5/12/2016 at 8:01 AM, iMod said:

Get player object by name:

WoWPlayer player = ObjectManager.GetObjectWoWPlayer().Where(p => p.IsValid && p.Name == "PlayerName").FirstOrDefault();

 

Target player:

Interact.InteractGameObject(player.GetBaseAddress, true);

Cast spell at the specified target:

string targetName = "blubb";
int spellID = 999;
Lua.LuaDoString($"CastSpellByID({spellID}, \"{targetName}\")");

 

Hope it helps.

Expand  

Thanks it does.  Does 

p.IsValid

check if online?  Also, CastSpellByID is protected, you are able to call protected LUA functions through wrobot?

  On 5/12/2016 at 5:14 PM, Brian said:

Thanks it does.  Does 

p.IsValid

check if online?  Also, CastSpellByID is protected, you are able to call protected LUA functions through wrobot?

Expand  

It checks if the object you got is valid to interact with.

Yes you can call protected lua functions.

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...