My own msg with SendMessage - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: My own msg with SendMessage (/showthread.php?tid=79646)
My own msg with SendMessage by SuNcO on 12-05-2007 at 05:31 AM
I'm new developing Scripts for Plus!
I want to made my first one, is about encrypt msgs (yes, there are 3 yet) but limited
Well, my problem is this :
I got my own msg on the ChatWndSendMessage event. I modify it and made a return so it appear on my convo. Ok, i made a return and made a SendMesaage to send it to the other person but i see that modified msg. With some modifications i see both msgs
The point is.. can i only see my normall msg and send the encoded one ?
Im thinking and maybe that (see every msg) is a security issue
RE: My own msg with SendMessage by NiteMare on 12-05-2007 at 06:18 AM
can you post your script here so we can see whats wrong?
RE: My own msg with SendMessage by SuNcO on 12-05-2007 at 06:24 AM
code: function OnEvent_ChatWndSendMessage(ChatWnd, sMessage) {
// check if it is an encoded msg
if (Mid(sMessage,0,1) != "¬") {
// check if this contact have a pass setted
for (i = 0; i < hwnds.length; i ++) {
if (hwnds[i] == ChatWnd.Handle) {
ChatWnd.SendMessage("¬" + secureEncrypt(claves[i],sMessage));
//return "";
}
}
} else {
// is an encoded msg.. so not encode again, just send it
return sMessage;
}
}
Off course, need a lot of work, is just a start
RE: RE: My own msg with SendMessage by felipEx on 12-05-2007 at 07:09 AM
quote: Originally posted by SuNcO
code: function OnEvent_ChatWndSendMessage(ChatWnd, sMessage) {
// check if it is an encoded msg
if (Mid(sMessage,0,1) != "¬") {
// check if this contact have a pass setted
for (i = 0; i < hwnds.length; i ++) {
if (hwnds[i] == ChatWnd.Handle) {
ChatWnd.SendMessage("¬" + secureEncrypt(claves[i],sMessage));
//return "";
}
}
} else {
// is an encoded msg.. so not encode again, just send it
return sMessage;
}
}
Off course, need a lot of work, is just a start
i don't know if you really need the loop ;D
i wonder what the Mid function does, try out with sMessage.substr(0, 1)
code: ChatWnd.SendMessage("¬" + secureEncrypt(claves[i],sMessage));
return "";
Please, come to the Spanish Forum
RE: My own msg with SendMessage by SuNcO on 12-05-2007 at 07:21 AM
I use the "loop" because i have various passwords.. i mean, one by user, so, i need to find what password use to encrypt the msg
code: if (hwnds[i] == ChatWnd.Handle) {
If the actual Handle is on the hwnds array.. then encode with their own password
Btw, i think i must use RegisterMessageNotification and OnWindowidEvent_MessageNotification
Im going to read mote about that (yes, i know hook is advanced stuff)
RE: My own msg with SendMessage by Deco on 12-05-2007 at 10:15 AM
[align=center]the problem is that you have a send msg inside the chatwndsendmsg event. When you send the text msg it will be encrypted and sent again encrypted..then you have a return after that so it will send also that msg. Instead of using the chatwnd.sendmsg function just do return secureEncrypt(claves(1),msg)...
Hope this helps. Sorry for confusing post but i'm writing from the iphone.
have fun
RE: RE: My own msg with SendMessage by Deco on 12-05-2007 at 12:38 PM
quote: Originally posted by SuNcO
code: function OnEvent_ChatWndSendMessage(ChatWnd, sMessage) {
// check if it is an encoded msg
if (Mid(sMessage,0,1) != "¬") {
// check if this contact have a pass setted
for (i = 0; i < hwnds.length; i ++) {
if (hwnds[i] == ChatWnd.Handle) {
ChatWnd.SendMessage("¬" + secureEncrypt(claves[i],sMessage));
//return "";
}
}
} else {
// is an encoded msg.. so not encode again, just send it
return sMessage;
}
}
Off course, need a lot of work, is just a start
Hi,
Try this:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage) {
// check if this contact have a pass setted
for (i = 0; i < hwnds.length; i ++) {
if (hwnds[i] == ChatWnd.Handle) {
return secureEncrypt(claves[i],sMessage);
}
}
}
Have fun!
RE: My own msg with SendMessage by SuNcO on 12-05-2007 at 04:21 PM
If i try that, i send the encrypted text and i see the encrypted text
As i say, i don't want to see the encrypted text, just the normal one
Thats why i send the text "twice" (normal and encrypted)
RE: My own msg with SendMessage by Spunky on 12-05-2007 at 08:12 PM
What exactly do you mean? That only sends one message...
RE: RE: My own msg with SendMessage by vikke on 12-05-2007 at 08:26 PM
quote: Originally posted by SpunkyLoveMuff
What exactly do you mean? That only sends one message...
He wants to send the encrypted message to his contact, while it shows the unencrypted message in his own client. You cannot do this (easily) with MP!L.
|