• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

MQ2Shutdown

Alatyami

NotAddicted.com Engineer (Retired)
Joined
Dec 21, 2004
RedCents
804¢
I had to take a break from working on the buff plugin for TheZ ...

MQ2Shutdown, will do just as it implies ... it will shutdown your computer, by send Microsoft Windows the shutdown command. How is this helpful? There are a few times that I know that my macro is only going to run for a set time period and then my desktop is just going to sit there doing nothing, so now once my macro is completed, it shuts down my desktop.

This is a very simple plugin.

Edit: Updated Compiled Library to Version 1.2, that includes the /logout and /reboot

Usage:
Rich (BB code):
/shutdown    
/reboot
/logout

Source Code (VC++ 2003):
Rich (BB code):
// MQ2Shutdown.cpp 
// Author: Alatyami, Redguides.com, 2007
// 
// This plugin allows your to shutdown, reboot, or logout of MS Windows.
//
// MOD NOTES:
//  01/24/2007	Initial Release. - Alatyami
//                   Made the SystemRoot Dynamic - Alatyami
//  01/25/2007	Added /logout and /reboot - Alatyami
//
// USAGE:
//   /shutdown     ** Shutsdown and powers off Windows.
//   /logout          ** Closes out all running apps and logs out of Windows
//   /reboot        ** Closes out all running apps and reboots your machine.


#include "../MQ2Plugin.h"

#include <stdlib.h>

PreSetup("MQ2Shutdown"); PLUGIN_VERSION(1.2);

// PROTOTYPES
void shutdownCommand(PSPAWNINFO pChar, PCHAR szLine);
void rebootCommand(PSPAWNINFO pChar, PCHAR szLine);
void logoutCommand(PSPAWNINFO pChar, PCHAR szLine);


// FUNCTIONS
void shutdownCommand(PSPAWNINFO pChar, PCHAR szLine) {
	system("\%SystemRoot\%\\System32\\shutdown.exe -s -f -t 00");
}

void rebootCommand(PSPAWNINFO pChar, PCHAR szLine) {
	system("\%SystemRoot\%\\System32\\shutdown.exe -r -f -t 00");
}

void logoutCommand(PSPAWNINFO pChar, PCHAR szLine) {
	system("\%SystemRoot\%\\System32\\shutdown.exe -l -f -t 00");
}

PLUGIN_API VOID InitializePlugin(VOID) {
	DebugSpewAlways("Initializing MQ2Shutdown");
	AddCommand("/shutdown",shutdownCommand);
	AddCommand("/reboot",rebootCommand);
	AddCommand("/logout",logoutCommand);
}

PLUGIN_API VOID ShutdownPlugin(VOID) {
	DebugSpewAlways("Shutting down MQ2Shutdown");
	RemoveCommand("/shutdown");
	RemoveCommand("/reboot");
	RemoveCommand("/logout");
}
 
Last edited:
Very handy plugin-in here is the idea i had to make it a little better.
Use %SystemDrive% or a %SystemRoot% instead of just using C:. because not all of us have a c drive where windows resides.
 
Nice little toy, yami...I know that sometimes when I finish eq, this would be easier than /exit + blah + shutting down...
 
Pugs said:
Very handy plugin-in here is the idea i had to make it a little better.
Use %SystemDrive% or a %SystemRoot% instead of just using C:. because not all of us have a c drive where windows resides.

Doh ... can't believe I didn't think about that ... recompile coming up soon ...

Updated DLL posted ...
 
Would it be possible to incorporate a /restart also?.

I occasionally have connectivity probems with my router and also graphics problems when dual botting toons using wineq. Regularly have to reboot etc when i get the "Device Reset Failed" message.

a /restart would be excellent. ;)
 
sure thing .... I'll stick in restart and log out ....

EDIT: Updated w/ logout and reboot.
 
Last edited:
MQ2Shutdown

Users who are viewing this thread

Back
Top
Cart