1. #1
    Immortal FuxieDK's Avatar
    Join Date
    Apr 2012
    Location
    København
    Posts
    7,251

    Question Random Hearthstone macro

    I have this macro
    Code:
    #showtooltip Fire Eater's Hearthstone
    /run local f,t=RnT or CreateFrame("Button","RnT",nil,"SecureActionButtonTemplate") f:SetAttribute("type","item") t=GetItemInfo(C_ToyBox.GetToyFromIndex(random(9))) f:SetAttribute("item",t) print("Cast:",t)
    /click RnT
    I have 9 different HS marked as faveorite, and clicking my macro selecte one of them (by random), prints "Cast: <name of HS>" and starts casting it...
    So far, so good...


    However.... After I login, each and every time I use the macro is says "Cast: nil" and do nothing..... until I open my Toy Box, the it works as expected until I log out and back in...

    Is there any way around this mandatory opening of Toy Box?
    Fact (because I say so): TBC > Cata > Legion > MoP > BfA > WoD = WotLK

    My pet collection --> http://www.warcraftpets.com/collection/FuxieDK/

  2. #2
    /script LoadAddOn("Blizzard_Collections")

  3. #3
    For items, you can actually do the following:

    /castrandom item:ID, item:ID, item:ID

    For example, the default hearthstone is item:6948 and innkeeper's daughter is item:64488.
    Last edited by Kanegasi; 2019-11-07 at 05:52 AM.


    addons
    weakauras
    Lua Wall of Shame
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

  4. #4
    Immortal FuxieDK's Avatar
    Join Date
    Apr 2012
    Location
    København
    Posts
    7,251
    Quote Originally Posted by d87 View Post
    /script LoadAddOn("Blizzard_Collections")
    Is that a one time use, or does it need to be run, every time I log in?
    Quote Originally Posted by Kanegasi View Post
    For items, you can actually do the following:

    /castrandom item:ID, item:ID, item:ID

    For example, the default hearthstone is item:6948 and innkeeper's daughter is item:64488.
    But the different HSs are not items, they are toys; does it still work?
    Fact (because I say so): TBC > Cata > Legion > MoP > BfA > WoD = WotLK

    My pet collection --> http://www.warcraftpets.com/collection/FuxieDK/

  5. #5
    Yes, it works.

    But keep in mind that if you interrupt the casting, when you cast it again it will use the same toy, until you reload the interface.
    Last edited by George; 2019-11-07 at 06:58 AM.

  6. #6
    Toys are items. The toy box is a "fake" bag. When you get a toy and "learn" it, the item is attached to you.


    addons
    weakauras
    Lua Wall of Shame
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

  7. #7
    Quote Originally Posted by Kanegasi View Post
    For items, you can actually do the following:

    /castrandom item:ID, item:ID, item:ID

    For example, the default hearthstone is item:6948 and innkeeper's daughter is item:64488.
    This worked fine for the new Eternal Traveler's Hearthstone for me, but did not work at all for my Holographic Digitalization Hearthstone or Tome of Town Portal. Any time I tried to use the macro with other hearthstones added it would only cast the Eternal Traveler's for me and after removing it would not cast either of the other two at all.

  8. #8
    Indeed, Tome of Town portal doesn't work with /castrandom.

    You only got Eternal Traveler because you didn't let it finish the cast. Let it finish the cast or reload the UI for a chance to get a different one.

  9. #9
    Immortal FuxieDK's Avatar
    Join Date
    Apr 2012
    Location
    København
    Posts
    7,251
    Thanx for all the suggestions..

    In the end, I ended up with this
    Code:
    #showtooltip
    /castrandom [mod:ctrl]item:64488,item:162973,item:163045,item:165669,item:165670,item:165802,item:166746,item:166747,item:168907,item:172179
    /cast [mod:alt]item:110560
    /cast [mod:shift]item:140192
    /cast [nomod]item:141605
    FlightMaster's Whistle with <No modifier>
    Garrison Hearthstone with <Alt>
    Dalaran Hearthstone with <Shift>
    and then a random stone with <Ctrl>

    The only "problem" is that while holding down <Ctrl> it will ALWAYS display the first item in the Castrandom command.....It cold have been cool if it actually showed the stone that would be used.

    Also, there cannot be a space between the items... The suggetion here was showed with spaces in and it didn't work.
    There is 21 characters left (234/255), so room for one more HS, and I haven't collected Peddlefeet's Lovely Hearthstone, so that's just perfect

    "Standard HS" is not in the list, as I deem it too boring, and it takes up space in backpack.

    Feel free to use and modify, as you see fit.
    Last edited by FuxieDK; 2019-11-25 at 06:24 AM.
    Fact (because I say so): TBC > Cata > Legion > MoP > BfA > WoD = WotLK

    My pet collection --> http://www.warcraftpets.com/collection/FuxieDK/

  10. #10
    That's fascinating. My random stone macro has no spaces in it, I typically write my code with no spaces, but when I share/fix/create code for threads like this, I do my best to space things out because I've had people critique my "squished code" and want to avoid that. I wondered why mine worked and my example didn't, now I know lol.


    addons
    weakauras
    Lua Wall of Shame
    Originally Posted by Zarhym (Blue Tracker)
    this thread is a waste of internet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •