Download
(7Kb)
Download
Updated: 12-03-06 11:41 PM
Updated:12-03-06 11:41 PM
Created:unknown
Downloads:43,400
Favorites:71
MD5:

AfterCast  Popular! (More than 5000 hits)

Version: v1.1-20000
by: Iriel [More]

AfterCast - Perform action after a cast
---------------------------------------------------------------------------
This is a fairly simple addon for performing actions based on the success or failure of a cast. Usage is as follows

/aftercast /smile
/aftercast +fail /cry
/cast Frostbolt(Rank 2)

If the spell succeeds then you'll smile, if it fails, then you'll
cry. If it is interrupted then nothing will happen.

Events you can use are:

+done At the end of successful casting (Default if no event given)
+fail If the spell fails
+interrupt If the spell is interrupted
+start When spell starts casting (Fires before done for instant spells)

Aftercasts apply to the next spell which occurs, and then is reset, you can set up one of each event before each cast.

These functions can also be gotten at via lua functions

AfterCast(doneAction, failAction);
Shortcut to set up the 2 most common actions, either can be nil.

AfterCastOn(event, action)
Set up a specific action (use without the +, so "done", "fail", etc)

AfterCastReason([clearFlag])
Return the stop reason ("done"/"interrupt"/"fail") for the last cast (nil if none have stopped since the last clear).. if clearFlag is present and true then resets status after return.

Optional Files (0)


Post A Reply Comment Options
Unread 08-08-12, 11:58 AM  
Antares1986
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Will it work for Cataclysm ? 4.0.6 for example ?
This addon is really useful, I was trying to do simple macro but was tired from accidental spamming when spell actually fails.
If it doesn't work in Cataclysm, can you write a version for it ?
Report comment to moderator  
Reply With Quote
Unread 07-26-11, 01:58 AM  
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1600
File comments: 2305
Uploads: 21
Re: How does it work?

Originally posted by runescaper11
hi Iriel,

i downloaded this macro so that my hunter could cast a continued sequence of steady shot to generate focus. i tried this with the /aftercast command but it hasn't worked. here is the macro:

#showtooltip
/cast Steady Shot
/aftercast /Steady shot
/aftercast /Steady shot
/aftercast /Steady shot
...

how will i get this to work? did i get the code wrong or does it just not like repetitiveness? also is says: Unexpected event 'UNIT_SPELLCAST_SENT in sent'

thanks in advance
Aftercast doesn't really work that way. And, I believe what you're describing is impossible to achieve, as Blizzard has designed the UI/addons/macros to be "one input = one action".
Report comment to moderator  
Reply With Quote
Unread 07-26-11, 01:46 AM  
runescaper11
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
How does it work?

hi Iriel,

i downloaded this macro so that my hunter could cast a continued sequence of steady shot to generate focus. i tried this with the /aftercast command but it hasn't worked. here is the macro:

#showtooltip
/cast Steady Shot
/aftercast /Steady shot
/aftercast /Steady shot
/aftercast /Steady shot
...

how will i get this to work? did i get the code wrong or does it just not like repetitiveness? also is says: Unexpected event 'UNIT_SPELLCAST_SENT in sent'

thanks in advance
Last edited by runescaper11 : 07-26-11 at 01:48 AM.
Report comment to moderator  
Reply With Quote
Unread 03-09-11, 04:28 PM  
deadcrusader
A Kobold Labourer

Forum posts: 0
File comments: 5
Uploads: 0
i really like this addon, is it possible to get an update for 4.0(or 4.1/4.2 when they come)?
Report comment to moderator  
Reply With Quote
Unread 10-25-10, 12:27 PM  
Caliga
A Murloc Raider

Forum posts: 7
File comments: 6
Uploads: 0
I wanted a macro to either /s or /y something when i cast but not when i cancel the cast using the same button.

#showtooltip Hellfire
/y INFERNO! **1st press not second which cancels cast**
/cast Hellfire
/cancelaura Hellfire
/script UIErrorsFrame:Clear()

Someone on wow macro forum suggested this addon and it seems like it might do what i need just dont know how to do that.
Report comment to moderator  
Reply With Quote
Unread 04-14-10, 12:49 PM  
Ceberus
A Kobold Labourer

Forum posts: 0
File comments: 5
Uploads: 0
Originally posted by duhwhat
Hi Iriel. I was directed to your addon from the official wow macro/ui forum.

Basically, I use the following macro for Hysteria:

Code:
#showtooltip
/target Manuallyenteredplayername
/cast Hysteria
/run SendChatMessage("Hysteria on %t.", "WHISPER", nil, UnitName("target")) 
/targetlasttarget 
/startattack

I was told AfterCast could help me so that the whisper is only fired if Hysteria successfully goes off. I will occasionally be out of range of my preselected Hysteria go-to-guy, but they get the whisper even if it doesn't go off, leading to some confusion. How would I implement this? Thanks for your help.
Try this

Code:
#showtooltip Hysteria
/aftercast /run SendChatMessage("You have Hysteria! GoGoGo!!1!", "WHISPER", nil, UnitName("UNITNAME"))
/cast [@UNITNAME] Hysteria
replace "UNITNAME" with the name of the character that it getting the buff.

PS. You don't have to do that /target UNITNAME and /attacklasttarget thing.
use [@target], it does the same thing.
__________________
WTB [Shadowmourne]
Report comment to moderator  
Reply With Quote
Unread 01-15-10, 06:31 PM  
duhwhat
A Wyrmkin Dreamwalker

Forum posts: 51
File comments: 236
Uploads: 0
Hi Iriel. I was directed to your addon from the official wow macro/ui forum.

Basically, I use the following macro for Hysteria:

Code:
#showtooltip
/target Manuallyenteredplayername
/cast Hysteria
/run SendChatMessage("Hysteria on %t.", "WHISPER", nil, UnitName("target")) 
/targetlasttarget 
/startattack

I was told AfterCast could help me so that the whisper is only fired if Hysteria successfully goes off. I will occasionally be out of range of my preselected Hysteria go-to-guy, but they get the whisper even if it doesn't go off, leading to some confusion. How would I implement this? Thanks for your help.
Report comment to moderator  
Reply With Quote
Unread 08-14-09, 02:08 AM  
Hammersbald
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 1
Uploads: 1
I posted an update of AfterCast here:

http://www.wowinterface.com/download...ansUpdate.html

It will fix the "unexpected event" errors, and has the "+done" event with channelled spells working again.
Report comment to moderator  
Reply With Quote
Unread 06-21-09, 06:11 PM  
Malazee
A Kobold Labourer

Forum posts: 0
File comments: 10
Uploads: 0
Channeled casts

The /aftercast +done action doesn't seem to function properly for Channeled spells... for example:

Code:
#showtooltip Hymn of Hope
/aftercast +start /ra HYMN OF HOPE TICKING, USE YOUR MANA!
/aftercast +done /ra HYMN OF HOPE DONE
/cast Hymn of Hope
will show the start message, but not the done message. +done is working fine for normal casts.

I can achieve the done message by using the built-in Ace timer:

Code:
/in 8 /ra HYMN OF HOPE DONE
but that's not precise (the cast is less than 8 sec), it shows whether or not the cast was successful, and it defeats the whole purpose of having this addon.
Last edited by Malazee : 06-21-09 at 06:14 PM.
Report comment to moderator  
Reply With Quote
Unread 04-20-09, 05:42 AM  
KazamaSogetsu
A Kobold Labourer

Forum posts: 0
File comments: 8
Uploads: 0
Seems this addon is still working, just need to be updated for some new actions. To stop the spam until then: open the AfterCast.lua file and comment the line 41:

Code:
DEFAULT_CHAT_FRAME:AddMessage("AfterCast: " .. msg);
It should be like this. Notice the "--" before the line:

Code:
local function Error(msg)
    -- DEFAULT_CHAT_FRAME:AddMessage("AfterCast: " .. msg);
end
It won't fix it, but at least won't output errors.
Report comment to moderator  
Reply With Quote
Unread 04-17-09, 01:06 AM  
Cowberty
A Murloc Raider

Forum posts: 8
File comments: 36
Uploads: 0
I think my aftercast broke.
Report comment to moderator  
Reply With Quote
Unread 04-10-09, 03:01 PM  
Nikzilla
A Kobold Labourer

Forum posts: 0
File comments: 4
Uploads: 0
For the next version:

I would love to stop the spam of Spell interupted

And please have a +crit option.
Report comment to moderator  
Reply With Quote
Unread 10-26-08, 06:46 PM  
AnduinLothar
Nobody of Importance
 
AnduinLothar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 95
File comments: 208
Uploads: 23
I just got a "AfterCast: Unexpected event UNIT_SPELLCAST_INTERRUPTED in NormalCast"

i think it was when using my hammer macro:

#showtooltip Hammer of Wrath
/aftercast /y HAMMAR TIME!
/cast Hammer of Wrath
/use Headless Horseman's Helm

My Headless Horseman's Helm was int he bank at the time.
Report comment to moderator  
Reply With Quote
Unread 10-22-08, 09:13 PM  
Siku
A Fallenroot Satyr
 
Siku's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 100
Uploads: 5
Is there a way to put a probability on the /aftercast +done ?

Because i wouldnt want my /say to be said EVERYTIME i cast that spell, or it would become quite annoying... im looking around 25% to say it.. is there a function to do that?
Report comment to moderator  
Reply With Quote
Unread 09-22-08, 05:40 PM  
Rofel
A Murloc Raider

Forum posts: 4
File comments: 3
Uploads: 0
Originally posted by Iriel
No, you can't cast spells from an AfterCast action, you can only do non-protected functions.
Oh wait, you cannot cast spells? bah- well that defeats the purpose for me...
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: