April 7, 20233 yr I'm trying to dispel my party members, but it doesn't work and my knowledge of Lua etc is not really good, could anyone help me <FightClassSpell> <FightClassConditions> <FightClassCondition> <ContionType>LuaScript</ContionType> <Param xsi:type="FightClassConditionLua"> <LuaScript>needcleanse1 = "no" if not UnitDebuffID("party1", 47843) and not UnitDebuffID("party1", 48160) then if UnitDebuffID("party1", 8122) or UnitDebuffID("party1", 5782) or UnitDebuffID("party1", 118) or UnitDebuffID("party1", 61305) or UnitDebuffID("party1", 28272) or UnitDebuffID("party1", 61721) or UnitDebuffID("party1", 61780) or UnitDebuffID("party1", 28271) or UnitDebuffID("party1", 103139) or UnitDebuffID("party1", 6358) or UnitDebuffID("party1", 44572) or UnitDebuffID("party1", 15487) or UnitDebuffID("party1", 64044) or UnitDebuffID("party1", 12598) or UnitDebuffID("party1", 2139) or UnitDebuffID("party1", 1499) or UnitDebuffID("party1", 20066) or UnitDebuffID("party1", 853) or UnitDebuffID("party1", 105593) or UnitDebuffID("party1", 31661) or UnitDebuffID("party1", 5484) or UnitDebuffID("party1", 339) or UnitDebuffID("party1", 47476) or UnitDebuffID("party1", 82691) then needcleanse1 = "yes" end end</LuaScript> <VarRet>needcleanse1</VarRet> <ValueRet>yes</ValueRet> </Param> </FightClassCondition> <FightClassCondition> <ContionType>MeInCombat</ContionType> <Param xsi:type="FightClassConditionBool"> <Value>true</Value> </Param> </FightClassCondition> </FightClassConditions> <SpellName>RunMacroText("/cast [@party1] Cleanse") </SpellName> <Priority>20</Priority> <CheckIfKnow>false</CheckIfKnow> <CheckIfSpellUsable>false</CheckIfSpellUsable> <CheckSpellDistance>false</CheckSpellDistance> <CheckIfView>false</CheckIfView> <NotSpellIsLuaScript>true</NotSpellIsLuaScript> <TargetFriends>true</TargetFriends> <DescriptionSpell>Dispel CC Party1</DescriptionSpell> <WaitDuringCasting>false</WaitDuringCasting> </FightClassSpell>
April 7, 20233 yr Hello, Wow lua by default does not have a function called UnitDebuffID, here is code using UnitDebuff (Please note my lua is somewhat Rusty.) local SpellNameTable = { "Unstable Affliction", "Vampiric Touch", "Psychic Scream" --Names of other debuffs. } local needCleanse1 = false for _, spellName in ipairs(SpellNameTable) do for i = 1, 25 do local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitDebuff("party1", i) if name == spellName then needCleanse1 = true end end end
April 7, 20233 yr Author ty for your help, i rip the script mostly from a pqr profile, now i try local SpellNameTable = { "Polymorph", "Fear", "Howl of Terror", "Psychic Scream", "Seduction", "Hammer of Justice", "Repentance", "Deep Freeze", "Silence", "Psychic Horror", "Improved Counterspell", "Counterspell", "Freezing Trap", "Dragon's Breath", "Entangling Roots", "Strangulate" } local needCleanse1 = false for _, spellName in ipairs(SpellNameTable) do for i = 1, 25 do local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitDebuff("party1", i) if name == spellName then needCleanse1 = true end end end Unfortunately it doesn't work, is there also the possibility that if "party1" has Vampiric Touch or Unstable Affliction on it, that it doesn't use Cleanse or do I have to enter this in a new condition?
April 7, 20233 yr could always just run it with CastSpellByName, replace NeedCleanse1 to CastSpellByName("Cleanse", "party1")
Create an account or sign in to comment