Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Poison Management (a solution)

Featured Replies

By default, this solution cast a lethal and a non-lethal poison, depending of the knowledge and the priority-list (idPoisons[1]=lethal, [2]=non-lethal).  If there is already a poison, and the run time of the poison will be less then 13  min, it will be renewed, if we are 

  • not in combat. (We need it before)
  • not AFK (who want casting while afk ?!?)
  • not Falling, Flying or Riding (mounted) (flying + casting = falling)
  • not casting

Why 13 Minutes ? Because of the duration time of a fight with a raid boss. You want more or less ? Change  the 13 in  local timeLeftToCastAgain = 13*60 to another value.

    <FightClassSpell>
      <SpellName>--Poison Managment</SpellName>
      <FightClassConditions>
        <FightClassCondition>
          <ContionType>LuaScript</ContionType>
          <Param xsi:type="FightClassConditionLua">
            <LuaScript>
if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player")) and not (UnitAffectingCombat("player")) and not (IsMounted())  and not (IsFlying())  and not (IsFalling())  and not (IsResting())  and not (UnitIsAFK("player")) then

	--[[ refresh the Poisons if there are less then 13 min left (to be sure that it dont runs out while a raid boss fight ]]
	local timeLeftToCastAgain = 13*60;
	local idPoisons={}
--[[             Deadly,Wound ]]
	idPoisons[1]={2823,8679}
--[[             Leeching,Crippling,Mind-Numbing,Paralytic ]]
	idPoisons[2]={108211,3408,5761,108215}
	local now=GetTime();
	for i=1,#idPoisons do
		local spell="";
		local PoisonFound=0
		for j=1,#idPoisons[i] do
			spellname=GetSpellInfo(idPoisons[i][j])
			local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitBuff("player",spellname); 
			if (name==spellname) then
				local expireTimeLeft = expirationTime-now;
				PoisonFound=idPoisons[i][j]
				if (expireTimeLeft &lt; timeLeftToCastAgain) then
					if (IsUsableSpell(spellname)) then
						local start, duration, enable = GetSpellCooldown(spellname)
						if (duration==0) then 
							CastSpellByName(spellname);
							spell=spellname;
						end
					end
					
				end
				break;
			end
		end
		if (PoisonFound==0) then
			for j=1,#idPoisons[i] do
				local spellname=GetSpellInfo(idPoisons[i][j])
				if (IsUsableSpell(spellname)) then
					local start, duration, enable = GetSpellCooldown(spellname)
					if (duration==0) then 
						CastSpellByName(spellname);
						spell=spellname;
						break;
					end
				end
			end
		end 
		if not (spell=="") then
			print("Poison: "..spell)
			result=true
			break;
		end
		
	end
end

</LuaScript>
            <VarRet>result</VarRet>
            <ValueRet>true</ValueRet>
          </Param>
        </FightClassCondition>
      </FightClassConditions>
      <Priority>1</Priority>
      <CombatOnly>false</CombatOnly>
      <CheckIfKnowUsableDistance>false</CheckIfKnowUsableDistance>
      <CheckIfView>false</CheckIfView>
      <AddToSettingsActiveByDefault>true</AddToSettingsActiveByDefault>
      <NotSpellIsLuaScript>true</NotSpellIsLuaScript>
      <CanMoveDuringCast>No</CanMoveDuringCast>
      <DescriptionSpell>Poison Managment</DescriptionSpell>
    </FightClassSpell>

based on WoW 5.4.2.

 

  • Author

I have learned that casting is not equal casting. There are channeling spells (spells that works the whole time while channeling i.e heal) and spells that works after a channeling time (i.e. poisons)

 

Because of this I changed the code above from

if not (UnitCastingInfo("player"))...
to

if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player"))...
I have add movedetection ( GetUnitSpeed("player") ) also.
  • 4 weeks later...
  • Author

Sorry, i cant. I only post the (imho) best solution. If you want to get the old solution change only

 

 

if (GetUnitSpeed("player") == 0) and not (UnitCastingInfo("player")) and not (UnitChannelInfo("player"))

 

with

 

if not (UnitCastingInfo("player"))

 

 

GCD is simple to detect. Use Parameter "Is Spell usable" in the fight class editor.

 

in lua try something like this

local spellid=123456  --[[change to the ID-nr of the spell)]]
local spellname=GetSpellInfo(spellid)
                if (IsUsableSpell(spellname)) then
                    local start, duration, enable = GetSpellCooldown(spellname)
                    if (duration==0) then
                        CastSpellByName(spellname);
                        spell=spellname;
                        break;
                    end
                end
  • 3 weeks later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.