matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Need some help with script
js code: // declare an object container
var objChatWnd = {};
// store the last message sent into our container
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage) {
objChatWnd[oChatWnd.Handle] = sMessage;
}
function OnEvent_ChatWndReceiveMessage(oChatWnd, sOrigin, sMessage, nMessageKind) {
// check if the message received is our message
if (objChatWnd[oChatWnd.Handle] === sMessage) {
// if it is delete the object from the container
delete objChatWnd[oChatWnd.Handle];
// return the message to the window
return sMessage;
}
// declare a variable
var blnIgnoreContact = false;
// loop through all contacts in the chat
for (var oContact = new Enumerator(oChatWnd.Contacts); !oContact.atEnd(); oContact.moveNext()) {
// check the users email
if (oContact.item().Email === 'gregorsturm12@hotmail.com') {
// if it matches then set our variable to true
blnIgnoreContact = true;
}
}
// after looping through all contacts check our variable
if (blnIgnoreContact === true) {
// send a message if the contact was found
oChatWnd.SendMessage('You are ignored');
}
}
This post was edited on 02-11-2010 at 08:45 PM by matty.
|
|