Jump to content

Help Needed making a Multi-Line titler


Kendall Edman
 Share

You are about to reply to a thread that has been inactive for 4530 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

i am not good at building scripts from scratch, but understand scripting enough to mod them to work for me.

i have however ran into a snag, what i am trying to do is turn a titler into a multi-line titler.

heres the snippet:

 

listen(integer chan, string name, key id, string msg)
    {
        string mesg;
        mesg = llToLower(msg);
        if(chan == 1)
        {
            if(llGetOwnerKey(id) == llGetOwner())
            {
                if(llGetSubString(mesg, 0, 5) == "title ")
                {
                    title = llGetSubString(msg, 6, -1);
                    if(llToLower(title) == "titleoff")
                    {
                        title = "";
                    }

 

i know that \n starts a new line but saying it in open chat wont work, what i need help with is making an un-used character make a new line on a titler.

i have seen some others that use a pipe character "|" to start new lines. if i can get help with making my script do that it will be great.

Link to comment
Share on other sites

the reason "\n" doesn't work from the string is that string sources are parsed differently if they're sourced from within the script or externally....

when you "\n" in the script you get the line break, but passed in from an outside source, what you actually get is "\\n" because internally "\" is treated as a control character, but it's interpreted as a literal character when it comes from an oustside source... the internal literal is "\\"

so in string replace you would just do this...

message = llDumpList2String( llParseStringKeepNulls( message, ["\\n"], [] ), "\n" );

letting you type the same thing you would expect to use internally for the external source.

PS
only chimed in because of keeping the same format and the slashes above were backwards ;)

  • Like 1
Link to comment
Share on other sites

ok I kinda got it to work, I messed around and got it to recognize multiple lines but the word title shows up in front of my custom title, it looks somthing like this(title MyCustomTitle) this only shows up on line one.

this is what i did.

listen(integer chan, string name, key id, string msg)
    {
        string mesg;
        mesg = llToLower(msg);
        if(chan == 1)
        {
            if(llGetOwnerKey(id) == llGetOwner())
            {                if(llGetSubString(mesg, 0, 5) == "title ")
                {
                    title = llGetSubString(msg, 6, -1);
                    title = llDumpList2String( llParseStringKeepNulls( msg, ["|"], [] ), "\n" );
                    if(llToLower(title) == "titleoff")
                    {
                        title = "";
                    }

 

I know I did something right but I also messed up something because title is showing up, however I am getting more than one line now, so my question is what did i do wrong?

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4530 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...