What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [REQUEST] "Bye [username]"

[REQUEST] "Bye [username]"
Author: Message:
Jonte135
Junior Member
**


Posts: 57
– / – / Flag
Joined: Aug 2007
O.P. RE: [REQUEST] "Bye [username]"
Ok, here is the code:

code:
/// Script created by Davinxi.
/// www.davinxi.net
/// davinxi@gmail.com
/// Answers to the words "Bye" "Goodbye" ... and deriveds
/// with: "Bye, have a nice day."

var ok = 'Bye, have a nice day.'
var on = '1'

function OnEvent_Initialize(MessengerStart)
{
if (on == '0'){
MsgPlus.DisplayToast('AutoBye - ', 'AutoBye is: Off\r\n\r\Visit www.davinxi.net for more details');
}
else
{
MsgPlus.DisplayToast('AutoBye - ', 'AutoBye is: On\r\n\r\Visit www.davinxi.net for more details');
}
}
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin, Message, MessageKind)
{
if (on == '1'){
if (Origin != Messenger.MyName){

if (Message.match(/(^|\s+)(\*)?bye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?byebye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see ya(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u later(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you later(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u tomorrow(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you soon(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see u soon(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?goodbye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?godbye(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
if (Message.match(/(^|\s+)(\*)?see you tomorrow(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage(ok);
}
}
}
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
  if(Message.substr(0, 15) == '/okon'){
    okon();
    return '';
  }
   if(Message.substr(0, 15) == '/okoff'){
    okoff();
    return '';
  }
     if(Message.substr(0, 15) == '/okonoff'){
    onoff();
    return '';
  }
}
function OnGetScriptMenu(Location)
{
    var ScriptMenu = '<ScriptMenu>';
    ScriptMenu    +=  '<MenuEntry Id=\'onoff\'>AutoBye On or Off ?</MenuEntry>';
       ScriptMenu    +=  '<MenuEntry Id=\'StartStop\'>';
              if(on == '0') {
          ScriptMenu += 'Turn On or Turn Off AutoBye';
          ScriptMenu    +=  '</MenuEntry>';
            }else {
          ScriptMenu += 'Turn On or Turn Off AutoBye';
           ScriptMenu    +=  '</MenuEntry>';
    }
    ScriptMenu    += '</ScriptMenu>';
   
    return ScriptMenu;
}

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

function OnautookmsgboxEvent_CtrlClicked(PlusWnd,ControlId) {
   switch(ControlId) {
      case "Ok":
         PlusWnd.Close(0);
         break;
   }
}
function onoff()
{
if (on == '0'){
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: Off\r\n\r\Visit www.davinxi.net for more details');}
else
{
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: On\r\n\r\Visit www.davinxi.net for more details');
}
}
function okon()
{
if (on == '0') {
on = '1'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: On\r\n\r\Visit www.davinxi.net for more details');
}
}
function okoff()
{
if (on == '1') {
on = '0'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: Off\r\n\r\Visit www.davinxi.net for more details');
}
}

function okturn()
{
if (on == '0'){
on = '1'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: On\r\n\r\Visit www.davinxi.net for more details');
}
else
{
on = '0'
MsgPlus.DisplayToast('AutoBye -', 'AutoBye is now: Off\r\n\r\Visit www.davinxi.net for more details');
}
}




08-26-2007 09:47 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[REQUEST] "Bye [username]" - by Jonte135 on 08-25-2007 at 11:58 PM
RE: [REQUEST] "Bye [username]" - by toddy on 08-26-2007 at 12:26 AM
RE: [REQUEST] "Bye [username]" - by davidpolitis on 08-26-2007 at 12:28 AM
RE: [REQUEST] "Bye [username]" - by Pyro on 08-26-2007 at 01:09 AM
RE: [REQUEST] "Bye [username]" - by toddy on 08-26-2007 at 01:16 AM
RE: [REQUEST] "Bye [username]" - by Jonte135 on 08-26-2007 at 09:47 AM
RE: [REQUEST] "Bye [username]" - by segosa on 08-26-2007 at 10:01 AM
RE: [REQUEST] "Bye [username]" - by Jonte135 on 08-31-2007 at 11:30 PM


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