wulf
Community Developer
- Joined
- Dec 29, 2010
- Messages
- 1,832
- Reaction score
- 128
Hi guys,
Searched the forum and some dev code but could not find anyone attempting to use Lua to get notInterruptible from UnitCastingInfo.
I want to use my interupts only if the target has a spell i can interupt, rather than just use Me.CurrentTarget.IsCasting
Here is what I have for Casting:
Note: There is an < int > at the end of Lua.GetReturnVal without the spaces (stupid html)
Here is what I have for Channel:
Note: There is an < bool > at the end of Lua.GetReturnVal without the spaces (stupid html)
I feed it Me.Currenttarget so.. InterruptibleChannel(Me.Currenttarget)
It always returns false for channel and 0 for cast....what am I missing ?
Referenced:
UnitCastingInfo
UnitChannelInfo
any help appreciated
EDIT:
The below code works
Not ideal but......does anyone else have anything more elegant ?
Searched the forum and some dev code but could not find anyone attempting to use Lua to get notInterruptible from UnitCastingInfo.
I want to use my interupts only if the target has a spell i can interupt, rather than just use Me.CurrentTarget.IsCasting
Here is what I have for Casting:
Code:
public bool InterruptibleCasting(WoWUnit unit)
{
int CastInterruptibleLua = Lua.GetReturnVal<int>("local name, subText, text, texture, startTime, endTime, isTradeSkill, DcastID, notInterruptible = UnitCastingInfo(" + unit + "); return notInterruptible", 0);
Logging.Write(Color.Red, unit.Guid + " can interupt = " + CastInterruptibleLua);
if (CastInterruptibleLua == 1) return true;
else return false;
}
Note: There is an < int > at the end of Lua.GetReturnVal without the spaces (stupid html)
Here is what I have for Channel:
Code:
public bool InterruptibleChannel(WoWUnit unit)
{
bool ChanInterruptibleLua = Lua.GetReturnVal<bool>("local name, subText, text, texture, startTime, endTime, isTradeSkill, DcastID, notInterruptible = UnitCastingInfo(" + unit + "); return notInterruptible", 0);
Logging.Write(Color.Red, unit.Guid + " can interupt = " + ChanInterruptibleLua);
if (ChanInterruptibleLua) return true;
else return false;
}
Note: There is an < bool > at the end of Lua.GetReturnVal without the spaces (stupid html)
I feed it Me.Currenttarget so.. InterruptibleChannel(Me.Currenttarget)
It always returns false for channel and 0 for cast....what am I missing ?
Referenced:
UnitCastingInfo
UnitChannelInfo
any help appreciated

EDIT:
The below code works

Code:
Lua.DoString("local u,i=UnitCastingInfo;i=select(9,u\"target\")if u\"target\"and not i and IsSpellInRange(\"Skull Bash\",\"target\")==1 then CastSpellByName(\"Skull Bash\",\"target\")end", "Barkskin.lua");
Not ideal but......does anyone else have anything more elegant ?
Last edited: