What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Solved] XMLHTTP post

[Solved] XMLHTTP post
Author: Message:
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: XMLHTTP post
basic, but try this:

code:
<?php
if($_POST['status']){
file_put_contents("currentstatus.txt",$_POST['status']); // PHP 5 required for this. otherwise use "fclose(fwrite(fopen("currentstatus.txt","w"),$_POST['status']));"
// done..
}
?>

code:
var isOnline = false;
function getInfo(){
Interop.Call('wininet.dll', 'DeleteUrlCacheEntryW', "http://www.wtfbbq.com/currentstatus.txt");
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET","http://www.wtfbbq.com/currentstatus.txt",true);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4){
if(xmlhttp.responseText == "2" && isOnline == false){
MsgPlus.DisplayToast("","thisperson is appearing offline. you can talk to him/her");
isOnline = true;
} else {
isOnline = false;
}
}
}
xmlhttp.send();
}

code:
function postInfo(status){
/*
Usage: postInfo(
[int] status
);

Status Values
2 - Appear Offline
3 - Online
4 - Busy
5 - Be Right Back
6 - Idle
7 - Away
8 - In a Call
9 - Out to Lunch
0 - Unknown
*/
Interop.Call('wininet.dll', 'DeleteUrlCacheEntryW', "http://www.wtfbbq.com/status.php");
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST","http://www.wtfbbq.com/status.php",true);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4){
Debug.Trace("Sent");
}
}
xmlhttp.setRequestHeader("status",status);
xmlhttp.send();
}

function OnEvent_Signout(){
postInfo(0);
}

function OnEvent_MyStatusChange(newstatus){
postInfo(newstatus);
}

just create a timer for the getInfo() :P

This post was edited on 08-29-2007 at 12:26 AM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
08-29-2007 12:20 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Solved] XMLHTTP post - by Deco on 08-28-2007 at 09:12 PM
RE: XMLHTTP post - by roflmao456 on 08-29-2007 at 12:20 AM
RE: RE: XMLHTTP post - by davidpolitis on 08-29-2007 at 10:15 AM
RE: XMLHTTP post - by Deco on 08-29-2007 at 01:16 AM
RE: XMLHTTP post - by -dt- on 08-29-2007 at 01:54 AM
RE: XMLHTTP post - by Deco on 08-29-2007 at 03:08 PM
RE: XMLHTTP post - by matty on 08-29-2007 at 03:39 PM
RE: XMLHTTP post - by Deco on 08-29-2007 at 04:16 PM
RE: XMLHTTP post - by Matti on 08-29-2007 at 04:38 PM
RE: XMLHTTP post - by Deco on 08-29-2007 at 04:43 PM
RE: [Solved] XMLHTTP post - by roflmao456 on 08-29-2007 at 05:33 PM


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