O.P. Need scripting help
Hi,
I'm trying to write a script that when I log on from my cell phone messenger client that my home PC messenger change my Display Picture to a mobile picture, then wait 10 mins of idle and change it again to another DP then wait 2 mins and change it back to my default one.
So far I've writen this but it dosent work at all... What I'm doing wrong ?
I would really appreciate some help as I'm not used in jscripting.
Thank you
Juffle
-----Code-----
var mobileCode = "(mp)";
function OnEvent_MyNameChange(NewName) {
if (Messenger.MyName.lastIndexOf(mobileCode)) {
MsgPlus.AddTimer(on,5000);
}
}
function OnEvent_Timer(TimerId) {
if (TimerId == "on") {
Messenger.MyDisplayPicture = MsgPlus.ScriptFilesPath + "\\images\\mobile_on.gif";
MsgPlus.AddTimer(off,600000);
}
else if (TimerId == "off") {
Messenger.MyDisplayPicture = MsgPlus.ScriptFilesPath + "\\images\\mobile_off.gif";
MsgPlus.AddTimer(default,120000);
}
else if (TimerId == default) {
Messenger.MyDisplayPicture = MsgPlus.ScriptFilesPath + "\\images\\default.gif";
Messenger.MyName = Messenger.MyName.replace(mobileCode,"");
}
}
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
if (Origin == Messenger.MyName) {
if (Messenger.MyName.lastIndexOf(mobileCode)) {
MsgPlus.CancelTimer(off);
MsgPlus.CancelTimer(default);
MsgPlus.AddTimer(on,5000);
}
}
}
---End Of Code-----
|