Hearthstone macro

#showtooltip Hearthstone
/castrandom 165669, 162973, 6948

I’m using the following macro but sometimes it does not work.

I know the castrandom does not roll as often and i know others have reported it as broken.

The issue is sometimes the macro will do nothing.

Toy’s names don’t work in castrandom and you have to use the spell ID.

Can anyone convert this into a true random or to get it to work all the times.

Spell ID
[Greatfather Winter’s Hearthstone] = 162973
[Lunar Elder’s Hearthstone] = 165669
[Hearthstone] = 6948

Thanks

It’s a known issue with 8.x that /castrandom is broken.

You can’t cast by ID.

Since that has to be done out of combat, I can whup something together for you. Gimme a moment or two.

Okay.

I don’t have those items so I had to kind of use what I had.

/stopmacro [combat]
/run local t,u,R,b,B,N={166559,140192,6948},"use ",GetRunningMacro() b=GetMacroBody(R) N=GetItemInfo(t[random(1,#t)]) B=gsub(b,"/"..u.."[%w%s%p]-$","/"..u..N) EditMacro(R,nil,nil,B)
/use Hearthstone

That works.

Substitute the item numbers in the table for your item numbers like this:

/stopmacro [combat]
/run local t,u,R,b,B,N={162973,165669,6948},"use ",GetRunningMacro() b=GetMacroBody(R) N=GetItemInfo(t[random(1,#t)]) B=gsub(b,"/"..u.."[%w%s%p]-$","/"..u..N) EditMacro(R,nil,nil,B)
/use Hearthstone

That should work.

I did run into very close to the maximum number of characters on the longer item names, so bear that in mind.

Also, it didn’t seem to work using the item first, so I put that at the end now it’s truly random and unknown when you click it.

Believe toys are an exception to that rule.

1 Like

Thanks for doing this.

Does the first line of the macro matter?

/stopmacro [combat]

I thought Hearthstones can be used in combat. They only fail if you take damage?

It’s why Paladins can bubble/ hearth… or did they change that?

It’s not necessary.

You will get an error in that the Lua involved can’t run in combat (you can’t update Macros in combat with Lua).

(Sorry, Elvie)

I just tested this in combat. On my frost mage, I ice lanced a small crab and then started hearthing. It attached me the whole time but was unable to damage me. I completed the hearth. No errors audio or errors in bugsack addon.

Did you verify that the macro actually changed?

EditMacro is not supposed to be usable in combat.

My suspicion is that while it may not be throwing errors, it’s likely not advancing the “random selector” portion.

That’s not awful if true. You retain your “Get out of dodge” button, just not a random selection of WHERE.

Im trying to get the other hearthstones and will add their spell ID to this macro. By removing “/stopmacro [combat]”, it gives me another couple of characters to add before hitting the max limit.

It does look like when in combat the random does not work. I’m cool with that as long as I can still hearth.

Thanks for the work on this.

The best answer might be to move the “edit macro” code into a small addon and make it accessible via slash command.

I’ll give it a look later.

2025 here… I popped onto this thread today because my “/castrandom (toy ID)” macro stopped working on an alt … weirdly (thankfully) a simple “reload ui” seems to have resolved the issue (for today at least!)

Hope this helps someone!