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.

Druid Guardian Code Question

Featured Replies

How do I Make this code that is made to not Interupt if the spell is shielded, into a code to use if the spell isnt interuptable but can stop the spell by stunning them or at least trying to stuff them.


local spellid=106839
local spellname=GetSpellInfo(spellid)
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname, "target")==1) then
    local spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitCastingInfo("target");
    local isChanneling=false
    if (spell==nil) then
        spell, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitChannelInfo("target");
        isChanneling=true
    end
    if (spell~=nil) then
        if (nonInterrupt==false) then
            local guid=UnitGUID("target");
            local type, zero, serverId, instanceId, zoneId, npcId, spawnUid = strsplit("-",guid);
            local dontKick={[82618]={171807};    --[[ Tor'goroth, skip Shadow Bolt to kick Consume Life ]]
                            [82682]={166465};    --[[ Archmage Sol, skip Frost Bolt to kick Parasitic Growth ]]
                                
    --[[ [86135]={172014,172024,172005};  test Ralshira  ]]

                        };
            result=true;
            npcId=tonumber(npcId);
            if (dontKick[npcId]~=nil) then
                if (dontKick[npcId][1]~=nil) then
                    for i=1, #dontKick[npcId] do
                        if (spell==GetSpellInfo(dontKick[npcId])) then
                            result=false
                        end
                    end
                end
            end
        end
        if result==false then     --[[ spell not interruptable, we have to save us !!!]]
            local t=GetTime();
            endTime=endTime/1000 - t;
            if (endTime < 3) or isChanneling then --[[ dont start to early ]]
                local buffexp,buff,buffcnt={},{},{};
                local i,n,c,x,id,found=0;
                repeat
                    i=i+1;
                    n,_,_,c,_,_,x,_,_,_,id=UnitAura("target",i,"PLAYER HARMFUL");
                    if n then
                        buffcnt[n]=c
                        buffexp[n]=x-t
                        buff[n]=id;
                        found=true
                    end
                until (not n) or (i==40);
                local CatForm=GetSpellInfo(768)
                local BearForm=GetSpellInfo(5487)
                local SurvInstincts=GetSpellInfo(61336)
                local Barkskin=GetSpellInfo(22812)
                local Ironfur=GetSpellinfo(192081)
                local MarkOfUrsol=GetSpellInfo(192083)
                local spellname=Ironfur
                local start, duration, enabled = GetSpellCooldown(SurvInstincts)
                if found then
                    if buff[BearForm] then
                        if not buff[SurvInstincts] then
                            if (duration==0) then
                                spellname=SurvInstincts
                            elseif not buff[Barkskin] then
                                start, duration, enabled = GetSpellCooldown(Barkskin)
                                if (duration==0) then
                                    spellname=Barkskin
                                end
                            end
                        end
                    else
                        spellname=BearForm
                    end
                else
                    spellname=BearForm
                end
                if (spellname==Ironfur) then
                    start, duration, enabled = GetSpellCooldown(Barkskin)
                    if (duration~=0) then
                        spellname=false
                    end
                end
                if spellname then
                    CastSpellByName(spellname,"player")
                end
            end
            
        end
    end
end


Anyone Know what Im trying to do here?

Just add a Lua condition 
 

spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitCastingInfo("target")

Use nonInterrupt as return var and look for value 1 (interruptable).

  • Author
On 6/5/2017 at 11:22 AM, Schaka said:

Just add a Lua condition 
 


spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitCastingInfo("target")

Use nonInterrupt as return var and look for value 1 (interruptable).

Ok where would I add this into my LUA Code to make it work?

  • Author

Duh...... I was tired when I asked that..... LOL Thanks. :) But do I add in like this???

 


local spellid=106839
local spellname=GetSpellInfo(spellid)
if UnitExists("target") and not UnitIsFriend("player", "target") and (IsSpellInRange(spellname, "target")==1) then
    local spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitCastingInfo("target");
    local isChanneling=false
    if (spell==nil) then
        spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, nonInterrupt = UnitCastingInfo("target");
        isChanneling=true
    end

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.