Macro Anatomy: /castrandom
Of all the macro questions I get asked, how to randomly choose a mount ranks near the top. Many of you new to macros have probably asked this one, wondering how to randomly cast a spell or use an item. Today's Macro Anatomy will address this random request.So let us imagine that you've got a collection of mounts that you have the hardest trouble choosing from. Members of your party silently suffer while you pick through your list of options. The World of Warcraft client has a built-in function known as /castrandom that can turn your mounting troubles into one-button joy.
Pretend you're an awesome Draenei Shaman and have these mounts: Amani War Bear, Black Ram, Cobalt War Talbuk and the Great Blue Elekk. Now, you want one button which will randomly choose one of your great means of conveyance, here it is:
/castrandom Amani War Bear, Black Ram, Reins of the Cobalt War Talbuk, Great Blue Elekk
Place this on your action bar and there you have it. Wait, you are wondering about a flying mount? Well, keep reading to find out how you can put both riding and flying mounts in the same random mount-selecting macro!So you've decided you want one button to rule them all, your mounts that is. Well, I gave you the ground mount version, you can change the names of the mounts for flying versions, but you're a greedy little shammy and want it all. Here you are:
/castrandom [outdoors,nomounted,flyable] Cenarion War Hippogryph, Silver Riding Nether Ray, Swift Blue Gryphon; [outdoors,nomounted] Amani War Bear, Black Ram, Reins of the Cobalt War Talbuk, Great Blue Elekk
So, aside from the functionality of the first macro, this one allows for random selection of the Cenarion War Hippogryph, Silver Riding Nether Ray and the Swift Blue Gryphon. This macro will make sure you are outdoors and not mounted, and then will determine if you are able to fly. So, it would choose a flying mount in Outland, but you would get a riding mount on Azeroth. Congratulations, you've got your one-button mount macro.
Oh no, I've made the Mages upset because I didn't mention their coolness. (Get it, frost mages?) Well, how about a macro that lets you cast a random polymorph spell, since you've worked so hard to get them all. Try something along these lines:
/castrandom Polymorph, Polymorph(Rank 1: Pig), Polymorph(Rank 1:Turtle)
This will randomly polymorph your foes into either a sheep, pig or turtle, how fun! Finally, I thought I would throw in a macro for you costume junkies who love to run around the Battlegrounds looking like a skeleton, pirate, ninja or what have you.
/castrandom Savory Deviate Delight, Noggenfogger Elixir, Murloc Costume
So this will let you randomly use your Savory Deviate Delight, Noggenfogger Elixir or Murloc Costume. On a personal note, if you happen to have all those mounts, all those spells or all those costumes, I tip my hat to you, fair player. Honestly though, give me your mounts.
Tune in next week when we'll go back to talking about something less random.
Filed under: Mage, Tips, Tricks, How-tos, Odds and ends, Features, Mounts, Macro Anatomy






Reader Comments (Page 1 of 1)
Chris Anthony Mar 30th 2008 12:20PM
A note: if you're not a paladin or warlock, /userandom works here too, and is a character shorter if you're chronically pressed for space in macros like I am. ;)
Chris Anthony Mar 30th 2008 12:31PM
To clarify: /userandom can be (and should be) used when you're dealing strictly with items. If there's a spell or ability anywhere in the list, you have to use /castrandom.
Sean Forsgren Mar 30th 2008 12:38PM
Thanks for mentioning that, I actually wasn't 100% sure on /userrandom vs. /castrandom, and I didn't want to destroy my spiffy title. =) But seriously, thanks for clarifying
Fireflash38 Mar 30th 2008 1:46PM
/use and /cast can be used interchangeably, both on items and on spells
Chris Anthony Mar 30th 2008 2:46PM
Fireflash, that must be a recent change; when I started using /use and /cast, /use threw an error when I tried to use it with spells. Thanks for the heads-up.
bryanne Mar 30th 2008 12:56PM
so for a warlock it would be :
/castrandom Amani War Bear, Black Ram, Reins of the Cobalt War Talbuk, Great Blue Elekk, Summon Dreadsteed
? I have like 7 mounts, so I'm definitely wanting to get this macro working. ;)
Chris Anthony Mar 30th 2008 2:50PM
Yes, exactly.
mike Mar 30th 2008 1:00PM
I've been wondering for a while - is there any way to make a macro choose a random phrase to say? I like to link emotes to some of my casts (Like 'Oh god someone's hitting me! Help me please!' and then fade). But it gets boring having the same announce phrase every time. Is this even possible in macros, or should I be looking at addons?
Brian Arnold Mar 30th 2008 2:19PM
As far as I'm aware, especially since you're talking about sentences and such, an addon would be much more effective. You have a 255 character limit with a macro. You wouldn't be able to fit more than maybe two sentences, maybe three if you got brief.
Also, the more I think about it, I'm not really sure you could do random says without an addon. There's not a /sayrandom or anything, and I don't think you can do something like a random number generation and then switch off of its results, which you would effectively need. Such things are easily done with an addon, though, I'd think (as I've seen with Necrosis and soulstones, saying a variety of things with each use).
mike Mar 30th 2008 2:40PM
Yeah, I figured as much. But all the addons that seem to provide that functionality are ridiculously out of date, and I don't feel like coding one myself. :/
Everto Mar 30th 2008 2:04PM
Sounds like a great macro, but I have too many mounts to fit them all in. So i made one for the flying and one for the ground mounts.
Culhag Mar 30th 2008 3:58PM
If you need more space for your macro, you can use item numbers instead of their name with
item:#####
you can get the ID of an object with some addons such as Informant, or by looking for it on WowHead (it's the number at the end of the adress of the page)
My Mount macro looks like this :
#showtooltip
/userandom [modifier:alt] Crusader Aura; [modifier:ctrl] Retribution Aura; [flyable,nomounted] item:32862,item:25529,item:32316; [nomounted] item:29467,item:18773,Summon Charger
/dismount [nomodifier,mounted]
Dave Apr 3rd 2008 5:05PM
You can also use bag slots as long as you don't move where you keep your mounts: Bags are numbered from backpack to the left 0-4, and slots in the bags are numbered top-left to bottom-right, 1-whatever.
Scribblette Mar 30th 2008 8:24PM
Actually, random /says while you mount ARE possible. Best of all, you can get it to say it by percentile chance, rather than every single time, so that people don't get sick of it. I have a macro so that 1 in 4 times when summoning a mount I'll say 1 of 4 random lines.
Unfortunately you really have to squeeze for characters with that and there isn't much space for much /userandom mount unless you have short-named mounts. Horn of the Timber Wolf just takes up too many damn character spaces!
Culhag just pointed out how to save chars by itemID, though, which leaves much room for fun.
Here's one from the forums, though I haven't tested it. Just include the mount cast before it, and this one will say something EVERY time.
/run SendChatMessage(GetRandomArgument("Msg1","Msg2", "Msg3"),"SAY")
Mine is more like this:
/cast YourMountItemNameorID
/script s={"Message1","Message2","Message3","Message4","etc"}
/script if(math.random(100)
Scribblette Mar 30th 2008 8:27PM
Augh! It ate my macro! Damn thing doesn't like the LEFT INDENT MARK. The one where you press SHIFT and COMMA. So instead, I will use a @ to show where the indent mark should be (just after (100)). Whatever the hell an indent mark is actually called I do not know...
/cast YourMountItemNameorID
/script s={"Message1","Message2","Message3","Message4","etc"}
/script if(math.random(100)@=25) then SendChatMessage(s[math.random(getn(s))],"SAY")end
Scribblette Mar 30th 2008 8:29PM
Sorry, I didn't see the big reply button on your post. I replied to the thread with a solution - I can't remember where I found the fragments for it on the web and tried googling it... but nonetheless it works for my girl and myself now.
ThorinII Mar 31st 2008 9:52AM
One of my toons has become somewhat of a vanity pet junky. This will come in handy with her too. :0)
/userandom Great Horned Owl, Mechanical Squirrel Box, Parrot Cage (Green Wing Macaw), Dark Whelpling, Piglet's Collar, Chicken Egg
Her list of pets go on. I plan to get her some rare pets once she's high enough lvl. She'll get each of the orphan quest pets eventually too.
Not sure why. This is the only toon I've bothered with pets on. It's kind of fun I guess.
duskhawk Apr 2nd 2008 5:04PM
My current mount macro is
/equip [nomounted] Riding Crop
/userandom [nomounted, flyable] Turbo-Charged Flying Machine Control, Green Riding Nether Ray
/use [nomounted, noflyable] Reins of the Dark Riding Talbuk
/equip [mounted] Mark of Conquest
/dismount [mounted]
It's basically one-button mount/dismount with appropriate trinket swappage, if you don't run with a trinket addon. I've been told the /dismount line at the end is extraneous, but I'm more comfortable with it there. >.> If you dismount in combat, of course, it doesn't swap your trinkets.