[ help ] Stop script from running on both msn's |
Author: |
Message: |
CarlosHero
New Member
Super Man
Posts: 11
– / /
Joined: Oct 2009
|
O.P. [ help ] Stop script from running on both msn's
I have a script which reads from a txt file when i send the command [read], but because i have the script installed myself to test it when im signed into 2 accounts it doesn't work, how would i make it so the script only runs on the account the message is received on. Also i noticed when i signed into ebuddy to test it i was still signed into 2 accounts and it din't work but id be guessing that would be the same problem. So i just need to know how to make it only run on the account that receives the command.
Regards,
CH
|
|
10-29-2009 02:37 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: [ help ] Stop script from running on both msn's
You have to check the email of the user running the script. It'll be the only way as scripts run an instance for each instance of WLM open.
<Eljay> "Problems encountered: shit blew up"
|
|
10-29-2009 03:04 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [ help ] Stop script from running on both msn's
js code: var bEnabled = true;
function OnEvent_Initialize () {
if ( Messenger.MyStatus < STATUS_INVISIBLE ) return false;
if ( Messenger.MyEmail !== 'johndoe@hotmail.com' ) {
bEnabled = false;
}
}
function OnEvent_SigninReady () {
OnEvent_Initialize ();
}
Then before doing anything check the variable bEnabled
js code: function OnEvent_ChatWndReceiveMessage ( ... ) {
if ( bEnabled === true ) {
// ... do things here
}
}
This post was edited on 10-29-2009 at 03:11 PM by matty.
|
|
10-29-2009 03:09 PM |
|
|
CarlosHero
New Member
Super Man
Posts: 11
– / /
Joined: Oct 2009
|
O.P. RE: [ help ] Stop script from running on both msn's
Thanks for the replyg guys.
@matty when I tested the code when I read the txt file it shown up as a blank message in both conversations.
Would something like this work instead of having to use the email.
code: if(Origin!=Messenger.MyName){ // If the receive message isn't send by you
|
|
10-29-2009 03:18 PM |
|
|
tribbium
Junior Member
Posts: 34 Reputation: 3
– / /
Joined: Jul 2008
|
RE: [ help ] Stop script from running on both msn's
Haven't tested it but, couldn't you write to a file or the registry flagging that the program has been initialized so that other instances can recognize it and not initialize?
|
|
10-29-2009 03:38 PM |
|
|
CarlosHero
New Member
Super Man
Posts: 11
– / /
Joined: Oct 2009
|
O.P. RE: [ help ] Stop script from running on both msn's
I'm not sure mate haven't tried that but wouldn't have a clue where to start to test it.
|
|
10-29-2009 03:50 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [ help ] Stop script from running on both msn's
quote: Originally posted by CarlosHero
Thanks for the replyg guys.
@matty when I tested the code when I read the txt file it shown up as a blank message in both conversations.
Would something like this work instead of having to use the email.
code: if(Origin!=Messenger.MyName){ // If the receive message isn't send by you
That would work only if your names are different. But then this isn't exactly the answer to your question. You asked how to make a script work only for a specific email which is what I provided. Not how to reply to a message only if you aren't the original sender.
|
|
10-29-2009 03:58 PM |
|
|
CarlosHero
New Member
Super Man
Posts: 11
– / /
Joined: Oct 2009
|
O.P. RE: [ help ] Stop script from running on both msn's
Ah sorry if you misunderstood me, what I meant to say was how would I make the script only run on the account the command was received on. Say i was signed in on 2 seperate account without needing to know the email. Like how would I add it to this
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message,MsgKind){
if(Message.indexOf("[read]")>0){
sendstatus(ChatWnd);
return Message.substr(0,Message.indexOf("[read"));
}
Would this work?
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message,MsgKind){
if(Origin!=Messenger.MyName){ // If the receive message isn't send by you
if(Message.indexOf("[read]")>0){
sendstatus(ChatWnd);
return Message.substr(0,Message.indexOf("[read"));
}
}
This post was edited on 10-29-2009 at 04:46 PM by CarlosHero.
|
|
10-29-2009 04:45 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [ help ] Stop script from running on both msn's
quote: Originally posted by CarlosHero
Ah sorry if you misunderstood me, what I meant to say was how would I make the script only run on the account the command was received on. Say i was signed in on 2 seperate account without needing to know the email. Like how would I add it to this
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message,MsgKind){
if(Message.indexOf("[read]")>0){
sendstatus(ChatWnd);
return Message.substr(0,Message.indexOf("[read"));
}
Would this work?
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message,MsgKind){
if(Origin!=Messenger.MyName){ // If the receive message isn't send by you
if(Message.indexOf("[read]")>0){
sendstatus(ChatWnd);
return Message.substr(0,Message.indexOf("[read"));
}
}
js code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message,MsgKind){
if(Origin!=Messenger.MyName){ // If the receive message isn't send by you
if(Message.indexOf("[read]")>0){
sendstatus(ChatWnd);
return Message.substr(0,Message.indexOf("[read"));
}
>>> }<<<
}
You missed the highlighted }
|
|
10-29-2009 04:59 PM |
|
|
CarlosHero
New Member
Super Man
Posts: 11
– / /
Joined: Oct 2009
|
O.P. RE: [ help ] Stop script from running on both msn's
I tried adding it to this mate
code: function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message,MsgKind){
if(Origin!=Messenger.MyName){ // If the receive message isn't send by you
if(Message.indexOf("[read]")>0){
sendstatus(ChatWnd);
return Message.substr(0,Message.indexOf("[read"));
}
}
But when I test it say I'm A sending the commands i see it like
A says: hai [read]
B says:
And B see's it like
A says: hai
B says: Online
But I'm supposed to see it like
A says: hai [read]
B says: Online
and B is supposed to see it like
A says: hai
B says:
Regards,
CH
This post was edited on 10-29-2009 at 07:22 PM by CarlosHero.
|
|
10-29-2009 05:11 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|