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.

CanInterruptCasting working?

Featured Replies

Hi there,

I've tried the following on a WOTLK 3.3.5a private server:

        // Interrupt with Wind Shear
        if (WindShear.KnownSpell && WindShear.IsSpellUsable && ObjectManager.Target.CanInterruptCasting)
        {
            WindShear.Launch();
            return;
        }

But it doesn't use Wind Shear on interruptible spells. If I log a check of ObjectManager.Target.CanInterruptCasting it says "false" - am I using it correctly?

I even wrote my own check which returns false as well!

    private bool SpellIsInterruptible()
    {
        return Lua.LuaDoString<bool>(
            @"isinterruptible = false;
            local name, _, _, _, _, _, _, notInterruptible = UnitCastingInfo(""target"");
            if not name then
                local name, _, _, _, _, _, notInterruptible = UnitChannelInfo(""target"");
            end
            if name and not notInterruptible then
                isinterruptible = true;
            end
            ", "isinterruptible");
    }

Regards

Ofrex35

Your Lua is wrong. The second local shouldn't be there. You're just creating a second local variable called name in that conditional block instead of overwriting the one outside of it.

Instead of searching for a variable that will constantly be overwritten, just return what you need like so:

private bool SpellIsInterruptible()
    {
        return Lua.LuaDoString<bool>(
            @"
            local name, _, _, _, _, _, _, notInterruptible = UnitCastingInfo(""target"");
            if not name then
                name, _, _, _, _, _, notInterruptible = UnitChannelInfo(""target"");
            end
            if name then
            	return not notInterruptible;
            end
          
            return false;
            ");
    }

 

  • Author

Thank you for the quick reply - neither ObjectManager.Target.CanInterruptCasting nor your new function return true for interruptibles.

I will leave this for the moment though in case its a peculiarity of the one spell I have tried it on - Blackwood Windtalkers Gust of Wind in Darkshore.

I will find other mobs first.

Thanks

Ofrex35

Either your parameters aren't correct for 3.3.5a or the server isn't giving your client the correct info. Or even worse, your client is modified.

local name, nameSubtext, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(unit);

This is taken from 3.3.5a interface files. notInterruptable probably returns nil, so you may have to double check what actually is returned.

Here's the source:
https://github.com/wowgaming/3.3.5-interface-files/blob/main/CastingBarFrame.lua

  • Author

Thanks Matenia - sorted now - I had missed the fact that Wowpedia's API stated there was a change between TBC and Retail, and nameSubtext was removed.

Once I corrected that it works great!

Thanks for the prompt!

Ofrex35

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.