What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] Using PHP files

[Request] Using PHP files
Author: Message:
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
38 / Male / Flag
Joined: Jul 2003
RE: [Request] Using PHP files
I made a script to do this for myself a while ago, this should start you off:

code:
//////////////////////////////////////////////////////////////////////////////////////
//////                                                  //////   
//////                        AwaySMS                      //////
//////                                                  //////   
//////////////////////////////////////////////////////////////////////////////////////

var myPhone = "01234567890";
var sUser = "usernmae";
var sPass = "password";
var whitelist = Array();
whitelist[0] = "email@hotmail.co.uk";       
whitelist[1] = "emailone@hotmail.com";           
whitelist[2] = "emailtwo@hotmail.com";           
whitelist[3] = "email3@hotmail.com";       
whitelist[4] = "emailfour@hotmail.com";   
whitelist[5] = "email5@hotmail.com";       
whitelist[6] = "emailsix@hotmail.com";       
whitelist[7] = "emailseven@hotmail.com";   
whitelist[8] = "emaileight@hotmail.co.uk";

function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
  if ((Origin.indexOf('(')==0)&&(Origin.indexOf(':')!=-1)&&(Origin.indexOf(')')!=-1)){
    var sOrigin = Origin.substr(Origin.indexOf(')')+2);
  }else{
    var sOrigin = Origin;
  }
  if((sOrigin != Messenger.MyName) && (MessageKind == MSGKIND_SAYS)){
    if(Messenger.MyStatus == STATUS_AWAY || Messenger.MyStatus == STATUS_IDLE)
    {
      for(var e = new Enumerator(ChatWnd.Contacts);!e.atEnd();e.moveNext()){
          var Contact = e.item();
          if (Contact.Email != Messenger.MyEmail){var sEmail = Contact.Email;}
      }
         for (i = 0; i < whitelist.length; i ++) {
        if(whitelist[i] == sEmail)
        {
          SendMsg(sEmail, Origin, Message);
        }
      }
    }
  }
}

function SendMsg(Email, Name, Message)
{
    var sSender = Email.substr(0,Email.indexOf('@'));
    if ((Name.indexOf('(')==0)&&(Name.indexOf(':')!=-1)&&(Name.indexOf(')')!=-1)){
        var sName = Name.substr(Name.indexOf(')')+2,20);
    }else{
        var sName = Name.substr(0,20);
    }
    var sMsg = sName + ' (' +sSender + '):  ' + Message;
    Debug.Trace(sMsg);
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    var sURL = "http://www.50sms.com/multi.php?login="+sUser+"&password="+sPass+"&phones="+myPhone+"&message="+sMsg+"&originator=AwaySMS";
    xmlhttp.open("GET",sURL, true);
    xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState==4) {
        var sRet = xmlhttp.responseText;
        if (sRet.indexOf('<result>OK</result>')!=-1){
             MsgPlus.DisplayToast("AwaySMS", "SMS Sent");
        }else{
          MsgPlus.DisplayToast("AwaySMS", "Error Sending SMS");
        }
       }
    };
    xmlhttp.send();
}

You may want to change it, as this is what it does currentley:
  • Works with 50sms.com - Can easily be changed
  • Only sends messages when my status is idle
  • Only sends me a message when whitelisted emails contact me
  • Shows the display name and start of email address

SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
05-13-2009 02:26 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Request] Using PHP files - by hackrash on 05-13-2009 at 10:55 AM
RE: [Request] Using PHP files - by rtsfg on 05-13-2009 at 11:39 AM
RE: [Request] Using PHP files - by Spunky on 05-13-2009 at 12:38 PM
RE: [Request] Using PHP files - by hackrash on 05-13-2009 at 01:43 PM
RE: [Request] Using PHP files - by matty on 05-13-2009 at 01:52 PM
RE: [Request] Using PHP files - by Dempsey on 05-13-2009 at 02:26 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