Scripting Help - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Scripting Help (/showthread.php?tid=81326)
Scripting Help by Thunder708 on 01-30-2008 at 05:35 PM
I have made a script that quickly uses the commands that the computer details script uses (http://www.msgpluslive.net/scripts/view/14-Computer-Details/) but when i run the script it says
The Command You Entered Was Not Recognised
If The Message Was Not Meant To Be A Command, Insert A Second '/' At It's Beginning
Thing Is It Still Runs The Script
How Do You Make A Script To Be Detected As A Usable Script
Can Anyone help me please?
Thanks To Anyone who does.
so far i have this code it accepts the "/details" command now but it says true instead of what it is supposed to say
code: //Script created by Michael Braithwaite
function OnGetScriptCommands ()
{
commands = "<ScriptCommands>";
commands += "<Command>";
commands += "<Name>Details</Name>";
commands += "<Description>Quick Way Of Showing Your Computer Details If You Have The Computer Details Script Installed (http://www.msgpluslive.net/scripts/view/14-Computer-Details/)</Description>";
commands += "</Command>";
commands += "</ScriptCommands>";
return commands;
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
var CMD = Message.split(" ", 1).toString();
switch(CMD.toLowerCase()){
case "/details" : return Command_details();
}
function Command_details ()
{
var OS = (!OS);
return "My Operating System Is ("+OS+")"
}
}
i am only testing it out on one command from the computer details script for time being, once i have this little problem sorted i will expand it to show all commands.
RE: Scripting Help by matty on 01-30-2008 at 11:18 PM
quote: Originally posted by Thunder708
commands += "<Name>Details</Name>";
should be
code: commands += "<Name>details</Name>";
RE: Scripting Help by Thunder708 on 01-30-2008 at 11:24 PM
thanks for that but it hasnt made any effect tbh.
I had sorted that out to start with
my newer code which i have posted, when /details is typed says My operating system is (true), it should say what OS i ahve, any ideas?
RE: Scripting Help by deAd on 01-30-2008 at 11:27 PM
quote: Originally posted by Thunder708
code: function Command_details ()
{
var OS = (!OS);
return "My Operating System Is ("+OS+")"
}
That code is adding a boolean into the string (the line in bold is where the variable OS is becoming a boolean value). Make sure that the variable OS is set to the appropriate string you want to show.
RE: Scripting Help by Thunder708 on 01-31-2008 at 11:59 AM
i dont have a clue what to do...al i wanted to achieve was a simple script that used the commands from computer details script at an easier level than they already are.
I supose i could just use quick text commands to use theses detail commands but it would be nice to make this sript work.
RE: Scripting Help by Matti on 01-31-2008 at 05:03 PM
You don't want to add in a variable and invert its valuable. You want to insert the "(!OS)" tag and make it being parsed by the other script. Therefore, you should add quotes around the (!OS), as it has to be interpreted as literal text to be added into the output string.
Although, there's a big change that this won't work at all. When you receive a message, Plus! will let all scripts do their stuff with it by calling their OnEvent_ChatWndSendMessage functions. However, you can never make sure that your script gets executed before the Computer Details script can find it.
The best thing you can do is make a quick text with the "/details" shortcut and make it send "My Operating System Is (!OS)". I understand that you're trying to get into scripting, but if you want to make it functional, you're better off with a quick text or you can analyze the code of Computer Details and use it in yours. That way, you can let your script find out the operating system and add the result to the output message, so it won't depend on another script to make it function.
|