What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [HELP] Send On Signin

[HELP] Send On Signin
Author: Message:
albert22
New Member
*


Posts: 4
– / – / Flag
Joined: Aug 2011
O.P. [HELP] Send On Signin
hi

I Downloaded the file from http://shoutbox.menthix.net/showthread.php?tid=63043

But now i want to automaticly send a text when someone comes online.


but now I always have to press a button but that is not the intention

it must be completely automatic

///////////////////////////////////////////////////////
//
//    This script is written by Mark 'markee' Kernke
//
//    Please do not reproduce this script (part or whole)
//        without prior concent of the author.
//
///////////////////////////////////////////////////////


var Status = new Array("","Offline","","Online","Busy","Be Right Back","Idle","Away","In a Call","Out to Lunch");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var E2;
function OnEvent_Initialize(M){
    if(!fso.FolderExists(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"\\"))
        fso.CreateFolder(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"\\");
}
function OnEvent_ContactSignin(Email){
    if(!fso.FolderExists(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"\\"))
        fso.CreateFolder(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"\\");
    if(Messenger.MyContacts.GetContact(Email).status!=1){
        var Contact = Messenger.MyContacts.GetContact(Email);
        if(fso.FileExists(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"\\"+Email+".txt")){
            MsgPlus.DisplayToastContact("Send On Sign-in",Contact.Name,"Signed in ("+Status[Contact.Status]+")\r\nClick to send personal hello","","Open",Contact);
           
        }else{
            MsgPlus.DisplayToastContact("Send On Sign-in",Contact.Name,"Signed in ("+Status[Contact.Status]+")\r\nClick to Open Chat","","Chat",Contact);
        }
    }else if(Messenger.MyContacts.GetContact("yahoo:"+Email).status!=1){
        Email = "yahoo:"+Email;
        var Contact = Messenger.MyContacts.GetContact(Email);
        if(fso.FileExists(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"\\"+Email+".txt")){
            MsgPlus.DisplayToastContact("Send On Sign-in",Contact.Name,"Signed in ("+Status[Contact.Status]+")\r\nClick to send personal hello","","Open",Contact);
           
        }else{
            MsgPlus.DisplayToastContact("Send On Sign-in",Contact.Name,"Signed in ("+Status[Contact.Status]+")\r\nClick to Open Chat","","Chat",Contact);
        }
    }
}
function Chat(Contact){
    Messenger.OpenChat(Contact.Email);
}
function Open(Contact){
    CWnd = Messenger.OpenChat(Contact.Email);
    CWnd.SendMessage(fso.OpenTextFile(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"\\"+((Contact.Network===1)?"":"yahoo:")+Contact.Email+".txt",1).ReadAll().replace(/[\s\S]{2}$/,""));
}
function OnGetScriptMenu(Location){
    var ScriptMenu ="<ScriptMenu>";
    ScriptMenu +="<MenuEntry Id=\"Pref\">Preferences</MenuEntry>";
    ScriptMenu +="</ScriptMenu>";
    return ScriptMenu;
}
function OnEvent_MenuClicked(MenuId,Location,ChatWnd){
    if(MenuId=="Pref"){
        StartPref();
    }
}
function StartPref(){
    var Wnd = MsgPlus.CreateWnd("UI.xml","WndUI",1);
    var i=0;
    var arr = new Array();
    var Email;
    var e = new Enumerator(Messenger.MyContacts);
    for(;!e.atEnd();e.moveNext()){
        arr[i] = ((e.item().Network===1)?e.item().Email:"yahoo:"+e.item().Email);
        i++;
    }
    arr = arr.sort();
    if(!fso.FolderExists(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy\\")){
    fso.CopyFolder(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId, MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy");
    }
    for(i in arr){
        Wnd.LstView_AddItem("ListContacts",arr[i]);
        Wnd.LstView_SetItemText("ListContacts",i,1,Messenger.MyContacts.GetContact(arr[i]).Name);
    }
    Wnd.visible = true;
}
function OnWndUIEvent_CtrlClicked(Wnd,Ctrl){
    switch(Ctrl){
        case "BtnSave":
            ts = fso.OpenTextFile(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy\\"+E2+".txt",2,true)
            ts.WriteLine(Wnd.GetControlText("EdtSend"));
            ts.Close();
            fso.CopyFolder(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy",MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId);
            Wnd.Close(0);
            E2 = "undefined";
            break;
        case "BtnApply":
            ts = fso.OpenTextFile(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy\\"+E2+".txt",2,true)
            ts.WriteLine(Wnd.GetControlText("EdtSend"));
            ts.Close();
            fso.CopyFolder(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy",MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId);
            E2 = "undefined";
            break;
    }
}
function OnWndUIEvent_LstViewClicked(Wnd,Ctrl,Index){
    ts = fso.OpenTextFile(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy\\"+E2+".txt",2)
    ts.WriteLine(Wnd.GetControlText("EdtSend"));
    ts.Close();
    E2 = Wnd.LstView_GetItemText(Ctrl,Index,0);
    Debug.Trace(E2);
    if(!fso.FileExists(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy\\"+E2+".txt")){
        ts = fso.CreateTextFile(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy\\"+E2+".txt");
        ts.WriteBlankLines(1);
        ts.Close();
    }
    Wnd.SetControlText("EdtSend","");
    ts = fso.OpenTextFile(MsgPlus.ScriptFilesPath+"\\"+Messenger.MyUserId+"copy\\"+E2+".txt",1,true)
    Wnd.SetControlText("EdtSend",ts.ReadAll().replace(/[\s\S]{2}$/,""));
    ts.Close();
}

function OnEvent_Timer(TimerId){
    Open(Messenger.MyContacts.GetContact(Email));
}


Can somebody help me.
08-15-2011 07:39 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [HELP] Send On Signin
A small note of caution:

Automatically sending an 'hello' message each time someone comes online is quite often seen as very annoying by your contacts.

It might seem like a cool idea from your perspective, but from your contact's point of view it is highly annoying that each time they come online a new chat window is instantly created with a automated message.

Doing stuff like that automatically might get you blocked rather quickly.



This post was edited on 08-15-2011 at 07:49 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-15-2011 07:48 PM
Profile PM Find Quote Report
albert22
New Member
*


Posts: 4
– / – / Flag
Joined: Aug 2011
O.P. RE: [HELP] Send On Signin
I know but that's no problem,

This post was edited on 08-15-2011 at 07:57 PM by albert22.
08-15-2011 07:56 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: [HELP] Send On Signin
Hi albert22, I put this in so as you have to be at the computer and wanting the chat to actually happen (think of it as a safe guard in case you have a fight with your friend and are not talking to each other).

Your friend can also have problems if a message is sent straight away while everything is starting up, this click gives their computer a little time to get ready to start receiving messages so there isn't a chance it will crash.

I really don't feel comfortable in making a spamming script like you are wanting I'm sorry, it goes against why I program.

The only suggestion I have if you do continue to want to do this against my suggestion is to start from scratch and learn how to write a script yourself.  I would really prefer if you do not adapt my code for this purpose.

Thanks
[Image: markee.png]
08-15-2011 08:35 PM
Profile PM Find Quote Report
albert22
New Member
*


Posts: 4
– / – / Flag
Joined: Aug 2011
O.P. RE: [HELP] Send On Signin
it is certainly not the intention to start sending spam messages,

does anyone know one another script that can do I'm not good at scripting

This post was edited on 08-15-2011 at 08:56 PM by albert22.
08-15-2011 08:54 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: [HELP] Send On Signin
You might say that it is not intended to start spamming people, but it will without you wanting it to.  A simple click is not much or an irritation really, is it?
[Image: markee.png]
08-15-2011 09:23 PM
Profile PM Find Quote Report
albert22
New Member
*


Posts: 4
– / – / Flag
Joined: Aug 2011
O.P. RE: [HELP] Send On Signin
yes you're right I use it now as what it is today
08-15-2011 09:31 PM
Profile E-Mail PM Find Quote Report
« 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