Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Please Help

Sweetheart Baskerville
Registered User
Join date: 1 Jan 2004
Posts: 32
09-06-2006 10:21
The two scripts below I would like to somehow put them both as one script....the far bottom I would have to go into the script to type the text which I do not want to have to do...With the top script all I have to do is type this in chat /63 title (type color here) type message here ....I would love to have the title flashing the different colors if that is possible but since I do not know anything about scripting I do not know how to incorporate both into the better titler...If someone could be so kind as to please do this it would be most apprecieated... Thank You,
Juliea (Sweetheart Baskerville)

**********************************************************************

string command = "";
string person = "";
key owner;

default
{
state_entry()
{
owner = llGetOwner();
llListen(63,"",owner,"";);
}

attach(key attached)
{
if (attached != NULL_KEY)
{
llInstantMessage(owner,"To set a title: title <color name> <title text>";);
llInstantMessage(owner,"To remove title: title off";);
llInstantMessage(owner,"<color name> can be: white, black, red, green, blue, pink, cyan, purple, yellow, orange";);
llResetScript();
}
}

listen(integer channel, string name, key id, string message)
{
list strings = llParseString2List(message,[" "],[]);
string command=llList2String(strings,0);
string string1=llList2String(strings,1);
if(command=="title";)
{
vector color=<0,0,0>;
if(string1=="blue";)
{
color=<0,0,1>;
}
else if(string1=="orange";)
{
color=<1,0.5,0>;
}
else if(string1=="cyan";)
{
color=<0,1,1>;
}
else if(string1=="pink";)
{
color=<1,0,1>;
}
else if(string1=="green";)
{
color=<0,1,0>;
}
else if(string1=="red";)
{
color=<1,0,0>;
}
else if(string1=="white";)
{
color=<1,1,1>;
}
else if(string1=="yellow";)
{
color=<1,1,0.1>;
}
else if(string1=="purple";)
{
color=<0.7,0,0.7>;
}
else
{
color=<0,0,0>;
}
string title = "";
integer i;
for(i=2; i<=12; i++)
{
if(llStringLength(llList2String(strings,i)))
{
title = title + llList2String(strings,i) + " ";
}
}
if(title == "off";)
{
llSetText("",<0,0,0>,1.0);
} else {
llSetText(title, color, 1.0);
}
}
}
}



**********************************************************************


default
{
state_entry()
{
llSetTimerEvent(5.0);
}
timer()
{
float red=llFrand(1);
float green=llFrand(1);
float blue=llFrand(1);
llSetText("type your text here", <red,green,blue>, 2);
}
}
Dnel DaSilva
Master Xessorizer
Join date: 22 May 2005
Posts: 781
09-06-2006 11:12
I'm not an awesome coder but I manage to do this sort of thing. May not be the most efficent code, but it works. Gives you the choice of the solid colours and the flash, using the commands from the first script and adding a 'flash' colour:

CODE

string command = "";
string person = "";
key owner;
string title;

default
{
state_entry()
{
owner = llGetOwner();
llListen(63,"",owner,"");
llSetTimerEvent(0.0);
}

attach(key attached)
{
if (attached != NULL_KEY)
{
llOwnerSay("To set a title:/63 title <color name> <title text>");
llOwnerSay("To remove title:/63 title off");
llOwnerSay("<color name> can be: white, black, red, green, blue, pink, cyan, purple, yellow, orange or flash");
llResetScript();
}
}

timer()
{
float red=llFrand(1);
float green=llFrand(1);
float blue=llFrand(1);
llSetText(title,<red,green,blue>,2);
}

listen(integer channel, string name, key id, string message)
{
list strings = llParseString2List(message,[" "],[]);
string command=llList2String(strings,0);
string string1=llList2String(strings,1);
if(command=="title")
{
vector color=<0,0,0>;
if(string1=="blue")
{
llSetTimerEvent(0.0);
color=<0,0,1>;
}
else if(string1=="orange")
{
llSetTimerEvent(0.0);
color=<1,0.5,0>;
}
else if(string1=="cyan")
{
llSetTimerEvent(0.0);
color=<0,1,1>;
}
else if(string1=="pink")
{
llSetTimerEvent(0.0);
color=<1,0,1>;
}
else if(string1=="green")
{
llSetTimerEvent(0.0);
color=<0,1,0>;
}
else if(string1=="red")
{
llSetTimerEvent(0.0);
color=<1,0,0>;
}
else if(string1=="white")
{
llSetTimerEvent(0.0);
color=<1,1,1>;
}
else if(string1=="yellow")
{
llSetTimerEvent(0.0);
color=<1,1,0.1>;
}
else if(string1=="purple")
{
llSetTimerEvent(0.0);
color=<0.7,0,0.7>;
}
else if(string1=="flash")
{
llSetTimerEvent(5.0);
}
else
{
color=<0,0,0>;
}
title = "";
integer i;
for(i=2; i<=12; i++)
{
if(llStringLength(llList2String(strings,i)))
{
title = title + llList2String(strings,i) + " ";
}
}
if(title == "off")
{
llSetText("",<0,0,0>,1.0);
}
else
{
llSetText(title, color, 1.0);
}
}
}
}