Hey Tryxter..
Here's the code for a dll I made. It looks silly because I'm sending a message to myself.. but I use it to trick another program.
code:
using System;
using System.Collections;
using System.Text;
using System.Runtime.InteropServices;
using System.Net;
using System.Net.Sockets;
namespace CS
{
[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _Functions
{
[DispId(1)]
string SendPacket(string msg, int port);
}
[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("MPL.Functions")]
public class Functions : _Functions
{
public string SendPacket(string msg, int port)
{
byte[] sendBytes = Encoding.ASCII.GetBytes(msg);
UdpClient myClient = new UdpClient();
myClient.Send(sendBytes, sendBytes.Length, Dns.GetHostName(), port);
return "ok";
}
}
}
And then this is how to use it in the script.
code:
function OnEvent_Initialize(MessengerStart)
{
var obj = new ActiveXObject("MPL.Functions");
var msg = obj.SendPacket("teste",11000);
}
Oh and the dll isn''t originally mine.. someone sent it sorry I don't rememer who :/
HAve fun!