Jump to content

The Innkeeper's Daughter how to check if known and use it


camelot10

Recommended Posts

Hi. i cant find out how i can check if known/usable and not in cooldown http://www.wowhead.com/item=64488/the-innkeepers-daughter / http://www.wowhead.com/spell=94719/the-innkeepers-daughter#used-by-item

i tryed this:

var list = SpellListManager.SpellIdByName("The Innkeeper's Daughter");
foreach (var id in list)
{
	var name = SpellListManager.SpellNameInGameById(id);
	Logging.Write(" >> id=" + id + " name="+ SpellListManager.SpellNameInGameById(94719)+" know =" + SpellManager.KnowSpell(id)+ " cd=" + SpellManager.GetSpellCooldownTimeLeft(id) +
		" usable=" + SpellManager.SpellUsableLUA(name)+
		" cd=" + SpellManager.GetSpellCooldownTimeLeftBySpellName(name) );

	Logging.Write("exist:" + SpellManager.ExistSpellBook(name));
	Logging.Write("------------------------------");
}

but i get this result:

17:34:45 -  >> id=91226 name=Дочь трактирщика know =False cd=0 usable=False cd=0
17:34:45 - exist:False
17:34:45 - ------------------------------
17:34:45 -  >> id=94719 name=Дочь трактирщика know =False cd=0 usable=False cd=0
17:34:45 - exist:False
17:34:45 - ------------------------------
17:34:45 -  >> id=94727 name=Дочь трактирщика know =False cd=0 usable=False cd=0
17:34:45 - exist:False

didnt get anything usable from decompiling wrobot dlls.

 

also: how i can check hearthstone cooldown left?

any help would be usefull

 

im trying to get this working:

if know("The Innkeeper's Daughter") and not in cooldown > cast "The Innkeeper's Daughter"

else if have("Hearthstone") and not in cooldown > use "Hearthstone"

else Thred.Sleep( hearthstone.cooldown)

 

Link to comment
Share on other sites

only this works

 

	public static void UseHeathstone()
	{
		var name = SpellListManager.SpellNameInGameById(94719);
		Lua.RunMacroText("/cast " + name);
		Thread.Sleep(Usefuls.Latency * 2);
		if (ObjectManager.Me.IsCast)
		{
			Logging.Write("Heathstoning ("+ name+")");
			Usefuls.WaitIsCasting();
			return;
		}
		else if (ItemsManager.HasItemById(6948))
		{
			Logging.Write("Heathstoning");
			ItemsManager.UseItem(6948);
			Usefuls.WaitIsCasting();
		}
		else
		{
			Logging.WriteError("Dont have Heathstone or The Innkeeper's Daughter");
		}
	}

 

Link to comment
Share on other sites

var isKnown = wManager.Wow.Helpers.Lua.LuaDoString<bool>("return IsSpellKnown(91226)");
Logging.Write(" is known 91226= " + isKnown);

isKnown = wManager.Wow.Helpers.Lua.LuaDoString<bool>("return IsSpellKnown(94719)");
Logging.Write(" is known 94719= " + isKnown);

isKnown = wManager.Wow.Helpers.Lua.LuaDoString<bool>("return IsSpellKnown(94727)");
Logging.Write(" is known 94727= " + isKnown);

result:

02:06:53 -  is known 91226= False
02:06:54 -  is known 94719= False
02:06:54 -  is known 94727= False

 

any other ideas ?

Link to comment
Share on other sites

Try to use http://wow.gamepedia.com/API_GetItemCooldown and http://wow.gamepedia.com/API_GetItemCount

var itemId = 64488;
var count = wManager.Wow.Helpers.Lua.LuaDoString<int>("return GetItemCount("+itemId+", nil);");
Logging.Write("Count = " + count);
var timeLeft = wManager.Wow.Helpers.Lua.LuaDoString<double>("local startTime, duration, enable = GetItemCooldown("+itemId+"); return startTime + duration - GetTime();");
Logging.Write("Item Cooldown time left (seconde) = " + timeLeft);

 

Link to comment
Share on other sites

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