What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Script does not start, or hook onto Plus! menu

Pages: (2): « First [ 1 ] 2 » Last »
Script does not start, or hook onto Plus! menu
Author: Message:
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
O.P. Script does not start, or hook onto Plus! menu
Well my problem is simple really, my script does not appear to start until I edit it and refresh it in the Plus! scripting prefences. It is very odd, but I cannot pin point the problem.

code:
function OnGetScriptMenu(Location)
{
    var ScriptMenu ="<ScriptMenu>";
    ScriptMenu +="<MenuEntry Id=\"Options\">Options</MenuEntry>";
    ScriptMenu +="<Separator/>";
    ScriptMenu +="<MenuEntry Id=\"About\">About Message Enchanter</MenuEntry>";
    ScriptMenu +="</ScriptMenu>";
    return ScriptMenu;
}

Now I am not sure, but it could be something else effecting the hooking, maybe the script failed to start for example, is there soemething I have totally missed to help the script load better? Thanks :).
07-09-2006 01:39 PM
Profile PM Find Quote Report
Paril
Junior Member
**

Avatar
Admin of Paril's Projects

Posts: 69
31 / Male / Flag
Joined: Jul 2006
RE: Script does not start, or hook onto Plus! menu
Well, sometimes, (it happened to me) if a file is huge, it won't load at all. It'll just.. stop, and reload only sometimes.. try splitting some files, if you can.

Other than that, it looks OK..
07-09-2006 01:42 PM
Profile E-Mail PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
O.P. RE: Script does not start, or hook onto Plus! menu
I see, well the script is only 129 lines so I don't think it is a problem. Btw, this happens everytime, not just random :P.
07-09-2006 01:44 PM
Profile PM Find Quote Report
Paril
Junior Member
**

Avatar
Admin of Paril's Projects

Posts: 69
31 / Male / Flag
Joined: Jul 2006
RE: Script does not start, or hook onto Plus! menu
Hmm. Something is dead, but I can't pinpoint it... Maybe the .xml (if you're loading one) might be corrupt (IE: not unicode, etc)...
07-09-2006 01:46 PM
Profile E-Mail PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: Script does not start, or hook onto Plus! menu
Yes, this problem happens with myself also. My 'OnGetScriptCommands()' returns perfect syntax but fails to show the new command in the commands menu. It only happens with my scripts (even blank scripts) for some reason, and i have had problems with 'OnGetScriptMenu(Location)' also. I tried sticking the following at the beginning of one of my scripts;
code:
function OnEvent_Initialize(MessengerStart)
{
}

function OnEvent_Uninitialize(MessengerExit)
{
}
and it fixed the main plus menu, but not the commands menu (which appears when typing '/'). Note: This only worked with one of my scripts...

This post was edited on 07-09-2006 at 02:01 PM by Volv.
07-09-2006 01:59 PM
Profile PM Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
O.P. RE: Script does not start, or hook onto Plus! menu
Nope, that did not work for me :(. This never used to happen, I have a feeling some of my other code is effecting it:

code:
//This script was created by absorbation. You may not use any of this code in your work without full permission from me.
//This script was created for free to help you gain a better messenger experience.  I therefore accept no responsiblity for what may happen to your computer, although it is very unlikly to do anything accept change Windows Live Messenger's messages.
//Thanks for using my script and I hope you enjoy it.

var Email = Messenger.MyEmail;
var ScriptName = "Message Enchanter";

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
var CommandIs = new ActiveXObject('WScript.Shell').RegRead(MsgPlus.ScriptRegPath + Email + "\\command");

if(Message.substring(0,1) != "/") {

    if(CommandIs == "None") {
    return Message;
    }
   
    if(CommandIs == "Bold") {
    return Message.replace(Message, "" + Message + "");
    }
   
    if(CommandIs == "Underline") {
    return Message.replace(Message, "" + Message + "");
    }
   
    if(CommandIs == "Strike") {
    return Message.replace(Message, "" + Message + "");
    }
   
    if(CommandIs == "Caps") {
    return Message.replace(Message, Message.toUpperCase());
    }
   
    if(CommandIs == "CapsAndDots") {
    return Message.replace(Message, Message.substr(0,1).toUpperCase() + Message.substr(1) + '.');
    }
       
    if(CommandIs == "MeCommand") {
    return "/me says: " + Message;
    }
   
    if(CommandIs == "NoIcon") {
    return "/noicon " + Message;
    }
   
    if(CommandIs == "NoFormat") {
    return "/noformat " + Message;
    }
}
}

function OnGetScriptMenu(Location)
{
    var ScriptMenu ="<ScriptMenu>";
    ScriptMenu +="<MenuEntry Id=\"Options\">Options</MenuEntry>";
    ScriptMenu +="<Separator/>";
    ScriptMenu +="<MenuEntry Id=\"About\">About " + ScriptName + "</MenuEntry>";
    ScriptMenu +="</ScriptMenu>";
    return ScriptMenu;
}

function OnEvent_MenuClicked(MenuId)
{
    if(MenuId=="Options"){
        var CommandIs = 'None';
        var CommandIs = new ActiveXObject('WScript.Shell').RegRead(MsgPlus.ScriptRegPath + Email + "\\command");
       
        var Wnd = MsgPlus.CreateWnd("Windows.xml", "Options");
        Wnd.Button_SetCheckState(CommandIs,"True");
    }
   
    if(MenuId=="About"){
        var Wnd = MsgPlus.CreateWnd("Windows.xml", "About");
    }
}

function OnOptionsEvent_CtrlClicked(Wnd, ControlId)
{
    if(ControlId == "BtnClose") {
        MsgPlus.DisplayToast(ScriptName, "Your settings have been saved and your option has been enabled.");
        Wnd.Close(1);
    }
   
    if(ControlId == "None") {
        var CommandIs = "None";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
   
    if(ControlId == "Bold") {
        var CommandIs = "Bold";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
   
    if(ControlId == "Underline") {
        var CommandIs = "Underline";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
   
    if(ControlId == "Strike") {
        var CommandIs = "Caps";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
       
    if(ControlId == "NoIcon") {
        var CommandIs = "NoIcon";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
   
    if(ControlId == "NoFormat") {
        var CommandIs = "NoFormat";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
   
    if(ControlId == "Caps") {
        var CommandIs = "Caps";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
   
    if(ControlId == "CapsAndDots") {
        var CommandIs = "CapsAndDots";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
   
    if(ControlId == "MeCommand") {
        var CommandIs = "MeCommand";
        new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
    }
}
07-09-2006 02:10 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: Script does not start, or hook onto Plus! menu
Maybe try changing some global variable names.
code:
var Email = Messenger.MyEmail;
var ScriptName = "Message Enchanter";
Once it wouldn't load the script until I changed the names :S

Also, make sure messenger is signed in when you set Email to Messenger.MyEmail:^)...but not sure
07-09-2006 03:18 PM
Profile PM Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
O.P. RE: Script does not start, or hook onto Plus! menu
quote:
Originally posted by deAd
Also, make sure messenger is signed in when you set Email to Messenger.MyEmail(Smilie)...but not sure


That makes 100% sence, I use the Email varible alot of times, it explains why it breaks. Let me just try that ...
07-09-2006 04:23 PM
Profile PM Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
21 / Other / Flag
Joined: Jul 2003
RE: Script does not start, or hook onto Plus! menu
does the debug throw an error by any chance?
07-09-2006 05:03 PM
Profile PM Web Find Quote Report
AberNStein
Full Member
***


Posts: 132
Reputation: 2
Joined: Jul 2006
RE: Script does not start, or hook onto Plus! menu
why not just put the menu and commands in ScriptInfo.xml?
[Image: gybouserbar6hc.gif]
07-10-2006 01:39 AM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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