Bugreporter 93 Posted February 23, 2014 Share Posted February 23, 2014 Today I proudly presents : /use 10, use /13 aaaaand use /14 !!! Okay, RunMacroText("/use 14") will work also, so why should you use a script ? I want to use "use 10" if it's ready to use I want it in fight only I dont want to change timers At first: If you are not rogue, ... ... change idSinisterStrike=1752 to another spell that represents your fight range. I use it only to be sure, that I am near enough to fight. Sinister Strike are a level 1 spell with a range of 5y. ... remove / change GetComboPoints to another check to be sure, you have the right target and you are in combat What do I do? At first I check if I am not in stealth, I have a target, the target is a bad guy, the fight has started and the range for a fight is good. After this I check my slots, if there are usable items in 10,13 or 14. If they are ready to use, I will use it. I made 3 sections (spells), because I want to be able to disable them once by once. Its also possible to make a loop to check/cast them once. /use 14 <FightClassSpell> <SpellName>--use 14 (second trinket)</SpellName> <FightClassConditions> <FightClassCondition> <ContionType>LuaScript</ContionType> <Param xsi:type="FightClassConditionLua"> <LuaScript> local slot="Trinket1Slot" local idSinisterStrike=1752 local ssname=GetSpellInfo(idSinisterStrike) if not IsStealthed() and UnitExists("target") and not UnitIsFriend("player", "target") and (GetComboPoints("player") > 0) and (UnitHealth("target")>0) and (IsSpellInRange(ssname,"target")==1) then --[[ RunMacroText("/use 14") ]] local slotId, texture, checkRelic = GetInventorySlotInfo(slot) local itemId = GetInventoryItemID("player", slotId) local start, duration, enable = GetItemCooldown(itemId) if (duration==0) then UseInventoryItem( slotId ); --[[ print("use "..slotId) ]] result=true end end </LuaScript> <VarRet>result</VarRet> <ValueRet>true</ValueRet> </Param> </FightClassCondition> </FightClassConditions> <Priority>4</Priority> <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance> <AddToSettings>true</AddToSettings> <NotSpellIsLuaScript>true</NotSpellIsLuaScript> <DescriptionSpell>/use 14</DescriptionSpell> </FightClassSpell> /use 13 <FightClassSpell> <SpellName>--use 13 (first trinket)</SpellName> <FightClassConditions> <FightClassCondition> <ContionType>LuaScript</ContionType> <Param xsi:type="FightClassConditionLua"> <LuaScript> local slot="Trinket0Slot" local idSinisterStrike=1752 local ssname=GetSpellInfo(idSinisterStrike) if not IsStealthed() and UnitExists("target") and not UnitIsFriend("player", "target") and (GetComboPoints("player") > 0) and (UnitHealth("target")>0) and (IsSpellInRange(ssname,"target")==1) then --[[ RunMacroText("/use 13") ]] local slotId, texture, checkRelic = GetInventorySlotInfo(slot) local itemId = GetInventoryItemID("player", slotId) local start, duration, enable = GetItemCooldown(itemId) if (duration==0) then UseInventoryItem( slotId ); --[[ print("use "..slotId) ]] result=true end end </LuaScript> <VarRet>result</VarRet> <ValueRet>true</ValueRet> </Param> </FightClassCondition> </FightClassConditions> <Priority>3</Priority> <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance> <AddToSettings>true</AddToSettings> <NotSpellIsLuaScript>true</NotSpellIsLuaScript> <DescriptionSpell>/use 13</DescriptionSpell> </FightClassSpell> /use 10 <FightClassSpell> <SpellName>--use 10 (Engineer Gloves)</SpellName> <FightClassConditions> <FightClassCondition> <ContionType>LuaScript</ContionType> <Param xsi:type="FightClassConditionLua"> <LuaScript> local slot="HandsSlot" local idSinisterStrike=1752 local ssname=GetSpellInfo(idSinisterStrike) if not IsStealthed() and UnitExists("target") and not UnitIsFriend("player", "target") and (GetComboPoints("player") > 0) and (UnitHealth("target")>0) and (IsSpellInRange(ssname,"target")==1) then --[[ RunMacroText("/use 10") ]] local slotId, texture, checkRelic = GetInventorySlotInfo(slot) local itemId = GetInventoryItemID("player", slotId) local start, duration, enable = GetItemCooldown(itemId) if (duration==0) then UseInventoryItem( slotId ); --[[ print("use "..slotId) ]] result=true end end </LuaScript> <VarRet>result</VarRet> <ValueRet>true</ValueRet> </Param> </FightClassCondition> </FightClassConditions> <Priority>2</Priority> <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance> <AddToSettings>true</AddToSettings> <NotSpellIsLuaScript>true</NotSpellIsLuaScript> <DescriptionSpell>/use 10 (good Engineers only)</DescriptionSpell> </FightClassSpell> based on WoW 5.4.2. Link to comment Share on other sites More sharing options...
Sye 1 Posted March 26, 2021 Share Posted March 26, 2021 function UseItemInSlow(slotId) local SlotCoolDown = select(2, GetInventoryItemCooldown("player", slotId)); local ItemEquipedName = select(1, GetItemInfo(GetInventoryItemID("player", slotId))); if SlotCoolDown == 0 then UseItemByName(ItemEquipedName) end end Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now