What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Copy what they say?

Copy what they say?
Author: Message:
SantaMayCry
New Member
*


Posts: 3
33 / Male / –
Joined: Jun 2006
O.P. Copy what they say?
Here is my script so far(thanks maker of stealdp)

code:
function OnEvent_ChatWndSendMessage(Wnd,Msg) {
    if(Msg == "!copycat") {
        var WndContacts = Wnd.Contacts;
        if(WndContacts.Count == 1) {
            var e = new Enumerator(WndContacts);
            var Cnt = e.item();
            var CntDP = Cnt.DisplayPicture;
            var CntN = Cnt.Name
            var CntPM = Cnt.PersonalMessage
            Messenger.MyDisplayPicture = CntDP;
            Messenger.MyName = CntN;
            Messenger.MyPersonalMessage = CntPM
            AddTimer("effect",86,4000,000) {
        }
        return "";
    }
}
}
function OnEvent_ChatWndReceiveMessage( {
    ChatWnd.SendMessage(



How would I make it so while the timer is active, it takes whatever the contact says and repeats it back? Thanks for the help
06-28-2006 11:10 PM
Profile E-Mail PM Web Find Quote Report
upsfeup
Junior Member
**


Posts: 67
Joined: Feb 2005
RE: Copy what they say?
What does the Timer do is trigger the Timer Event in x milliseconds.

To do what you want, you would have to listen to all the relevent events do the copycated person, and if the copycat is still active, change the message/dp/nickname.

I don't think you need the timer at all.
06-28-2006 11:13 PM
Profile E-Mail PM Find Quote Report
SantaMayCry
New Member
*


Posts: 3
33 / Male / –
Joined: Jun 2006
O.P. RE: Copy what they say?
Hmm..so how would I do that? lol
06-28-2006 11:18 PM
Profile E-Mail PM Web Find Quote Report
upsfeup
Junior Member
**


Posts: 67
Joined: Feb 2005
RE: Copy what they say?
lol! Concept draft.

On !copycat
Save email of target
change the information (name, dp, personalmessage)

Listen to:
OnEvent_ContactNameChange
OnEvent_ContactPsmChange
(Ok... there is no DpChange.. so there might be needed the timer.. I would have to digg how is the DP stored)

On any of this events, if triggered by copycat target
change own personal information

I might start to code something.. but it will take a while!



This post was edited on 06-28-2006 at 11:24 PM by upsfeup.
06-28-2006 11:24 PM
Profile E-Mail PM Find Quote Report
SantaMayCry
New Member
*


Posts: 3
33 / Male / –
Joined: Jun 2006
O.P. RE: Copy what they say?
thanks, when you put it like that It made sense again lol. Anyone notice how close Jscript or whatever this is...is close to Lua?
06-28-2006 11:32 PM
Profile E-Mail PM Web Find Quote Report
upsfeup
Junior Member
**


Posts: 67
Joined: Feb 2005
RE: Copy what they say?
Here is my code!

There is one thing that can't be changed. Everytime you change the DP to display the "copycated" the picture is added to your DP list. Scripts don't have access to that list so we can't change it!

Also.. it checks for DP changes every 10 seconds.

code:
// Copycat v1.0

var copycat_target = '';
var old_name;
var old_psm;
var old_dp;
var CntDP_old = '';

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    if(Message.substr(0, 8) == '!copycat'){
        if(copycat_target.length > 1){
            copycat_target = '';
            Messenger.MyName = old_name;
            Messenger.MyPersonalMessage = old_psm;
            Messenger.MyDisplayPicture = old_dp;
            Debug.Trace("No more copycat");
            MsgPlus.CancelTimer('CopyCatTimer');
            return '';
        }
         
        var contacts = new Enumerator(ChatWnd.Contacts);
        if(ChatWnd.Contacts.Count > 1)
            return '';    //No copycat to multi users. Find way to warn the user
        var e = contacts.item();
        copycat_target = e.Email;
       
        var CntDP = e.DisplayPicture;
        CntDP_old = CntDP;
        old_dp = Messenger.MyDisplayPicture;
        if(CntDP != "")     
            Messenger.MyDisplayPicture = CntDP;
        old_name = Messenger.MyName;
        Messenger.MyName = e.Name;
        var CntPM = e.PersonalMessage;
        old_psm = Messenger.MyPersonalMessage;
        if(CntPM)
            Messenger.MyPersonalMessage = CntPM;

        MsgPlus.AddTimer('CopyCatTimer', 10000);

        Debug.Trace("CopyCat " + copycat_target);
        return '';
    }
}

function OnEvent_ContactNameChange(Email, NewName)
{
    if(copycat_target == Email){
        Debug.Trace("Change Name to " + NewName);
        Messenger.MyName = NewName;
    }
}

function OnEvent_ContactPsmChange(Email, NewPsm)
{
    if(copycat_target == Email){
        Debug.Trace("Change Psm to " + NewPsm);
        Messenger.MyPersonalMessage = NewPsm;
    }
}

function OnEvent_ContactStatusChange(Email, NewStatus)
{
    if(copycat_target == Email){
        Debug.Trace("Change status to " + NewStatus);
        Messenger.MyStatus = NewStatus;
    }
}

function OnEvent_Timer(TimerId)
{
    if(TimerId == 'CopyCatTimer'){
        if(copycat_target != ''){
            var CntDP = Messenger.MyContacts.GetContact(copycat_target).DisplayPicture;
            if((CntDP != CntDP_old) && (CntDP != "") ){
                Messenger.MyDisplayPicture = CntDP;
                CntDP_old = CntDP;
                Debug.Trace("ChangeDP to " + CntDP);
            }
            MsgPlus.AddTimer('CopyCatTimer', 10000);
        }
    }
}


Code tag should maintain tabs.. :(
06-29-2006 12:59 AM
Profile E-Mail PM Find Quote Report
Mr. Bougo
Junior Member
**


Posts: 51
33 / Male / –
Joined: Jun 2006
RE: Copy what they say?
I think he wants to repeat what the contacts says too...


But be careful, because if he's bored of this he can say //run format c:, so don't forget to add a / protection...
06-29-2006 06:47 AM
Profile 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