Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Shutdown PC on HS CD 1.0.0

(0 reviews)

I've been using Schedule product for a while now but was not able to figure out how to shutdown pc after it's done.

I am still not lvl 60 so I use the Scheduler in a way that it ends with /To home, in other words it uses HS.

So I coded this plugin to check HS cooldown. If it is on CD, which means the Scheduler has finished, it shuts down the PC.

 

WARNING: do not start bot with this plugin enabled when having your HS on CD, it will shut your PC down right then and there, obviously ;)

User Feedback

Recommended Comments

reapler

Elite user

@Seminko nice to have the plugin. I'd recommend to check the duration off your hearthstone rather to just check if it's on cooldown or using events for it:

        wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) =>
        {
            if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_SUCCEEDED && args[0] == "player" && args[1] == "Hearthstone")
            {
                robotManager.Helpful.Logging.Write("Player casted hearthstone\n=>Start Shutdown in 3 seconds");
                var t = System.Threading.Tasks.Task.Run(async delegate
                {
                    await System.Threading.Tasks.Task.Delay(3000);
                    robotManager.Helpful.Logging.Write("Shutdown...");
		    Thread.Sleep(100)
                    Process.Start("shutdown", "/s /t 0");
                });
            }
        };

It needs no loop.

Seminko

Members

Will look into it. Thanks!

Seminko

Members

20 hours ago, reapler said:

@Seminko nice to have the plugin. I'd recommend to check the duration off your hearthstone rather to just check if it's on cooldown or using events for it:

It needs no loop.

wManager.Wow.Enums.LuaEventsId doesn't containt definition for UNIT_SPELLCAST_SUCCEEDED

I'm using vanilla wrobot

reapler

Elite user

@Seminko I haven't currently the binaries for vanilla, but you can try this instead

            float minutesLeft = 29.5f; //define this above loop     if patch is wotlk or above else use 59.5f for vanilla and tbc
            if (wManager.Wow.Helpers.SpellManager.GetSpellCooldownTimeLeft(8690) / 1000 / 60 > minutesLeft) // if HS is used, wait 15 seconds, write into log file and shutdown the computer
            {
                Logging.Write("Shutdown in 15 seconds");
                Thread.Sleep(15000);
                Process.Start("shutdown", "/s /t 0");
            }

I'm pretty sure someone can provide you the event because this is bogus to check in loop ;)

Seminko

Members

32 minutes ago, reapler said:

@Seminko I haven't currently the binaries for vanilla, but you can try this instead


            float minutesLeft = 29.5f; //define this above loop     if patch is wotlk or above else use 59.5f for vanilla and tbc
            if (wManager.Wow.Helpers.SpellManager.GetSpellCooldownTimeLeft(8690) / 1000 / 60 > minutesLeft) // if HS is used, wait 15 seconds, write into log file and shutdown the computer
            {
                Logging.Write("Shutdown in 15 seconds");
                Thread.Sleep(15000);
                Process.Start("shutdown", "/s /t 0");
            }

I'm pretty sure someone can provide you the event because this is bogus to check in loop ;)

How is this different to what I'm doing? I'm checking for item cooldown, you're checking for spell cooldown.

reapler

Elite user

oh haven't looked there, it doesn't matter.

Seminko

Members

13 hours ago, reapler said:

oh haven't looked there, it doesn't matter.

I would really like to try the event, without the while loops. I saw you giving the exact code with UNIT_SPELLCAST_SUCCEEDED to someone and he "liked" it so presumably it works. Not sure why it doesn't work for my particular case. Maybe cause it's a plugin and with how they are structured?

reapler

Elite user

@Seminko It's because the events are different from vanilla to wotlk. I had assumed you are using some higher client since you post your plugin here.

For vanilla you might look in your decompiler under LuaEventsId.

"SPELLCAST_START" looks fine for your goal for finished cast dunno.

           if (id == wManager.Wow.Enums.LuaEventsId.SPELLCAST_START && args[0] == "player" && args[1] == "Hearthstone")

The "args[]" should be also fine (i don't think they have changed something as it was replaced by "UNIT_SPELLCAST_START" in 2.4).

Otherwise you can test & lookup what's in the arguments or use other LuaEventsId:

        wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) =>
        {
            if (id == wManager.Wow.Enums.LuaEventsId.SPELLCAST_START)
            {
                for (var i = 0; i < args.Count; i++)
                {
                    robotManager.Helpful.Logging.Write("args["+i+"] contains: "+args[i]);
                }
            }
        };

 

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.