Shoutbox

Copy what they say? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Copy what they say? (/showthread.php?tid=61962)

Copy what they say? by SantaMayCry on 06-28-2006 at 11:10 PM

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
RE: Copy what they say? by upsfeup on 06-28-2006 at 11:13 PM

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.


RE: Copy what they say? by SantaMayCry on 06-28-2006 at 11:18 PM

Hmm..so how would I do that? lol


RE: Copy what they say? by upsfeup on 06-28-2006 at 11:24 PM

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!



RE: Copy what they say? by SantaMayCry on 06-28-2006 at 11:32 PM

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?


RE: Copy what they say? by upsfeup on 06-29-2006 at 12:59 AM

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.. :(
RE: Copy what they say? by Mr. Bougo on 06-29-2006 at 06:47 AM

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...