Quantcast /stopcasting limitations - WoWInterface
Thread Tools Display Modes
07-28-12, 04:53 AM   #1
A Deviate Faerie Dragon
Join Date: May 2010
Posts: 15
Question /stopcasting limitations

I'm interested in having my macro only "/stopcasting" if certain conditions are either met or not met. For example, this is a useful macro for a mage (in certain, specific situations):
#showtooltip Pyroblast
/cast Pyroblast
However, it'd be infinitely more useful if it "stopcasting only if casting anything other than Pyroblast". In other words, if Pyroblast is currently casting, don't do anything.

Anyway, I just wanted to make sure that this wasn't possible already before I write an addon to create a version of /stopcasting that has more bells and whistles.

  Reply With Quote
07-28-12, 05:30 AM   #2
A Molten Giant
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 789
Sadly I think it's only possible to check with "channeling" like "channeling:Spellname" but since it's a cast and not channel, I think the creativity with the macro logic ends here.

Not sure why we have channeling but not also casting, really odd.
  Reply With Quote
07-28-12, 12:20 PM   #3
A Pyroguard Emberseer
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,732
The [channeling] condition indeed only works on channeled spells. This is to add the option to limit what you do so you don't interrupt a channel you're already in the progress of casting. There is no check to see if you're already casting another type of spell. Since the API function behind it is protected, no addon code can change its behavior.

An example of a macro using what [channeling] was meant for.
/cast [nochanneling] Barkskin
/cast Hurricane
This is a simple Druid Hurricane macro. Note Hurricane is a channeled spell. When chain casting, this ensures Barkskin is only cast when Hurricane isn't already in effect. Otherwise, casting Barkskin will interrupt the channel of a previous Hurricane.
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 07-28-12 at 12:27 PM.
  Reply With Quote
07-28-12, 12:39 PM   #4
A Deviate Faerie Dragon
Join Date: May 2010
Posts: 15
Since the API function behind it is protected, no addon code can change its behavior.
My thought was to create a simple addon that adds a new command that works the same way as /stopcasting but has conditional arguments ...something like "/scasting ifcasting <abilityname>" or "/scasting ifnotcasting <abilityname>"

I just assumed that the addon API would have access to the current ability being casted and then if it's there (or not there) issue the /stopcasting command itself. In my mind, it's a very simple but effective solution for my particular desire. But, I'm just getting started with addon development, so I may be making a false assumption.
  Reply With Quote
07-28-12, 01:08 PM   #5
Fishing Trainer
Seerah's Avatar
WoWInterface Super Mod
Join Date: Oct 2006
Posts: 10,493
This is not something that addons are able to do.
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-28-12, 01:26 PM   #6
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,616
Addons cannot cast spells or cancel a spell cast. Those (and a number of other) actions require both a hardware event (key press or mouse click) and a secure code path (either by invoking the action through the default UI without any addon being involved, or by using one of the secure templates provided by Blizzard, which are subject to the same restrictions as macros).

See also: Things Addons/Macros Can't Do (sticky thread in the Addon Requests forum)
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » /stopcasting limitations

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off