My own msg with SendMessage |
Author: |
Message: |
SuNcO
Full Member
Posts: 128 Reputation: 6
45 / /
Joined: Jan 2005
|
O.P. My own msg with SendMessage
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
Attachment: plus2.jpg (10.1 KB)
This file has been downloaded 191 time(s).
|
|
12-05-2007 05:31 AM |
|
|
NiteMare
Veteran Member
Giga-Byte me
Posts: 2497 Reputation: 37
37 / /
Joined: Aug 2003
|
RE: My own msg with SendMessage
can you post your script here so we can see whats wrong?
|
|
12-05-2007 06:18 AM |
|
|
SuNcO
Full Member
Posts: 128 Reputation: 6
45 / /
Joined: Jan 2005
|
O.P. RE: My own msg with SendMessage
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
|
|
12-05-2007 06:24 AM |
|
|
felipEx
Scripting Contest Winner
Posts: 378 Reputation: 24
35 / /
Joined: Jun 2006
|
RE: RE: My own msg with SendMessage
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
This post was edited on 12-05-2007 at 07:15 AM by felipEx.
|
|
12-05-2007 07:09 AM |
|
|
SuNcO
Full Member
Posts: 128 Reputation: 6
45 / /
Joined: Jan 2005
|
O.P. RE: My own msg with SendMessage
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)
|
|
12-05-2007 07:21 AM |
|
|
Deco
Full Member
Posts: 188 Reputation: 4
42 / /
Joined: Aug 2006
|
RE: My own msg with SendMessage
[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
|
|
12-05-2007 10:15 AM |
|
|
Deco
Full Member
Posts: 188 Reputation: 4
42 / /
Joined: Aug 2006
|
RE: RE: My own msg with SendMessage
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!
|
|
12-05-2007 12:38 PM |
|
|
SuNcO
Full Member
Posts: 128 Reputation: 6
45 / /
Joined: Jan 2005
|
O.P. RE: My own msg with SendMessage
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)
|
|
12-05-2007 04:21 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
Joined: Aug 2006
|
RE: My own msg with SendMessage
What exactly do you mean? That only sends one message...
<Eljay> "Problems encountered: shit blew up"
|
|
12-05-2007 08:12 PM |
|
|
vikke
Senior Member
Posts: 900 Reputation: 28
31 / /
Joined: May 2006
|
RE: RE: My own msg with SendMessage
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.
|
|
12-05-2007 08:26 PM |
|
|
|