code:
var chat_window;
var TheOldPm;
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
chat_window = ChatWnd;
Command = Message.split(' ')
switch ( Command[0].toLowerCase() ){
case "/testing" :
var i = 0;
TheOldPm = Messenger.MyPersonalMessage;
MsgPlus.AddTimer("testing", 1000 );
Message = '';
return "";
break;
}
return Message;
}
function OnEvent_Timer(TimerId) {
switch(TimerId){
case 'cuptime':
i++
if(i < 60){
Messenger.MyPersonalMessage = "Timing... " + i + " Minutes have passed";
MsgPlus.AddTimer('cuptime', 60000);
}
else{
Messenger.MyPersonalMessage = TheOldPM;
}
break;
}
}
The problem is is that you are declaring TheOldPm inside a function making it local to the function, however you are trying to use a variable called MyOldPm.