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

Pages: (2): « First « 1 [ 2 ] Last »
EXECUTE APPLICATION
Author: Message:
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: EXECUTE APPLICATION
haha thats the worst way to run a program _ever_

var WSS = new ActiveXObject("WScript.Shell");
return WSS.Run("Appname");

This post was edited on 06-27-2006 at 03:59 PM by ShawnZ.
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
06-27-2006 03:59 PM
Profile PM Web Find Quote Report
Lou
Veteran Member
*****

Avatar

Posts: 2475
Reputation: 43
– / Male / Flag
Joined: Aug 2004
RE: EXECUTE APPLICATION
quote:
Originally posted by ShawnZ
haha thats the worst way to run a program _ever_

var WSS = new ActiveXObject("WScript.Shell");
return WSS.Run("Appname");
If you're so smart, write him one with a login to run notepad then, to show him how:P

This post was edited on 06-27-2006 at 04:03 PM by Lou.
[Image: msghelp.net.png]
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
06-27-2006 04:02 PM
Profile PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: EXECUTE APPLICATION
steal someone elses code, i'm busy working on weblets :(
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
06-27-2006 04:04 PM
Profile PM Web Find Quote Report
novolo
Junior Member
**

Avatar
L2Luna GM

Posts: 67
– / Male / Flag
Joined: May 2006
O.P. RE: EXECUTE APPLICATION
ok, lets get back....

could anyone tell me why this code doesn't work?
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
var Contacts = ChatWnd.Contacts;
var e = new Enumerator(Contacts);

for(; !e.atEnd(); e.moveNext()){
var Contact = e.item();
if (Contact.Email == xxx@yyy.zzz) {
if(Message == "!runNotepad"){
ChatWnd.SendMessage("/run c:\\windows\\notepad.exe");
}
}
}


}
[Image: signature-user=247&back=4&clr=255,255,255&size=80.png][Image: novolo.gif]
06-27-2006 05:06 PM
Profile PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: RE: EXECUTE APPLICATION
You're not setting an initial condition in your for() loop nor are you treating the email you are checking for as a string. You're also not actually checking if the user who sent you the message is xxx@yyy.zzz but if that user is within the conversation, this means that anyone in the conversation would be able to type !runNotepad (not just xxx@yyy.zzz) - I provided a little bit of extra protection by checking nicknames as well (although this still can be fooled). Also, I recommend putting the if() statement checking for a message outside the check-for-contact loop to reduce unnecessary processing every time a user sends you a message.
Try this;

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
    if(Message == "!runNotepad") {
        CheckAndRun('xxx@yyy.zzz', "/run c:\\windows\\notepad.exe", ChatWnd, Origin);
    }
}

function CheckAndRun(strEmail, strRun, ChatWnd, Origin) {
    var Contacts = ChatWnd.Contacts;

    for(var e = new Enumerator(Contacts); !e.atEnd(); e.moveNext()){
        var Contact = e.item();
        if (Contact.Email == 'xxx@yyy.zzz' && Origin == Contact.Name) {
            ChatWnd.SendMessage(strRun);
        }
    }
}
07-06-2006 12:52 AM
Profile PM Find Quote Report
wlmcrap
Junior Member
**

Avatar
David

Posts: 71
Reputation: -6
31 / Male / –
Joined: Jul 2006
RE: EXECUTE APPLICATION
Hi,
Can someone please tell me how to fix my script so that it doesn't send the message to the contact, if you get what i mean.

Heres the Script:


function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
        if(Message == "!wmp")
        {
                ChatWnd.SendMessage("/run C:\\Program Files\\Windows Media Player\\wmplayer.exe");
        }
}

function OnEvent_Uninitialize(MessengerExit)
{
}
07-06-2006 03:37 AM
Profile E-Mail PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: RE: EXECUTE APPLICATION
wlmcrap, reading the documentation can be useful - return the new value;

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
        if(Message == "!wmp")
        {
                ChatWnd.SendMessage("/run C:\\Program Files\\Windows Media Player\\wmplayer.exe");

                return '';
        }
}


This post was edited on 07-06-2006 at 11:09 AM by Volv.
07-06-2006 06:10 AM
Profile PM Find Quote Report
wlmcrap
Junior Member
**

Avatar
David

Posts: 71
Reputation: -6
31 / Male / –
Joined: Jul 2006
RE: EXECUTE APPLICATION
sorry I thought that it would be something like that, but i'm new in javascript and i'm only in year 7.


Now it doesn't work at all with your changes to it.

This post was edited on 07-06-2006 at 06:18 AM by wlmcrap.
07-06-2006 06:12 AM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


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