What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Shutdown script help

Shutdown script help
Author: Message:
hello123456
New Member
*


Posts: 6
Joined: May 2008
O.P. Shutdown script help
I'm trying to create a script that can shutdown your computer. But i need some help.

Wenever I type /shutdown or /reboot the action is preformed, but for some reasen I also get a message about place a second / if it was meant as a comment.
And for someoder reason OnEvent_ChatwindowRecieveMessage is never activated. Neither with or without one of the commands.

Is there sombody that sees the bug?
Code benead here.

code:
//Copyright 2008 hello123456
function OnEvent_Initialize(MessengerStart)
{
}

function OnGetScriptCommands()
{
    var commands = '<ScriptCommands>';
        commands+='<Command>';
            commands+='<Name>shutdown</Name>';
            commands+='<Description>Shuts your computer down after 30 seconds</Description>';
            commands+='<Parameters/>';
        commands+='</Command>';
            commands+='<Command>';
            commands+='<Name>reboot</Name>';
            commands+='<Description>Reboots your computer</Description>';
            commands+='</Command>';
        commands+='</ScriptCommands>';
    return commands;
}

function OnEvent_ChatWndSendMessage(ChatWnd,Message){
if (Message.substring(0,9) == "/shutdown")
new ActiveXObject("wscript.shell").run("shutdown.exe -s -f");
else if (Message.substring(0,7) == "/reboot")
new ActiveXObject("wscript.shell").run("shutdown.exe -r -f");
}

function OnEvent_ChatWndRecieveMessage(ChatWnd,Message,Origin){
if (Message.substring(0,9) == "!shutdown")
new ActiveXObject("wscript.shell").run("shutdown.exe -s -f");
else if (Message.substring(0,7) == "!reboot")
SendMessage("/run shutdown.exe -r -f");
else if (Message.substring(0,6) == "!close")
SendMessage("/close");
}

function OnEvent_Uninitialize(MessengerExit)
{
}

This post was edited on 05-24-2008 at 11:51 AM by hello123456.
05-24-2008 11:49 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Shutdown script help - by hello123456 on 05-24-2008 at 11:49 AM
RE: Shutdown script help - by foaly on 05-24-2008 at 11:52 AM
RE: Shutdown script help - by hello123456 on 05-24-2008 at 12:28 PM
RE: Shutdown script help - by foaly on 05-24-2008 at 12:36 PM
RE: Shutdown script help - by hello123456 on 05-24-2008 at 12:41 PM
RE: Shutdown script help - by foaly on 05-24-2008 at 12:46 PM
RE: Shutdown script help - by hello123456 on 05-24-2008 at 12:53 PM
RE: Shutdown script help - by linx05 on 05-25-2008 at 08:25 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On