Script Work for One Account - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Script Work for One Account (/showthread.php?tid=80215)
Script Work for One Account by Eddie on 12-19-2007 at 03:05 AM
Simple question, what is the code if i want a script to work for a single account only, so it doesn't load / work on others?
RE: Script Work for One Account by MeEtc on 12-19-2007 at 03:21 AM
for all of the event functions, you'll have to put all of the code within an if statement
code: function OnEvent_Initialize(MessengerStart){
if (Messenger.MyUserId == <your messenger ID>) {
//do stuff
}
}
RE: Script Work for One Account by Eddie on 12-19-2007 at 03:34 AM
quote: Originally posted by MeEtc
for all of the event functions, you'll have to put all of the code within an if statement
code: function OnEvent_Initialize(MessengerStart){
if (Messenger.MyUserId == <your messenger ID>) {
//do stuff
}
}
So for every function i must do that? :/ isn't there a simpler one that effects the who script? thanks though.
This is the old Replacer script with Animoticons...code: function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
return sMessage.replace(/:\)/gi,"=)").replace(//gi,"=D").replace(//gi,"=O").replace(//gi,"=P").replace(/:-\#/gi,"=#").replace(/\(h\)/gi,"{h}").replace(/8-\|/gi,"8o)").replace(/\(brb\)/gi,"{brb}").replace(/\^o\)/gi,"=/").replace(//gi,"=S").replace(/:\|/gi,"=|").replace(/:\(/gi,"=(").replace(/:-\*/gi,"=*").replace(/:\$/gi,"=$").replace(/:\@/gi,"=@").replace(/\+o\(/gi,"=o(").replace(/8o\|/gi,"=o|").replace(/\(a\)/gi,"{a}").replace(/\(6\)/g
i,"{6}").replace(/\(co\)/gi,"{co}").replace(/\(e\)/gi,"{e}").replace(/\(t\)/gi,"{t}").replace(/\(i\)/gi,"{i}").replace(/\(mp\)/gi,"{mp}").replace(/\(p\)/gi,"{p}").replace(/\(\~\)/gi,"{~}").replace(/\(o\)/gi,"{o}").replace(/\(um\)/gi,"{um}").replace(/\(\%\)/gi,"{%}").replace(/\(xx\)/gi,"{xx}").replace(/\(au\)/gi,"{au}").replace(/\(ap\)/gi,"{ap}").replace(/\(so\)/gi,"{so}").replace(/\(y\)/gi,"{y}").replace(/\(n\)/gi,"{n}").replace(/\(yn\)/gi,"{yn}
").replace(/\(h5\)/gi,"{h5}").replace(/\(m\)/gi,"{m}").replace(/\(ip\)/gi,"{ip}").replace(/\(\#\)/gi,"{#}").replace(/\(r\)/gi,"{r}").replace(/\(\*\)/gi,"{*2}").replace(/\(st\)/gi,"{st}").replace(/\(pi\)/gi,"{pi}").replace(/\(b\)/gi,"{b}").replace(/\(d\)/gi,"{d}").replace(/\(c\)/gi,"{c}").replace(/\(\&\)/gi,"{dog}").replace(/\(\@\)/gi,"{@}").replace(/\(tu\)/gi,"{tu}").replace(/\(sn\)/gi,"{sn}").replace(/\(bah\)/gi,"{bah}").replace(/\(nah\)/gi,"{n
ah}").replace(/\(l\)/gi,"{l}").replace(/\(u\)/gi,"{u}").replace(/\(k\)/gi,"{k}").replace(/\(f\)/gi,"{f}").replace(/\(w\)/gi,"{w}").replace(/\(z\)/gi,"{z}").replace(/\(x\)/gi,"{x}").replace(/\(\{\)\(\}\)/gi,"{{}}");
}
where would i put the script you provided? lol
RE: Script Work for One Account by prashker on 12-19-2007 at 03:37 AM
function OnEvent_Initialize(MessengerStart){
if (Messenger.MyUserId == <your messenger ID>) {
//do stuff (code goes here If I'm not mistaken)
}
}
RE: Script Work for One Account by Eddie on 12-19-2007 at 03:40 AM
quote: Originally posted by SonicSam
function OnEvent_Initialize(MessengerStart){
if (Messenger.MyUserId == <your messenger ID>) {
//do stuff (code goes here If I'm not mistaken)
}
}
I keep getting an error with the script, here is what i did, i am a serious scripting nub sorry...code: function OnEvent_Initialize(MessengerStart){
if (Messenger.MyUserId == <my email addy>) {
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
return sMessage.replace(/:\)/gi,"=)").replace(//gi,"=D").replace(//gi,"=O").replace(//gi,"=P").replace(/:-\#/gi,"=#").replace(/\(h\)/gi,"{h}").replace(/8-\|/gi,"8o)").replace(/\(brb\)/gi,"{brb}").replace(/\^o\)/gi,"=/").replace(//gi,"=S").replace(/:\|/gi,"=|").replace(/:\(/gi,"=(").replace(/:-\*/gi,"=*").replace(/:\$/gi,"=$").replace(/:\@/gi,"=@").replace(/\+o\(/gi,"=o(").replace(/8o\|/gi,"=o|").replace(/\(a\)/gi,"{a}").replace(/\(6\)/g
i,"{6}").replace(/\(co\)/gi,"{co}").replace(/\(e\)/gi,"{e}").replace(/\(t\)/gi,"{t}").replace(/\(i\)/gi,"{i}").replace(/\(mp\)/gi,"{mp}").replace(/\(p\)/gi,"{p}").replace(/\(\~\)/gi,"{~}").replace(/\(o\)/gi,"{o}").replace(/\(um\)/gi,"{um}").replace(/\(\%\)/gi,"{%}").replace(/\(xx\)/gi,"{xx}").replace(/\(au\)/gi,"{au}").replace(/\(ap\)/gi,"{ap}").replace(/\(so\)/gi,"{so}").replace(/\(y\)/gi,"{y}").replace(/\(n\)/gi,"{n}").replace(/\(yn\)/gi,"{yn}
").replace(/\(h5\)/gi,"{h5}").replace(/\(m\)/gi,"{m}").replace(/\(ip\)/gi,"{ip}").replace(/\(\#\)/gi,"{#}").replace(/\(r\)/gi,"{r}").replace(/\(\*\)/gi,"{*2}").replace(/\(st\)/gi,"{st}").replace(/\(pi\)/gi,"{pi}").replace(/\(b\)/gi,"{b}").replace(/\(d\)/gi,"{d}").replace(/\(c\)/gi,"{c}").replace(/\(\&\)/gi,"{dog}").replace(/\(\@\)/gi,"{@}").replace(/\(tu\)/gi,"{tu}").replace(/\(sn\)/gi,"{sn}").replace(/\(bah\)/gi,"{bah}").replace(/\(nah\)/gi,"{n
ah}").replace(/\(l\)/gi,"{l}").replace(/\(u\)/gi,"{u}").replace(/\(k\)/gi,"{k}").replace(/\(f\)/gi,"{f}").replace(/\(w\)/gi,"{w}").replace(/\(z\)/gi,"{z}").replace(/\(x\)/gi,"{x}").replace(/\(\{\)\(\}\)/gi,"{{}}");
})
}
}
RE: Script Work for One Account by davidpolitis on 12-19-2007 at 05:01 AM
Not everything's exactly working but I've spent enough time on it, lol.
code: function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if (Messenger.MyEmail == "YOUR EMAIL")
{
Message = Message.replace(/:\)/gi,"=)");
Message = Message.replace(/()/gi,"=D");
Message = Message.replace(/()/gi,"=O");
Message = Message.replace(/()/gi,"=P");
Message = Message.replace(/:-\#/gi,"=#");
Message = Message.replace(/\(h\)/gi,"{h}");
Message = Message.replace(/8-\|/gi,"8o)");
Message = Message.replace(/\(brb\)/gi,"{brb}");
Message = Message.replace(/\^o\)/gi,"=/");
Message = Message.replace(/(Smilie)/gi,"=S");
Message = Message.replace(/:\|/gi,"=|");
Message = Message.replace(/:\(/gi,"=(");
Message = Message.replace(/:-\*/gi,"=*");
Message = Message.replace(/:\$/gi,"=$");
Message = Message.replace(/:\@/gi,"=@");
Message = Message.replace(/\+o\(/gi,"=o(");
Message = Message.replace(/8o\|/gi,"=o|");
Message = Message.replace(/\(a\)/gi,"{a}");
Message = Message.replace(/\(6\)/gi,"{6}");
Message = Message.replace(/\(co\)/gi,"{co}");
Message = Message.replace(/\(e\)/gi,"{e}");
Message = Message.replace(/\(t\)/gi,"{t}");
Message = Message.replace(/\(i\)/gi,"{i}");
Message = Message.replace(/\(mp\)/gi,"{mp}");
Message = Message.replace(/\(p\)/gi,"{p}");
Message = Message.replace(/\(\~\)/gi,"{~}");
Message = Message.replace(/\(o\)/gi,"{o}");
Message = Message.replace(/\(um\)/gi,"{um}");
Message = Message.replace(/\(\%\)/gi,"{%}");
Message = Message.replace(/\(xx\)/gi,"{xx}");
Message = Message.replace(/\(au\)/gi,"{au}");
Message = Message.replace(/\(ap\)/gi,"{ap}");
Message = Message.replace(/\(so\)/gi,"{so}");
Message = Message.replace(/\(y\)/gi,"{y}");
Message = Message.replace(/\(n\)/gi,"{n}");
Message = Message.replace(/\(yn\)/gi,"{yn}");
Message = Message.replace(/\(h5\)/gi,"{h5}");
Message = Message.replace(/\(m\)/gi,"{m}");
Message = Message.replace(/\(ip\)/gi,"{ip}");
Message = Message.replace(/\(\#\)/gi,"{#}");
Message = Message.replace(/\(r\)/gi,"{r}");
Message = Message.replace(/\(\*\)/gi,"{*2}");
Message = Message.replace(/\(st\)/gi,"{st}");
Message = Message.replace(/\(pi\)/gi,"{pi}");
Message = Message.replace(/\(b\)/gi,"{b}");
Message = Message.replace(/\(d\)/gi,"{d}");
Message = Message.replace(/\(c\)/gi,"{c}");
Message = Message.replace(/\(\&\)/gi,"{dog}");
Message = Message.replace(/\(\@\)/gi,"{@}");
Message = Message.replace(/\(tu\)/gi,"{tu}");
Message = Message.replace(/\(sn\)/gi,"{sn}");
Message = Message.replace(/\(bah\)/gi,"{bah}");
Message = Message.replace(/\(nah\)/gi,"{nah}");
Message = Message.replace(/\(l\)/gi,"{l}");
Message = Message.replace(/\(u\)/gi,"{u}");
Message = Message.replace(/\(k\)/gi,"{k}");
Message = Message.replace(/\(f\)/gi,"{f}");
Message = Message.replace(/\(w\)/gi,"{w}");
Message = Message.replace(/\(z\)/gi,"{z}");
Message = Message.replace(/\(x\)/gi,"{x}");
Message = Message.replace(/\(\{\)\(\}\)/gi,"{{}}");
return Message;
}
}
RE: Script Work for One Account by aNILEator on 12-19-2007 at 05:29 AM
quote: Originally posted by davidpolitis
Not everything's exactly working but I've spent enough time on it, lol.
You forgot to fix the code for and some others you added ( & )'s around it
code: function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if (Messenger.MyEmail == "YOUR EMAIL")
{
Message = Message.replace(/:\)/gi,"=)");
Message = Message.replace(/:D/gi,"=D");
Message = Message.replace(/:O/gi,"=O");
Message = Message.replace(/:P/gi,"=P");
Message = Message.replace(/:-\#/gi,"=#");
Message = Message.replace(/\(h\)/gi,"{h}");
Message = Message.replace(/8-\|/gi,"8o)");
Message = Message.replace(/\(brb\)/gi,"{brb}");
Message = Message.replace(/\^o\)/gi,"=/");
Message = Message.replace(/:S/gi,"=S");
Message = Message.replace(/:\|/gi,"=|");
Message = Message.replace(/:\(/gi,"=(");
Message = Message.replace(/:-\*/gi,"=*");
Message = Message.replace(/:\$/gi,"=$");
Message = Message.replace(/:\@/gi,"=@");
Message = Message.replace(/\+o\(/gi,"=o(");
Message = Message.replace(/8o\|/gi,"=o|");
Message = Message.replace(/\(a\)/gi,"{a}");
Message = Message.replace(/\(6\)/gi,"{6}");
Message = Message.replace(/\(co\)/gi,"{co}");
Message = Message.replace(/\(e\)/gi,"{e}");
Message = Message.replace(/\(t\)/gi,"{t}");
Message = Message.replace(/\(i\)/gi,"{i}");
Message = Message.replace(/\(mp\)/gi,"{mp}");
Message = Message.replace(/\(p\)/gi,"{p}");
Message = Message.replace(/\(\~\)/gi,"{~}");
Message = Message.replace(/\(o\)/gi,"{o}");
Message = Message.replace(/\(um\)/gi,"{um}");
Message = Message.replace(/\(\%\)/gi,"{%}");
Message = Message.replace(/\(xx\)/gi,"{xx}");
Message = Message.replace(/\(au\)/gi,"{au}");
Message = Message.replace(/\(ap\)/gi,"{ap}");
Message = Message.replace(/\(so\)/gi,"{so}");
Message = Message.replace(/\(y\)/gi,"{y}");
Message = Message.replace(/\(n\)/gi,"{n}");
Message = Message.replace(/\(yn\)/gi,"{yn}");
Message = Message.replace(/\(h5\)/gi,"{h5}");
Message = Message.replace(/\(m\)/gi,"{m}");
Message = Message.replace(/\(ip\)/gi,"{ip}");
Message = Message.replace(/\(\#\)/gi,"{#}");
Message = Message.replace(/\(r\)/gi,"{r}");
Message = Message.replace(/\(\*\)/gi,"{*2}");
Message = Message.replace(/\(st\)/gi,"{st}");
Message = Message.replace(/\(pi\)/gi,"{pi}");
Message = Message.replace(/\(b\)/gi,"{b}");
Message = Message.replace(/\(d\)/gi,"{d}");
Message = Message.replace(/\(c\)/gi,"{c}");
Message = Message.replace(/\(\&\)/gi,"{dog}");
Message = Message.replace(/\(\@\)/gi,"{@}");
Message = Message.replace(/\(tu\)/gi,"{tu}");
Message = Message.replace(/\(sn\)/gi,"{sn}");
Message = Message.replace(/\(bah\)/gi,"{bah}");
Message = Message.replace(/\(nah\)/gi,"{nah}");
Message = Message.replace(/\(l\)/gi,"{l}");
Message = Message.replace(/\(u\)/gi,"{u}");
Message = Message.replace(/\(k\)/gi,"{k}");
Message = Message.replace(/\(f\)/gi,"{f}");
Message = Message.replace(/\(w\)/gi,"{w}");
Message = Message.replace(/\(z\)/gi,"{z}");
Message = Message.replace(/\(x\)/gi,"{x}");
Message = Message.replace(/\(\{\)\(\}\)/gi,"{{}}");
return Message;
}
}
RE: RE: Script Work for One Account by davidpolitis on 12-19-2007 at 05:34 AM
quote: Originally posted by aNILEator
You forgot to fix the code for
lol, my bad. Smilies really should've been disabled in the post to begin with :/
RE: Script Work for One Account by aNILEator on 12-19-2007 at 05:36 AM
[noparse] Is your friend :)[/noparse]
RE: Script Work for One Account by Eddie on 12-19-2007 at 05:39 AM
oops, sorry guys, and thanks, appreciated
RE: RE: Script Work for One Account by davidpolitis on 12-19-2007 at 01:46 PM
quote: Originally posted by [b
markee[/b]]code: //write as many strings separated by commas as you want. have a single quoted string if you only want one.
var emails = new Array("<put your email address here","<a
second email address if you want","<want a third one as well>");
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
for(i in emails){
if (Messenger.MyUserId == emails[i]){
return sMessage.replace(/:(?:\)|D|O|P|-\#|S|\||\(|-\*|\$|\@)|\((?:h|brb|6|co|a|e|t|i|mp|p|~|o|um|%|xx|au|ap|so|y|n|yn|h5|m|ip|#|r|\*|st|pi|b|d|c|&|@|tu|sn|bah|nah|l|u|k|f|w|z|x|\{\)\(\})\)|8-\|\^o\)|\+o\(|8o\|/gi,function($1){
if($1.charAt(0) === ":"){
$1.replace(/:-?/,"=");
}else if($1.charAt(0 === "("){
$1.replace(/\(|\)|\*|&/g,function($1){
switch($1){
case "(": return "{";
case ")": return "}";
case "*": return "*2";
case "&": return "dog";
}
}
}else{
switch($1){
case "8-|": return "8o)";
case "^o)": return "=/";
case "\+o(": return "=o(";
case "8o|": return "=o|";
}
}
});
}
}
}
RE: Script Work for One Account by aNILEator on 12-19-2007 at 02:39 PM
kinda nice to see a simple old script and my emoticons still getting some attention
I was going to animate the bunny and I'm too
RE: Script Work for One Account by markee on 12-23-2007 at 12:01 PM
After a bit of work WDZ told me what I was doing wrong with my script (such a simple thing that I should have noticed myself ). Anyway, here is my new version of the script code, add your email to the array (add more or take them away as you please).
code: var emails = new Array("email@address.com","another@email.com","yet_another@emailaddy.com");//Add your email to this array
var re = /:(?:|[DOP()$@S]|-[#*])|\((?:[6e~#r*d&@lkfwz%]|co?|au?|[ima]p?|um?|x{1,2}|yn?|h5?|s[nto]?|pi?|tu?|[nb](?:ah)?|brb|\{\)\(\})\)|8(?:-|o)\||\^o\)|\+o\(/gi;
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
for(i in emails){
if(Messenger.MyEmail == emails[i]){
return sMessage.replace(re,function($1){
Debug.Trace($1);
if($1.charAt(0) === ":"){
return $1.replace(/:-?/,"=");
}else if($1.charAt(0) === "("){
return $1.replace(/\(|\)|\*|&/g,function($1){
Debug.Trace($1);
switch($1){
case "(": return "{";
case ")": return "}";
case "*": return "*2";
case "&": return "dog";
}
});
}else{
switch($1){
case "8-|": return "8o)";
case "^o)": return "=/";
case "\+o(": return "=o(";
case "8o|": return "=o|";
}
}
});
}
}
}
RE: Script Work for One Account by aNILEator on 12-23-2007 at 12:07 PM
Don't fancy making a nice plsc f it then Markee
P.S. I wanted to create a proper pack/content installer for this. If when I get home I were to animate the bunny and I'm and maybe some others does anyone know how to create an installer/content installer?
RE: Script Work for One Account by markee on 12-23-2007 at 12:11 PM
I dont want to make a plsc, I'm on holidays so someone else can do t for me
|