Shutdown game client

Hello.

Arcitectus, thank you very much for cool framework.

I’m implementing some useful features to mining script and got one unresolved question:

“How to correctly quit the game client?” (I need to shutdown it at exact time)

“Alt+F4” is not working here. We need to click ESCAPE and “Quit Game” button after? But how to operate with system menu? I cannot find it in API.

Thanks in advance

Well. I found keyboard combination (ALT+SHIFT+Q).

Command is

Sanderling.KeyboardPressCombined(new[]{ VirtualKeyCode.LMENU, VirtualKeyCode.SHIFT, VirtualKeyCode.VK_Q});

P.S. First time we need to set checkbox to Quit without confirmation.

P.P.S. Now need to try to shutdown system with commands like  System.Diagnostics.Process.Start(“Shutdown”, “-s -t 10”);

1 Like

Well. I found keyboard combination (ALT+SHIFT+Q).

Command is

Sanderling.KeyboardPressCombined(new[]{ VirtualKeyCode.LMENU, VirtualKeyCode.SHIFT, VirtualKeyCode.VK_Q});

P.S. First time we need to set checkbox to Quit without confirmation.

P.P.S. Now need to try to shutdown system with commands like  System.Diagnostics.Process.Start(“Shutdown”, “-s -t 10”);

Thats good to know.

I assume you then don’t need anything from the system menu for the time being. Let me know in case you need some info thats not yet in the API.

I have no experience with shutting down windows from the script.

Yes, at the moment there’s no need in system menu. Thanks.
All is working good with those lines of code: shutting game client and shutting windows if necessary.

void CloseClient()
{
    Sanderling.WindowPostMessage(WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
}

1 Like