O.P. RE: Help with Timer (AddTimer)
I rebuild the script from the ground up and I made it work, thanks to you, I only want to add a last functionality: status clone, how can I? I read the documentation I tried and couldn't:
var old_NN = "N/A";
var old_DP = "N/A";
var old_PM = "N/A";
var con_inf= "N/A";
////////////////////////////START BACKUP FUNCTION////////////////////////
function backup () {
old_NN = Messenger.MyName;
old_DP = Messenger.MyDisplayPicture;
old_PM = Messenger.MyPersonalMessage;
}
function OnEvent_SigninReady (Email) {
backup ();
}
////////////////////////////END BACKUP FUNCTION////////////////////////
function dpToast (whois) {
whois = MsgPlus.RemoveFormatCodes(whois);
whois = "You've become " + whois;
MsgPlus.DisplayToast ("Script Stared", whois);
}
function _clone (con_inf) {
var e = new Enumerator (con_inf);
var Cnt = e.item ();
Messenger.MyName = Cnt.Name;
Messenger.MyDisplayPicture = Cnt.DisplayPicture
Messenger.MyPersonalMessage = Cnt.PersonalMessage;
}
function OnEvent_Timer (_cloneR) {
if (_cloneR == "_cloneR") {
_clone (con_inf);
MsgPlus.AddTimer("_cloneR", 5000);
}
}
function OnEvent_ChatWndSendMessage (ChatWnd, Message) {
if (Message == '/clone') {
con_inf = ChatWnd.Contacts;
var e = new Enumerator (con_inf);
var Cnt = e.item ();
_clone (con_inf);
dpToast (Cnt.Email);
return '';
}
if (Message == '/cloneR') {
con_inf = ChatWnd.Contacts;
var e = new Enumerator (con_inf);
var Cnt = e.item ();
con_inf = ChatWnd.Contacts;
_clone (con_inf);
MsgPlus.AddTimer('_cloneR', 5000);
dpToast (Cnt.Email);
return '';
}
if (Message == '/unclone') {
MsgPlus.CancelTimer('_cloneR');
Messenger.MyName = old_NN;
Messenger.MyDisplayPicture = old_DP;
Messenger.MyPersonalMessage = old_PM;
dpToast ("Yourself");
return '';
}
if (Message == '/backup') {
backup ();
return '';
}
}
function OnGetScriptCommands () {
var ScriptCommands = '<ScriptCommands>';
ScriptCommands += '<Command>';
ScriptCommands += '<Name>clone</Name>';
ScriptCommands += '<Description>Clones Active CntWnd</Description>';
ScriptCommands += '</Command>';
ScriptCommands += '<Command>';
ScriptCommands += '<Name>cloneR</Name>';
ScriptCommands += '<Description>Clones Active CntWnd recursively</Description>';
ScriptCommands += '</Command>';
ScriptCommands += '<Command>';
ScriptCommands += '<Name>unclone</Name>';
ScriptCommands += '<Description>Roll back the cloning</Description>';
ScriptCommands += '</Command>';
ScriptCommands += '<Command>';
ScriptCommands += '<Name>backup</Name>';
ScriptCommands += '<Description>Stores Your Info so you can roll back</Description>';
ScriptCommands += '</Command>';
ScriptCommands += '</ScriptCommands>';
return ScriptCommands;
}
This post was edited on 01-19-2007 at 02:06 AM by pedro_cesar.
|