Shoutbox

Slight problem [Seems unsolvable, best forgotten] - 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: Slight problem [Seems unsolvable, best forgotten] (/showthread.php?tid=73750)

Slight problem [Seems unsolvable, best forgotten] by Red King on 04-19-2007 at 07:41 PM

Hey sorry again but I need to bug you guys one more time about a script problem (I asked about one ages ago before)

I've made this script so far that links up to the Colorize script someone else made, I wanted to be able to use it without having to type /Colorize into every message:

code:
var blnEnabled = false;

function OnGetScriptCommands ()
{
    commands  = "<ScriptCommands>";
    commands +=     "<Command>";
    commands +=         "<Name>cstart</Name>";
    commands +=         "<Description>Start Auto Colorize</Description>";
    commands +=     "</Command>";
    commands +=     "<Command>";
    commands +=         "<Name>cstop</Name>";
    commands +=         "<Description>Stop Auto Colorize</Description>";
    commands +=     "</Command>";
    commands += "</ScriptCommands>";
    return commands;
}


function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    switch (Message){
        case "/cstart":
            blnEnabled = true;
            return '';
        case "/cstop":
            blnEnabled = false;
            return '';
        default:
            if (blnEnabled == true){
            (Message.substring(0,1) != "/")
       return "/colorize "+Message;
   return Message;
}


But once I click apply it doesn't want to work for me, does anyone know where the problem here is and how to fix it? (somewhere in the bottom area because the enabler is something I used in many others)
I would very much appreciate any help given and again I'm sorry for having to bug you for help all over again on my second actual script I'm making >.<
I'm still learning but with some help I should eventually get the hang of it.
RE: Slight problem ^^; by scott2010_h on 04-19-2007 at 08:15 PM

It looks like you forgot a few brackets
Hope this helps :)

code:
var blnEnabled = false;

function OnGetScriptCommands ()
{
commands  = "<ScriptCommands>";
commands +=     "<Command>";
commands +=         "<Name>cstart</Name>";
commands +=         "<Description>Start Auto Colorize</Description>";
commands +=     "</Command>";
commands +=     "<Command>";
commands +=         "<Name>cstop</Name>";
commands +=         "<Description>Stop Auto Colorize</Description>";
commands +=     "</Command>";
commands += "</ScriptCommands>";
return commands;
}


function OnEvent_ChatWndSendMessage(ChatWnd, Message){
switch (Message){
case "/cstart":
blnEnabled = true;
return '';
case "/cstop":
blnEnabled = false;
return '';
default:
if (blnEnabled == true){
(Message.substring(0,1) != "/")
   return "/colorize "+Message;
   return Message;
}
}
}

RE: Slight problem ^^; by Red King on 04-19-2007 at 08:20 PM

Well that fixed the not activating problem and I thank you much for that but NOW I've got the problem of the error message when I try to talk (which will of course be my fault somewhere in this heap of commands). It says the command wasn't recognized and to put a "//"  if it wasn't a command... which is weird because it's using the /colorize command I have for the colorizer.

Any fix for it not recognizing commands? Or is my script doomed to never work?


RE: Slight problem [problem 1 solved, onto number 2] by scott2010_h on 04-19-2007 at 08:57 PM

What did I do? (I cant remember)
* scott2010_h use Ctrl+Z  and Ctrl+Y to remember

It looks like I added an if in there by (Message.substring(0,1) != /)
EDIT:
(I tested it and it works for me)

EDIT2:
(It stoped working for me :( [Image: xso_huh.gif])

code:
var blnEnabled = false;

function OnGetScriptCommands ()
{
var commands  = "<ScriptCommands>";
commands +=     "<Command>";
commands +=         "<Name>cstart</Name>";
commands +=         "<Description>Start Auto Colorize</Description>";
commands +=     "</Command>";
commands +=     "<Command>";
commands +=         "<Name>cstop</Name>";
commands +=         "<Description>Stop Auto Colorize</Description>";
commands +=     "</Command>";
commands += "</ScriptCommands>";
return commands;
}


function OnEvent_ChatWndSendMessage(ChatWnd, Message){
switch (Message){
case "/cstart":
blnEnabled = true;
return '';
case "/cstop":
blnEnabled = false;
return '';
default:
if (blnEnabled == true){
if (Message.substring(0,1) != "/"){
   return "/colorize "+ Message;
}
}
}
}

RE: Slight problem [problem 1 solved, onto number 2] by Red King on 04-19-2007 at 09:02 PM

Still no results I still get the message saying the command wasn't recognized.. I'll just have to bin it, something tells me a script can't link up to another script even if it's just by putting it's command at the start of a message.. Thanks for the help anyways.

BUT if anyone comes up with one that's tested to work PLEASE let me know because writing that command into everything is really bugging me >.<


RE: Slight problem [problem 1 solved, onto number 2] by scott2010_h on 04-19-2007 at 09:06 PM

add me on msn so we can sort this out [Image: sig.php?email=scott2010_h AT hotmail DOT com]
Me and Red King couldnt figure it out so we decided to directly mod the Colorize script it self

(if you want the modified version pm me, email me, or add me on to messenger)