Talk:Useful macros/Archive01

Warlock Shadow Trance
What would the syntax be for a macro to cast Shadow Bolt if Shadow Trance is active, but a different spell if Shadow Trance is not active? This question could also represent any conditional where a particular condition is necessary to trigger the event, but another event would be triggered if the specific condition isn't met. Overall this would seem to be similar to the stance conditional syntax, but Shadow Trance is not listed as a recognized stance type. -- Widdershins 14:50 EST, 5 January 2007

This is exactly the kind of thing Blizzard wants to prevent. Shadowtrance is a buff not a stance. Conceptually it is completely different (people choose which stance they want, shadowtrance is a proc thing). This isn't possible.

Warlock Amplify Curse
How would one create a macro to cast Amplify Curse then Curse of Agony? I tried doing the same way I would do a shaman instant cast heal macro, but Amplify Curse owuld never cast. Am I doing something wrong? --Orionriver 1532, 17 Aug 2006 (PST)


 * It's not you; you can't cast two spells with a single button click. You could create a macro that casts both in order, but you would have to press the button twice. Luci 08:17, 12 October 2006 (EDT)

/cast Amplify Curse /stopcasting /cast Curse of Agony That works for most powers and trinkets too --Iznobad
 * How about this:

UnitCreatureType
Does anyone know if there is a way to tell if the mob you are fighting is a certain type? I ask because I'm trying to find away to create a macro that will use either Sunder Armor or Rend based on the type of mob since elementals are Immune to Rend. --BaldMonkey 16:12, 16 Aug 2005 (EDT)

listed on seperate lines for ease of reading Okay well I sort of figured out how to get what I wanted done using this line... /script uct=UnitCreatureType(%t); if ( (uct == Elemental) or (uct == Mechanical)) then CastSpellByName("Sunder Armor(Rank 3)"); else CastSpellByName("Rend(Rank 4)"); end;

The only problem is that well it doesn't cut it since I now noticed that Treants are Elemental yet they are not immune to Rend. This leads me to want to creat a whole sort of function I can run that will check. My question is now this. Is there a way to make a custom function? Maybe a file I can save to the Add-On directory like a custom mod. --BaldMonkey 09:13, 18 Aug 2005 (EDT)

Bandage script
Someone submitted the following:


 * The bandage script doesn't work. I add the correct slot number behind "ActionID" (example: ActionID36), but there is always an error message, something like "usage: (ActionID, [CheckCursor]). -- Carcelia

But it does work for me. In the above use 36, not ActionID36. Make sure the bandages are in action bar 3 slot 12. -- Reikobi

I added a new script, that should work, for bandage DracoBlue

Series of spells with one macro?
Can you cast a series of spells with a macro? --- Fandyllic 10:57 AM PST 14 Mar 2005

No. Multiple spell cannot be cast. -- AlexanderYoshi 23:09, 15 Mar 2005 (EST)


 * Correction: yes you can, but each needs a new button press (can be same button)

/Castsequence [option] spell 1, spell 2
 * For combat ones, remember to put in reset=combat/target so it resets when your current mob dies or you change to a different mob. You can script common spell chains like this:

/castsequence [harm] reset=combat/target mind blast, shadow word: pain, mind blast, wand, mind blast, wand
 * However the automatic "cast friendly spells on me" feature doesn't seem to work, so you cant do:

/castsequence power word: sheild, mind blast, shadow word pain
 * Cheers Lwollert 06:12, 3 February 2007 (EST)

Actually you can, but you need to turn on auto-selfcast in the interface options. I use a macro very much like that (with a reset switch). Smitty the smith 23:19, 20 April 2007 (EDT)

Resetting instances
[ Laisren; 19 Jun 2005] Regarding the following text: "What this does is resetting instances, and is very useful for mages that grinds DM East for example. Change PlayerInAGroup to the nick of a player who is in a group, and make this macro. When you press it, the instance is reset. " Can someone please translate this into English? Thanks.

Since some recent patch, you can now right-click your character portrait and get reset on the drop down. Ravenasque 23:39, 6 September 2006 (EDT)

Conditional spellcasting
--Brinebold 11:57, 4 Sep 2005 (EDT)Anyone know if its possible to cast a spell on the party member that meets a specific condition? For example cast flasheal rank 3 on party member with lowest % HP? I'm still new to writing macros and using mods.
 * Under the 2.0 UI macros and addons can't determine what buffs/debuffs are on a target in order to decide what to cast. Sorry -  Macros are now "dumb". You can use chains, however, and automatically target a party member. Lwollert 06:15, 3 February 2007 (EST)

Distance to target?
Is there any way to count the distant from your target?


 * I think that the API does not allow such a macro because Blizzard thinks it's cheeting.--Scalp 16:57, 18 August 2006 (EDT)

<<< Holy Light on Plague Spreader >>>
Is there a good macro where you can have the desired effect of being able to heal yourself or someone like you while keeping your enemy targeted? Here's a macro I use: /cast Holy Light /s <<< Holy Light on %t >>> I think that's it. I wrote it some time ago, and updated it just after the patch, to remove the rank. It still heals whoever I want it to, but it always says the name of the baddie that I'm fighting. To alleviate that, I have to select my heal target first, then use the heal macro, then reselect my target. It's rather annoying, when I could just as easily hit the macro button and hit F2 or whatever.

How can I run the macro, then select my target, and it say that I'm healing the real heal target? I've wondered about API CameraOrSelectOrMoveStart, but I don't know how to use that. And I'm not familiar with hooking functions. This would be a great help. Thanks. Schmidt talk 08:22, 10 Oct 2005 (EDT)

Waiting
Q: Is it possible to make a macro that casts a spell after a pause, because i want it to do a series of spells with a little pause?

A: There is no way to cast more than one spell in a single macro, nor can you put a pause before casting a spell.

Selfcast Spells
I've had various problems with selfcast macros, in that they'd change my target in different ways under some circumstances (the common one being if the spell failed to cast because it was still in cooldown, but other things as well). I finally came up with the following, which I've never had a problem with:

/script local p, t = "player", "target"; local i = UnitCanAssist(p, t) and not UnitIsUnit(p, t); if (i) then TargetUnit(p) end; CastSpellByName("Purify"); if (SpellIsTargeting) then SpellTargetUnit(p) elseif (i) then TargetLastTarget end

It may seem a bit long, but you can remove almost all of the spaces (next to parentheses, semicolons, commas, or equal signs), which should allow the spell name to be as long as necessary.

I'm not sure the local declarations are necessary, but I prefer to be conservative when scripting in a language I'm not familiar with. Also, I've used UnitCanAssist, but there're a number of similar functions which might also work, like UnitIsFriend, or UnitCanCooperate - I'm not really sure about the differences between those.

Always attack on Button hit
Trying to figure out a script that puts you on "attack" mode when you press a button. and then performs an attack.

Basically this is the macro :
 * /script if(UnitAffectingCombat("player")==nil) then AttackTarget;end;
 * /script if(UnitMana("Player")>=10) and (IsUsableAction(18)) then CastSpellByName("Riposte");end;
 * /script if(UnitMana("Player")>=40) then CastSpellByName("Sinister Strike");end;

If you are not in combat it "should" make you auto attack your nearest target. ( doesn't seem to work though ) otherwise, it checks if you have 10 energy, then uses Riposte if its available, and will use Sinister strike if you have 40 energy after that. Anyone have an idea? CJ 03:54, 3 Mar 2006 (EST)

-You can cut down on character useage by using >9 rather then >=10, and similarly >39 instead of >=40. Since rogue energy only comes in whole interegers, the two are equivlant. User:Ravenasque 1338, 6th July 2006 (CST)

Does it have a "delay" script?
I don't want to cast several spells in one macro. What I want to achive is,say somthing,delay for a while,say somthing.

Just like this: /say la lalalalal ala /delay 5sec /y palapalapala

Is it possible?

Thanks a lot!

-There isn't a native command, but cosmos offers /in, which can cause a chat delay. Still doesn't work with spell casting, but it would be what you are looking for.

Trinket Macro
Hello, i got these 2 trinkets, the ZG one, and badge of the swarm guard. Using either one of them causes no global cooldown on the other. Now i manually use them at the same time, so i would like to have a macro that just uses both. its got something to do with /script useinventoryitem but thats as far as i get, any help is appreciated :)


 * Try

/script UseInventoryItem(13); /script UseInventoryItem(14);

You will have to press the button twice though, since you can't do two things at once. Luci 08:15, 12 October 2006 (EDT)

Quest Objectives Macro
Has anyone actually gotten this to work? Do you have to have your quest log open and the quest selected in the frame? Or do you have to turn on tracking for the quest? I keep trying but get an error message. -thermalnoise

/script SelectGossipAvailableQuest(1) /script CompleteQuest /script GetQuestReward

Enjoy Ravenasque 23:32, 6 September 2006 (EDT)

The script you have there is for the quest turn in but your question seems to be about the macro to post your quest objectives to the party... That script is here.

/script i = GetNumQuestLeaderBoards; for j = 1, i, 1 do a1, a2, a3 = GetQuestLogLeaderBoard(j); SendChatMessage(a1, "PARTY"); end;

This script works for me if I have tracking turned on for a quest. Turn on tracking by shift clicking the quest in the quest log. It only works for the last quest added to the tracker. Hope that answers your question.

--Okori 04:51, 12 September 2006 (EDT)

I wrote this macro. I took the code from an addon that does similar functionality (I forget the name). The macro works regardless of whether or not you have quest tracking turned on. You do not have to have the Quest Log window open for it to work. It puts into party chat the quest objectives for the last quest you selected.

Juju2112 15:16, 25 November 2006 (EST)

In-line code line wrap?
Is there a way in WikiLand to have the code wrap without inserting linefeeds and breaking the script? The page looks pretty funky with all the giant one liners...

--Okori 05:01, 12 September 2006 (EDT)

Lynk 16:56, 11 October 2006 (EDT) I wondered about this myself. The code below is actual Wiki code. An example can be found here.
 * Scales to browser size
 * Wraps long lines
 * Script can be copied without line breaks

Cleaned up Mage Cast By Level
Lynk 17:33, 11 October 2006 (EDT)
 * Removed scripts that referenced casts by spell number and not name.
 * Using scripts presented by Mourningblade that included self-casting and casting without targets.

What's the command in macro to remove a buff?
I am a warrior, how could I remove a buff,for instance, battle shout by setting a macro?Thanx. Orcliu 13 October 2006 (EDT)
 * Why would you even want to do that?  you can ofcourse just right click the buff icon.. not sure how a macro would do that. CJ 03:15, 20 October 2006 (EDT)
 * To answer his question, you simply use "/cancelaura Battle Shout". That will remove the buff, though I don't quite see what you'd use it for.  Maybe switching stances? DrakeLord 01:19, 09 February 2007 (EDT)

most used... ?
Hm, i suggest we clean this page up some... the "most used macros" page is turning into a "useful macros" page instead. im not sure exactly whether that was the original intent of this page or not. CJ 09:21, 13 October 2006 (EDT)
 * Agree. Afterall, the term most used could never be defined.Sam Weber 22:37, 13 October 2006 (EDT)

Split
Should be split up, like Useful Macros/Druid, Useful Macros/Warrior --Gryphon 22:40, 13 October 2006 (EDT)
 * Also agree. The page is going to get way too long as most people consider their own macros to be useful or most used. Sam Weber 22:45, 13 October 2006 (EDT)

Lynk 00:00, 19 October 2006 (EDT) I can see where it may be necessary to account for everyone's favorite macro they spent part of their weekend perfecting it and later felt compelled to share (thanks!). I think this is what Gryphon is suggesting with Useful Macros/. How to determine a 'most used macro' could be difficult though. Not sure how that'd work to be honest. But also understand the nature of a Wiki. . . a living, evolving document.

I suggest maybe widening the scope a little to include macros and scripts in general. In addition to possibly reorganizing the existing page, is it also possible to consolidate these other bits of information so that (a) they may be found easily and (b) reside in one place, not several?
 * 1) The UI Beginners Guide has an excellent explanation of Slash Commands, Macros and Scripts. Some of the same information can be found under the UI FAQ/Macros and Scripts and Macro FAQ pages.
 * 2) There are at least two pages that describe how to make a macro (Macros and HOWTO: Make a Macro).

Some of those pages should definitely be merged. Common Macros / Commonly Used Macros (Class), what's be a good pagename. CJ 04:59, 19 October 2006 (EDT)


 * I was thinking along the lines of Useful macros (drop most used moniker) would be general purpose multiclass. I like the navigation template, but I think subpages for classes to keep them categorized under the Useful Macro would keep them on the same track; Useful macros/Druid, Useful macros/Rogue.


 * I've just done a little tidying in preparation for a big move - who wants to make the first move? This is desperately needed, so thanks for bringing it up! -- Kirkburn  (talk) 14:48, 19 October 2006 (EDT)


 * I moved the easy ones, ninja :D, the rest still should be gone through and see if there is class specific macros in the general mix. --Gryphon 15:11, 19 October 2006 (EDT)


 * Great work! -- Kirkburn  (talk) 15:32, 19 October 2006 (EDT)

Lynk 18:11, 19 October 2006 (EDT) You'll need to account for macros and scripts that do not associate with any particular class e.g. Combat macros and scripts etc.


 * It is possible to create more pages for other types, but I think that all the class macros should be filtered out of the current page and make sure they are all non-class macros. The page may get shorter once the class stuff is out. --Gryphon 18:58, 19 October 2006 (EDT)

Lynk 18:40, 19 October 2006 (EDT) I am not a wiki expert by any means. It took me a little bit to realize that Most Used Macros redirects to Useful macros. As we see or find them should we update internal references from the old to the new page in spite of the redirection?


 * You can change any links to Most Used Macros to Useful macros you can find, though there isn't any need for the redirect to going away for some time. --Gryphon 18:58, 19 October 2006 (EDT)

Once those are split, we'd just need to try and merge as much of those other 4 pages as we can. Looking good so far CJ 03:15, 20 October 2006 (EDT) Macro_FAQ should be merged into -> UI_FAQ/Macros_and_Scripts, or the other way around. edit: 5 even.. CJ 03:16, 20 October 2006 (EDT)

I have a big problem with the way this page is set up now. It was an extensive list of useful macros. Now, it's a guide on how to write macros. How can one replace the other? I think we need a separate page for the 'How to' guide, and a new page for 'Post 2.0 Useful Macros'. Juju2112 23:22, 6 December 2006 (EST)


 * Also, I'd be willing to go through and start converting all the macros from the Pre-2.0 page, but I need a clearly defined place to put the 'General Purpose' macros that aren't class specific. At the end of the guide doesn't seem like the right place. Juju2112 08:07, 7 December 2006 (EST)

Wrapping Tables
Lynk 23:59, 26 October 2006 (EDT) Looking for suggestions that would allow the font of this table to more closely match non-tabled text on a page. font-size:smaller is difficult to read and font-size:small maybe to large. Is there a happy medium? Here is the table code and two samples (smaller and small). Also, is there a way to reference these table settings globally via style-sheets instead of entering the table parameters each and everytime?

Note: much of this table is not my own work.


 * Looks kinda gray, second and third alternative are a bit hard to read CJ 02:55, 27 October 2006 (EDT)


 * There are only two examples shown. I agree example 1 is difficult to read.  The purpose behind using a table is to wrap long lines and eliminate the need to state "be sure your script is one line".  It allows people to copy and paste without messing with notepad etc.  Instead of using labels, I think you can adjust the font directly using pt as shown below.  All I am asking is a consistent way of doing the table, one that can be read.  Example 2 in the above, I think, is equivalent to a 7 point font. Lynk 18:10, 27 October 2006 (EDT)


 * The Wiki formatting allows us to use the Template:Code format for this.
 * An example would be:

/Castsequence Spell_1, Spell_2
 * Would show up as;

/Castsequence Spell_1, Spell_2
 * I suggest using this, Lwollert 18:25, 4 February 2007 (EST)


 * The code template doesn't exist anymore. Or won't really soon at least.-- Hobinheim  ( talk ·  contr ) 19:31, 10 May 2007 (EDT)

Soulstones/Bandages and Healthstones
I need to know how to make two macros.


 * 1) A macro that will
 * 2) uses my Soulstone on myself
 * 3) uses my Soulstone on whoever I have targeted as long as they are in my party
 * 4) Same for bandages except for I'd like it to bandage people who are not in my party even.
 * 5) A macro that uses a Healthstone according to how much health I have missing.
 * 6) *If I had 600 health gone, it would use Healthstone.
 * 7) *If I had 800 missing, it would use a Greater Healthstone.


 * Lynk 00:55, 1 December 2006 (EST)
 * I tweaked your questions using wiki syntax so it made sense and for the exercise.
 * I do not think this kind of question is appropriate as this is a discussion of a wiki article (Useful Macros) and is not a forum. Although I have been wrong before. You should look around for scripts and macros that come close to what you are looking for.  Also, with the coming 2.0 patch, intelligent macros like your Healthstone request will not be allowed.

Handling Post/Pre Patch 2.0 Macros and Scripts
Lynk 00:55, 1 December 2006 (EST) I've started adding macros that appear to work on the 2.0 PTR server. In these cases, I have designated Post-Patch 2.0 and Pre-Patch 2.0. I know some other sections of the Wiki hold a historical section for depreciated API's etc. Is there a need to do the same here or should we rely on article histories? Sort of related to the first question, for those scripts and macros that will be broken, should we archive or delete the obsolete content once updated working replacements have been published? Suggestions? Comments? Cookies?


 * Once 2.0 has been pushed out to everyone (worldwide) there's no reason to keep old macros that have been rewritten or cannot work in 2.0. I'd only hang on to the ones that still need a rewrite.  --Tekkub 01:06, 1 December 2006 (EST)

Priest Healing Macros
Wowza 08:44, 5 December 2006 (PST) I swaped the order of the target checks in the Priest healing macro so it works more intuitively. Before, if you selected a friendly to heal them (another healer perhaps) and they had a friendly targeted, you would end up healing their target instead of them. Checking to see if your target is friendly first and then, if not, checking to see if your target's target is friendly prevents that type of presumably unwanted behavior.

Current article is somewhat off topic
The article should be useful general purpose macros, like targeting, bandaging and such people can paste into their game and use much like the class specific macros. The macro API documentation should be moved somewhere else, like HOWTO:_Make_a_Macro or Macro_API or similar. --Gryphon 17:00, 12 December 2006 (EST)


 * Was just going to post something similar. The information about general macro writing is great, but should have its own page or be on the How To; this should be just general use macros. --Ziana 16:13, 3 January 2007 (EST)


 * Did it, moved api info to HOWTO:_Make_a_Macro 12:36, 29 January 2007 (EST)

Added gathering and Tracking macros
Added the macros at the bottom of the page. If someone could please double-check the hunter/druid ones work as intended? I've practiced a bit but don't have high level characters in that class. Am open to the idea of moving the class-specific ones into the class-specific macro pages. Any thoughts? Lwollert 06:27, 3 February 2007 (EST)
 * Class specific ones are not to be on this page, they are to be on the articles designated for them. -- 18:55, 3 February 2007 (EST)
 * Np, I'll get onto it - Lwollert 17:54, 4 February 2007 (EST)
 * Done Lwollert 18:26, 4 February 2007 (EST)
 * I'm not so sure that the links at the bottom really go with the rest of the page, specifically the mage macro link as mages don't have any class specific Tracking abilities. Maybe we should create a last section to the page that links to the class macro pages. Ataraxzy 12:57, 11 February 2007 (EST)

casting spells in order with two targets
you can cast spells in a sequence with two targets if one target is an enemy and the other target is you. You need to check auto-selfcast in the interface options. --Smitty the smith 23:25, 20 April 2007 (EDT)