quote:
Originally posted by TheGuruSupremacy
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind )
{var time = new Date()
var hours = time.getHours()
var minutes = time.getMinutes()
var seconds = time.getSeconds()
var Myformattednick = "[" + hours + "." + minutes + "." + seconds + "]" + " " + Messenger.MyName
Debug.Trace(Myformattednick)
Debug.Trace(Origin)
if (Myformattednick!=Origin){
//do anything
}else{//do else
}
}
You can't use that, just use a regular expression to omit the time stamp when the registry setting for StuffPlug has the feature enabled. It is also probable wise to add this to CookieRevised's code that was linked to earlier.
EDIT: The reason for the regular expression to omit the time stamp (probably a replace method is best) is because the seconds/minutes/hours could change between when stuffplug adds the time stamp and the script removes it (eg. stuff plug adds the time at 23:59:59 (and 999 milliseconds) at the 31st of december then when your script gets to it, it will already be a new year and ever value has changed and will not be the same). I hope this gives you explanation rather than just saying it is wrong.
I do stress to add this to CookieRevised's code and to also check to see if the registry setting has the feature enabled before going through your method.