What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request]: Send message on conversation start, repeat message on timer.

[Request]: Send message on conversation start, repeat message on timer.
Author: Message:
Eiron
New Member
*


Posts: 2
Joined: Feb 2008
O.P. [Request]: Send message on conversation start, repeat message on timer.
Right. Normally I don't like to ask, but I've tried a search without luck. There are several features I use in Live Plus! but I want:

1) a script (a /command) to be started automatically on opening a conversation window, and/or
2) a message to be on an automatic repeat timer - so every half-hour or whatever I can run the same command without having to type it in.

Anything exist for these two little needs?
02-14-2008 07:37 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
29 / Male / Flag
Joined: Nov 2006
Status: Away
RE: [Request]: Send message on conversation start, repeat message on timer.
try this out:
code:
var cmd = "/some command"; // your own command here (with slash)
var cwnd;
var delay = 60; // delay when to repeat message (in seconds)
function OnEvent_ChatWndCreated(ChatWnd){
ChatWnd.SendMessage(cmd);
cwnd = ChatWnd;
MsgPlus.CancelTimer("sendmsg");
MsgPlus.AddTimer("sendmsg", parseInt(delay) * 1000);
}

function OnEvent_Timer(i){
if(i == "sendmsg"){
cwnd.SendMessage(cmd);
}
}


This post was edited on 02-18-2008 at 08:29 AM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
02-18-2008 08:29 AM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Request]: Send message on conversation start, repeat message on timer.
Probably better like this:

code:
var objChatWnd = {};
var sCommand = '/somecommand';
var iDelayInMinutes = 2;

function OnEvent_ChatWndCreated(oChatWnd){
    objChatWnd[oChatWnd.Handle] = {};
    objChatWnd[oChatWnd.Handle].oChatWnd = oChatWnd;
    oChatWnd.SendMessage = sCommand;
    MsgPlus.AddTimer(oChatWnd.Handle, iDelayInMinutes*60000);
}

function OnEvent_ChatWndDestroyed(oChatWnd) {
    delete objChatWnd[oChatWnd.Handle];
    MsgPlus.CancelTimer(oChatWnd.Handle);
}

function OnEvent_Timer(iHandle) {
    objChatWnd[iHandle].oChatWnd.SendMessage(sCommand);
    MsgPlus.AddTimer(iHandle, iDelayInMinutes*60000);   
}

This post was edited on 02-18-2008 at 03:01 PM by matty.
02-18-2008 02:22 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