What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Get the contacts color

Pages: (3): « First « 1 [ 2 ] 3 » Last »
Get the contacts color
Author: Message:
Plan-1130
Full Member
***

I keep askin' myself: why?

Posts: 142
73 / Male / –
Joined: Feb 2005
RE: Get the contacts color
code:
function Xniff::OnData(srcip, srcport, destip, destport, data, datalen)
It's an event, so it's being executed by the object Xniff.
For that you need to include the Xniff DLL in your project, see: [Release] Xniff (ActiveX Packet Sniffer) - Examples inside
My Scripts: UltimatFlooder, Advanced PSM Chat, PlusPrivacy, PlusRemote

[Image: Plan-1130.png]
11-13-2006 08:46 AM
Profile E-Mail PM Find Quote Report
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. RE: Get the contacts color
Hi.
I'm sorry, but I'm lost!

This is my code:
code:
var xniff = new ActiveXObject("w00t.Xniff");

function xniff::OnData(srcip, srcport, destip, destport, data, datalen)
{
    if (srcport === "1863" && datalen > 0)
    {
        var data = data.split(" ");
       
        if (data[0] == "MSG" && data[8] == "Content-Type:" && data[9] == "text/plain;" && data[10] == "charset=UTF-8")
        {
            var style = data[14];
            var font_name = data[13];
            var color = data[15];
           
            Debug.Trace("Font Style: " + style);
            Debug.Trace("Font Name: " + font_name);
            Debug.Trace("Font Color: " + color);
        }
    }
}

function OnEvent_Initialize(MessengerStart)
{
    xniff.Start();
}

function OnEvent_Uninitialize(MessengerExit)
{
    xniff.Stop();
}

Is it something like that?

When I start the script the debugger says:
"xniff isn't defined
Line: 3. Code: -2146823279."
11-13-2006 02:01 PM
Profile E-Mail PM Web Find Quote Report
Plan-1130
Full Member
***

I keep askin' myself: why?

Posts: 142
73 / Male / –
Joined: Feb 2005
RE: Get the contacts color
Well, you forgot a few things:
code:
var xniff = new ActiveXObject("w00t.Xniff");
xniff.IP = getLocalIp();

function xniff::OnData(srcip, srcport, destip, destport, data, datalen)
{
    if (srcport === "1863" && datalen > 0)
    {
        var data = data.split(" ");

        if (data[0] == "MSG" && data[8] == "Content-Type:" && data[9] == "text/plain;" && data[10] == "charset=UTF-8")
        {
            var style = data[14];
            var font_name = data[13];
            var color = data[15];

            Debug.Trace("Font Style: " + style);
            Debug.Trace("Font Name: " + font_name);
            Debug.Trace("Font Color: " + color);
        }
    }
}

function OnEvent_Initialize(MessengerStart)
{
    xniff.Start();
}

function OnEvent_Uninitialize(MessengerExit)
{
    xniff.Stop();
}

function getLocalIp()
{
    var wmiObj = new ActiveXObject('WbemScripting.SWbemLocator');
    var wmiInst = wmiObj.ConnectServer('.', "root\\cimv2");
    wmiInst.Security_.ImpersonationLevel = 3;

    var col = wmiInst.ExecQuery('Select * from Win32_NetworkAdapterConfiguration');
    var colEnum = new Enumerator(col);

    var ipAddr;

    for (; !colEnum.atEnd(); colEnum.moveNext())
    {
        var objIp = colEnum.item();
        var addr = objIp.IPAddress(0);
        if(typeof addr == 'string' && addr.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/))
        {
            ipAddr = addr;
        }
    }
    return ipAddr;
}



This post was edited on 11-13-2006 at 02:16 PM by Plan-1130.
My Scripts: UltimatFlooder, Advanced PSM Chat, PlusPrivacy, PlusRemote

[Image: Plan-1130.png]
11-13-2006 02:10 PM
Profile E-Mail PM Find Quote Report
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. RE: Get the contacts color
Hi.
I'm sorry, but I can't find out how to use Xniff.

It still says that xniff isn't defined.

This is my code:
code:
var xniff = new ActiveXObject("w00t.Xniff");
xniff.IP = getLocalIp();

function xniff::OnData(srcip, srcport, destip, destport, data, datalen)
{
    if (srcport === "1863" && datalen > 0)
    {
        var data = data.split(" ");
       
        if (data[0] == "MSG" && data[8] == "Content-Type:" && data[9] == "text/plain;" && data[10] == "charset=UTF-8")
        {
            var style = data[14];
            var font_name = data[13];
            var color = data[15];
           
            Debug.Trace("Font Style: " + style);
            Debug.Trace("Font Name: " + font_name);
            Debug.Trace("Font Color: " + color);
        }
    }
}

function OnEvent_Initialize(MessengerStart)
{
    xniff.Start();
}

function OnEvent_Uninitialize(MessengerExit)
{
    xniff.Stop();
}

function getLocalIp()
{
    var wmiObj = new ActiveXObject('WbemScripting.SWbemLocator');
    var wmiInst = wmiObj.ConnectServer('.', "root\\cimv2");
    wmiInst.Security_.ImpersonationLevel = 3;

    var col = wmiInst.ExecQuery('Select * from Win32_NetworkAdapterConfiguration');
    var colEnum = new Enumerator(col);

    var ipAddr;

    for (; !colEnum.atEnd(); colEnum.moveNext())
    {
        var objIp = colEnum.item();
        var addr = objIp.IPAddress(0);
        if(typeof addr == 'string' && addr.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/))
        {
            ipAddr = addr;
        }
    }
   
    return ipAddr;
}
11-13-2006 03:32 PM
Profile E-Mail PM Web Find Quote Report
MrT
Junior Member
**

Coding For Fun

Posts: 62
35 / Male / Flag
Joined: Jul 2006
RE: Get the contacts color
SnuZZer,

try this script.
you can understand with this.

Debug Window:
[Image: debugdj3.jpg]

.plsc File Attachment: example.plsc (272.09 KB)
This file has been downloaded 164 time(s).

This post was edited on 11-13-2006 at 08:32 PM by MrT.
11-13-2006 08:26 PM
Profile E-Mail PM Web Find Quote Report
MicroWay
Senior Member
****

Avatar
Do you want me? Try to get me!

Posts: 571
Reputation: 16
37 / Male / Flag
Joined: Jul 2006
Status: Away
RE: Get the contacts color
quote:
Originally posted by EnglandBoyForLife.
Oi MrT how do i delete that script?
It wont let me delete it :/

Try to disable the script, Apply the Plus! Opition, close on tray all WLM and restart it again... Then you can delete the script...
;) No need warnings...


quote:
Originally posted by EnglandBoyForLife.
Ok :)
Its Sorted, Previous Post Been Deleted. (Y)
No problem... ;)


This post was edited on 11-13-2006 at 08:57 PM by MicroWay.
11-13-2006 08:52 PM
Profile PM Find Quote Report
EBFL
Full Member
***

Avatar
;o

Posts: 486
Reputation: 67
31 / Male / Flag
Joined: Oct 2006
RE: Get the contacts color
Ok :)
Its Sorted, Previous Post Been Deleted. (Y)
I'm awesome

11-13-2006 08:53 PM
Profile PM Find Quote Report
MrT
Junior Member
**

Coding For Fun

Posts: 62
35 / Male / Flag
Joined: Jul 2006
RE: Get the contacts color
don't panic :P ;)
11-13-2006 08:59 PM
Profile E-Mail PM Web Find Quote Report
SnuZZer
Full Member
***

Avatar

Posts: 114
32 / Male / Flag
Joined: Jun 2006
O.P. RE: Get the contacts color
Hi.
The script gives me an error (I have tried to translate to english):

code:
Function called: OnEvent_Uninitialize
The script has been stopped
The script is beeing started
The script is started and is ready
Function called: OnEvent_Initialize
Fejl: Error 10022 in function WSAIoctl(SIO_RCVALL)
Invalid argument.
       Line: 40. Code: -2147418113.
Function OnEvent_Initialize give an error. Code: -2147352567
11-15-2006 05:53 AM
Profile E-Mail PM Web Find Quote Report
MrT
Junior Member
**

Coding For Fun

Posts: 62
35 / Male / Flag
Joined: Jul 2006
RE: Get the contacts color
Line 40 =>  xniff.Start();

i don't know error codes but you can try to manuel register xniff.ocx *-)

Start -> Run
regsvr32 "C:\Program Files\Messenger Plus! Live\Scripts\example\Xniff.ocx"

11-15-2006 03:27 PM
Profile E-Mail PM Web Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On