newbie scripting help

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie scripting help

Rahabib
hey guys, I am new to chatzilla.  I like it better than mIRC for so many
reasons.  I am learning to do a few things in scripting but I am unsure
of a few things.

the only question I have at this time is I have an advertising script I
am working on.

// JavaScript Document

function initPlugin(glob)
        {
                plugin.id = "jgr-slap";
                plugin.major = 1;  // Major version number.
                plugin.minor = 0;  // Minor version number.
                plugin.version = plugin.major + "." + plugin.minor;
                plugin.description = "A sample command manager script";
       
        plugin.cmdlist = [
                        ["recruit", cmdRecruit, CMD_CONSOLE | CMD_NO_HELP ]
                                  ];

        client.commandManager.defineCommands(plugin.cmdlist);
        }

function cmdRecruit()
        {
                dispatch("say %C00,04 say [GFY] is recruiting || Assault/Sniper/Heavy
|| backups for any position || #teamgfy || #thewarroom ||
http://www.trypants.com/forums/showthread.php?t=408");
        }

forgive the formatting.

I the only problem I have is I want the advertisement to use the color
properties %C00,04 in the advertisement.  However, it literally prints
them in the say message.  Is there a way to send color properties?

Thanks for any help.
_______________________________________________
dev-apps-chatzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-chatzilla
Reply | Threaded
Open this post in threaded view
|

Re: newbie scripting help

James Ross
Rahabib wrote:
> I the only problem I have is I want the advertisement to use the color
> properties %C00,04 in the advertisement.  However, it literally prints
> them in the say message.  Is there a way to send color properties?

The colour codes are handled long before the text reaches the dispatch
code, so you need to do the handling yourself, like this:

   dispatch(replaceColorCodes("say %C00,04Some message!"));

replaceColorCodes will turn the %-codes into the real codes that need to
be sent.

--
James Ross <[hidden email]>
ChatZilla Developer
_______________________________________________
dev-apps-chatzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-chatzilla