Script does not start, or hook onto Plus! menu |
Author: |
Message: |
absorbation
Elite Member
Posts: 3636 Reputation: 81
– / /
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 |
|
|
Paril
Junior Member
Admin of Paril's Projects
Posts: 69
31 / /
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 |
|
|
absorbation
Elite Member
Posts: 3636 Reputation: 81
– / /
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 .
|
|
07-09-2006 01:44 PM |
|
|
Paril
Junior Member
Admin of Paril's Projects
Posts: 69
31 / /
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 |
|
|
Volv
Skinning Contest Winner
Posts: 1233 Reputation: 31
35 / /
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 |
|
|
absorbation
Elite Member
Posts: 3636 Reputation: 81
– / /
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 |
|
|
deAd
Scripting Contest Winner
Posts: 1060 Reputation: 28
– / /
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
Also, make sure messenger is signed in when you set Email to Messenger.MyEmail ...but not sure
|
|
07-09-2006 03:18 PM |
|
|
absorbation
Elite Member
Posts: 3636 Reputation: 81
– / /
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 |
|
|
Stigmata
Veteran Member
Posts: 3520 Reputation: 45
21 / /
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 |
|
|
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?
|
|
07-10-2006 01:39 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|