quote:
Originally posted by 5n4k3
I wrote this rather pointless script (just practicing) and it works, but there's something I wanted to ask if you could change.
Here's the Script:
function OnEvent_ChatWndCreated(ChatWnd)
{
var Message = "Your current status is " + Messenger.MyStatus + "!";
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("", Message)
}
I was wondering if you could make it say in the message your actual status (i.e. "busy" | "online" | "away" | etc) instead of using the numbers associated with each status.
Use a loop and a couple of arrays to replace the number?
javascript code:
function OnEvent_ChatWndCreated(ChatWnd)
{
var Message = "Your current status is " + Messenger.MyStatus + "!";
var number = new Array("2","3","4","5"....);
var status = new Array("Appear Offline","Online","Busy","Be Right Back"....);
for(var i = 0; i<number.length; i++){
Message = Message.replace(number[i],status[i]);
}
Message = MsgPlus.RemoveFormatCodes(Message);
MsgPlus.DisplayToast("", Message)
}
EDIT: Sorry, had a few errors, should work fine now... As for the second question, I'll answer shortly...