Better, but i renamed the commands, and edited the menu etc, but nothing works.
The commands show up in the command list, but when i enter them, it says the command was not recognised...
Also, when the button in the menu is clicked, the function is not called...
Here is my code...
The code for the menu and command is down the very bottom
xml code:
var originalPSM;
var idleSeconds;
var isIdle;
var isBusy;
var PSMnumber;
var seconds = 60;
function OnEvent_Initialize(MessengerStart)
{
idleSeconds = 0;
isIdle = false;
isBusy = false;
MsgPlus.AddTimer('rotate', seconds * 1000);
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function updateMessage() {
if(PSMnumber==1) {
originalPSM = "Growing old is mandatory, growing up is optional";
PSMnumber=2;
} else {
originalPSM = "There are only two ways to live your life. One is as though nothing is a miracle. The other is as if everything is.";
PSMnumber=1;
}
Messenger.MyPersonalMessage = originalPSM;
}
function OnEvent_MyStatusChange(NewStatus)
{
if( NewStatus == 7 || NewStatus == 6 )
{
Messenger.MyPersonalMessage = "Text/ ring me and I'll be back ASAP! 0hrs:0mins:0secs";
MsgPlus.AddTimer( "incIdle", 1000 );
MsgPlus.AddTimer( "updateDisplay", 6000 );
isIdle = true;
isBusy = false;
} else if(NewStatus == 4) {
Messenger.MyPersonalMessage = "Text me! I'm in a full screen app and mssngr alerts are off! :)";
isBusy = true;
isIdle = false;
idleSeconds = 0;
}
else
{
isIdle = false;
isBusy = false;
idleSeconds = 0;
updateMessage();
MsgPlus.AddTimer('rotate', seconds * 1000);
}
}
function OnEvent_Timer(sTimerId)
{
if( isIdle == false && isBusy == false)
{
updateMessage();
MsgPlus.AddTimer('rotate', seconds * 1000);
return 0;
}
else if( sTimerId == "incIdle" )
{
if(isIdle==true) {
idleSeconds ++;
MsgPlus.AddTimer( "incIdle", 1000 );
}
}
else if( sTimerId == "updateDisplay" )
{
if(isIdle==true) {
var cIdleSeconds = idleSeconds;
var idleHours = 0;
var idleMinutes = 0;
while( cIdleSeconds > 59 )
{
cIdleSeconds -= 60;
idleMinutes ++;
}
while( idleMinutes > 59 )
{
idleMinutes -= 60;
idleHours ++;
}
Messenger.MyPersonalMessage = "Text/ ring me and I'll be back ASAP! "+idleHours+"hrs:"+idleMinutes+"mins:"+cIdleSeconds+"secs";
MsgPlus.AddTimer( "updateDisplay", 6000 );
}
}
}
function OnGetScriptCommands(){
var oCommand = new Commands();
with (oCommand) {
AddCommand('PMrotate', 'Rotate your Personal Message'); }
return oCommand.ExportCommands();
}
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage) {
if (/^\/([^\s\/]+)\s*([\s\S]*)$/.exec(sMessage) !== null) { var _command = RegExp.$1.toLowerCase();
var _param = RegExp.$2;
switch (_command) {
case 'PMrotate':
if ( _param !== '' ) {
updateDisplay();
} else {
updateDisplay();
}
break;
}
}
}
function OnGetScriptMenu(nLocation){
var oMenu = new ScriptMenu();
with (oMenu) {
AddSubMenu('My Menu');
AddItem('/PMrotate', 'Roate your Personal Message');
CloseSubMenu();
AddItem('/PMrotate', 'Roate your Personal Message');
}
return oMenu.ExportMenu();
}
function OnEvent_MenuClicked(sMenuId, nLocation, oChatWnd){
OnEvent_ChatWndSendMessage(oChatWnd, sMenuId);
}
I also have the two files from Matty