EXECUTE APPLICATION |
Author: |
Message: |
ShawnZ
Veteran Member
Posts: 3146 Reputation: 43
32 / /
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 |
|
|
Lou
Veteran Member
Posts: 2475 Reputation: 43
– / /
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
This post was edited on 06-27-2006 at 04:03 PM by Lou.
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 |
|
|
ShawnZ
Veteran Member
Posts: 3146 Reputation: 43
32 / /
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 |
|
|
novolo
Junior Member
L2Luna GM
Posts: 67
– / /
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");
}
}
}
}
|
|
06-27-2006 05:06 PM |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
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 |
|
|
wlmcrap
Junior Member
David
Posts: 71 Reputation: -6
31 / / –
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 |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
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 |
|
|
wlmcrap
Junior Member
David
Posts: 71 Reputation: -6
31 / / –
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 |
|
|
Pages: (2):
« First
«
1
[ 2 ]
Last »
|
|