WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   /stopcasting limitations (https://www.wowinterface.com/forums/showthread.php?t=43794)

Aelorean 07-28-12 04:53 AM

/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):
Code:

#showtooltip Pyroblast
/stopcasting
/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.

Thanks!

Vlad 07-28-12 05:30 AM

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.

SDPhantom 07-28-12 12:20 PM

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.
Code:

/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.

Aelorean 07-28-12 12:39 PM

Quote:

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.

Seerah 07-28-12 01:08 PM

This is not something that addons are able to do.

Phanx 07-28-12 01:26 PM

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)

Aelorean 07-28-12 02:10 PM

Ok, I see now from looking at that list.

It's too bad that addons aren't able to 'end a macro' as that would work just about as well. I guess I can understand a lot of the restrictions, but that one would be helpful I think.


Hmm...Addons can create or 're-write' macros though, right? I think that I've seen a couple do that. But, will it work in combat? (I don't see that as a restriction on the page, but maybe someone knows.) In other words, could an addon actually change macro text/commands on the fly based upon what is going on in combat?

Just trying to think outside the box. I'm new, so I apologize if this is an old argument/thought process.

Anyway, perhaps someone with connections to blizzard could request something similar to [channeling] for 'casting' abilities to use in macros. I think it would be helpful in a lot of instances.

Barjack 07-28-12 03:13 PM

Addons can edit macros but not during combat.

Jarod24 08-26-12 04:55 AM

As others have stated before:

Addons can not edit macros when you are in combat. Its simply not possible.

However, i wrote an addon that among other things will let you edit dynamically edit a macro when you are out of combat based on conditions you specify.

Its called IfThen and it is -technical- (if you have done any programming before you'll be fine).

Link: http://www.wowinterface.com/download...11-IfThen.html

SDPhantom 08-26-12 12:05 PM

In the context of what the OP was requesting, that solution wouldn't solve their problem.


All times are GMT -6. The time now is 02:46 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI