What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Script Edit Help

Script Edit Help
Author: Message:
matt-rockz
Junior Member
**


Posts: 18
32 / Male / –
Joined: Feb 2007
O.P. RE: Script Edit Help
*/   
var hi = 'Hey!'
var on = '1'

function OnEvent_Initialize(MessengerStart)
{
if (on == '0'){
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is curently turned: Off\r\n\r\Turn it on by going to the msgplus icon ;)');}
else
{
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is curently turned: On');
}
}
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
if (on == '1'){
if (Origin != Messenger.MyName){

if (Message.match(/(^|\s+)(\*)?hello(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?helo(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?ello(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?elo(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?hey(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?hiya(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?hi(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?sup(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?hii(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?supp(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)Yo(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(hi);
}
if (Message.match(/(^|\s+)(\*)?hiya(d|s)?(\*)?($|\s+)/i)!=null)
{
}
}
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
  if(Message.substr(0, 15) == '/heyon'){
    heyon();
    return '';
  }
   if(Message.substr(0, 15) == '/heyoff'){
    heyoff();
    return '';
  }
     if(Message.substr(0, 15) == '/heyonoff'){
    onoff();
    return '';
  }
}
function OnGetScriptMenu(Location)
{
    var ScriptMenu = '<ScriptMenu>';
    ScriptMenu    +=  '<MenuEntry Id=\'onoff\'>On or Off?</MenuEntry>';
       ScriptMenu    +=  '<MenuEntry Id=\'StartStop\'>';
              if(on == '0') {
          ScriptMenu += 'Turn On Auto Hey';
          ScriptMenu    +=  '</MenuEntry>';
            }else {
          ScriptMenu += 'Turn Off Auto Hey';
           ScriptMenu    +=  '</MenuEntry>';
    }
    ScriptMenu    +=     '<MenuEntry Id=\'about\'>About</MenuEntry>';
    ScriptMenu    += '</ScriptMenu>';
   
    return ScriptMenu;
}

function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd) {
   switch(MenuItemId) {
      case 'StartStop':
         heyturn();
         break;
      case 'onoff':
        onoff();
         break;
      case 'about':
         msgbox();
         break;
   }
}
function msgbox() {
   var wnd = MsgPlus.CreateWnd('msgbox.xml', 'autoheymsgbox');
   wnd.SetControlText(msg);
}

function OnautoheymsgboxEvent_CtrlClicked(PlusWnd,ControlId) {
   switch(ControlId) {
      case "Ok":
         PlusWnd.Close(0);
         break;
   }
}
function onoff()
{
if (on == '0'){
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is: Off');}
else
{
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is: On');
}
}
function heyon()
{
if (on == '0') {
on = '1'
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is now: On');
}
}
function heyoff()
{
if (on == '1') {
on = '0'
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is now: Off');
}
}

function heyturn()
{
if (on == '0'){
on = '1'
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is now: On');
}
else
{
on = '0'
MsgPlus.DisplayToast('Auto Hey', 'Auto Hey is now: Off');
}
}
02-03-2007 07:07 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Script Edit Help - by matt-rockz on 02-03-2007 at 06:17 PM
RE: Script Edit Help - by absorbation on 02-03-2007 at 06:41 PM
RE: Script Edit Help - by matt-rockz on 02-03-2007 at 07:00 PM
RE: Script Edit Help - by absorbation on 02-03-2007 at 07:02 PM
RE: Script Edit Help - by matt-rockz on 02-03-2007 at 07:07 PM
RE: Script Edit Help - by CookieRevised on 02-04-2007 at 12:15 AM
RE: Script Edit Help - by shawnnn on 06-14-2007 at 07:44 AM
RE: Script Edit Help - by Volv on 06-15-2007 at 11:08 AM
RE: Script Edit Help - by shawnnn on 06-15-2007 at 01:56 PM
RE: Script Edit Help - by matty on 06-15-2007 at 02:22 PM
RE: Script Edit Help - by MicroWay on 06-15-2007 at 07:22 PM
RE: Script Edit Help - by matty on 06-16-2007 at 02:39 AM


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