my code

Andreas Spegel

Custom UseHearthstone
by Andreas Spegel


Snippet options

Download: Download snippet as custom-usehearthstone.cpp.
Copy snippet: For this you need a free my code account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

        <!-- Custom UseHearthstone -->        
            <CustomBehavior File="RunCode" Type="Definition"><![CDATA[ 
                async Task UseHearthstoneTo(uint ToLoc)
                    WoWItem Hearthstone = Me.BagItems.FirstOrDefault(x => x.Entry == 6948);
                    if (Hearthstone == null || Me.HearthstoneAreaId != ToLoc || Me.SubZoneId == Me.HearthstoneAreaId) return;
                    if (Hearthstone.CooldownTimeLeft.TotalMilliseconds <= 30000 && Hearthstone.CooldownTimeLeft.TotalMilliseconds > 0)
                        Logging.Write(System.Windows.Media.Colors.Yellow, "[Profile]: Hearthstone is on cooldown! Waiting until it's off...!"); 
                        await Coroutine.Wait(30000, () => Hearthstone.CooldownTimeLeft.TotalMilliseconds == 0); 
                    if (Hearthstone.CooldownTimeLeft.TotalMilliseconds == 0)
                        Logging.Write(System.Windows.Media.Colors.Yellow, "[Profile]: Using our Hearthstone"); 
                        await CommonCoroutines.LandAndDismount();
                        await CommonCoroutines.StopMoving();                     
                        await Coroutine.Wait(15000, () => Me.SubZoneId == Me.HearthstoneAreaId); 
                        await Coroutine.Sleep(1500); 
        <!-- Custom UseHearthstone -->
        <CustomBehavior File="RunCode" Code="await UseHearthstoneTo(123456)" /> 

Create a free my code account now.

my code is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.