I'm pretty much a beginner in scripting. I'd like to make to make a script that changes one or more characters to an other one in the chat window while typing. Should I use
OnEvent_ChatWndEditKeyDown to monitor every key I press? Can I use
ChatWnd.EditText to delete just what I wrote, and put something else in it's place? This is what I've got so far:
code:
function OnEvent_ChatWndEditKeyDown(pChatWnd, nKeyCode, bCtrl, bShift)
{
// Declare a variable to hold the value of the 2 virtual key
var VK_2 = 0x32;
// Check if the key pressed are Shift and 2
if (nKeyCode == VK_2 && bShift == true)
{
// Validate that we can type
if (pChatWnd.EditChangeAllowed == true)
{
// Gain access to the contact object
var oContact = new Enumerator(pChatWnd.Contacts).item();
// Validate that the contact is not blocked and that they are on the MSN network
if (oContact.Blocked == false && oContact.Network == NETWORK_MSN)
{
ChatWnd.EditText = ""; // Now how should I use it?
}
}
}
}
Thanks for any help!