quote:
Originally posted by CarlosHero
matty how would i install this on myself and instead of me doing /webcam they do !webcam so i send my webcam when receiving the message
You'll find almost the exact code you need in toddy's post
here:
Javascript code:
function
OnEvent_ChatWndReceiveMessage(oChatWnd, sOrigin, sMessage) {
// Only react if the command has been send by a contact and if it is a one-to-one chat
if (sOrigin !== Messenger.MyName && oChatWnd.Contacts.Count === 1) {
if (sMessage === '!webcam') {
// Start your webcam and send an invite to the contact to view your webcam
Interop.Call( 'user32', 'SendMessageW', oChatWnd.Handle, 0x0111 /* WM_COMMAND */, 40279, 0 );
return ''
}
}
}
Note that anybody could send the command. So this is not so 'secure'. To make it a bit more secure you could either use the sOrigin and try to find the email address associated with the contact name (but that is not so reliable), or you can simply add a 'secret' password as a parameter to the "!webcam" command:
Javascript code:
if (sMessage === '!webcam mypassword') {