I felt bad that noone made it for you yet, so I made a quick thingy
code:
var xmlhttp;
var linkarr = new Array();
//Here we fill the array with the addresses we will be "pinging", just add more .push statements to add more servers.
linkarr.push("http://www.testserver.com/ping.php");
linkarr.push("http://www.testserver2.com/ping2.php");
function OnEvent_Initialize(MessengerStart)
{
//Create the XMLHTTP object we will be re-using the entire time the script runs.
xmlhttp = new ActiveXObject("Microsoft.XmlHttp");
}
function OnEvent_Uninitialize(MessengerExit)
{
//Delete the XMLHTTP Object, not really necassary as the Garabage Collector will clean it up too.
delete xmlhttp;
}
function OnEvent_Signin(Email)
{
//Status Change is not called when we sign in so here's a seperate function to ping when we sign in.
//The three means "Online", see Scripting Docs for full explanation of statusCodes.
ping(3);
}
function OnEvent_MyStatusChange(NewStatus)
{
//Ping the server and send the new status too.
ping(NewStatus);
}
function ping(NewStatus)
{
//Here we will be sending the actual pings.
var link;
//Create a so called foreach loop to loop trough all the servers in the array.
for (link in linkarr)
{
//Debug.Trace(" linkarr::linkarr[" + link + "] = " +linkarr[link]);
//Debug.Trace(" param::" + "?email=" + Messenger.myEmail + "&NewStatus=" + NewStatus);
//Open a connection to the server.
xmlhttp.open("GET", linkarr[link] + "?email=" + Messenger.myEmail + "&NewStatus=" + NewStatus, true);
//Send nothing, this just creates the actual connection to the server and the params are send as GET params.
xmlhttp.send();
}
}
WDZ, code coloring please :'(