Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

need somone to check my work

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
03-28-2009 14:02
ive been battling with this for last 20 minutes i cant seam to fix the problem, there are 2 scripts.

first
----

CODE

string c = "";
string c1 = "";
string c2 = "";
default
{
state_entry()
{
llListen(0,"",llGetOwner(),"");
llSetTimerEvent(1);

}
listen(integer channel, string name, key id, string message)
{
c = llGetSubString(message, 0, 2);
c1 = llGetSubString(message, 4, 4);
c2 = llGetSubString(message, -1,-1);
if(c == "set")
{
if(c1 == "r")
{
c1 = "r";
}
if(c1 == "b")
{
c1 = "b";
}
if(c1 == "y")
{
c1 = "y";
}
if(c1 == "w")
{
c1 = "w";
}
if(c2 == "y")
{
c2 = "y";
}
if(c2 == "w")
{
c2 = "w";
}
if(c2 == "r")
{
c2 = "r";
}
if(c2 == "b")
{
c2 = "b";
}
}
llOwnerSay("Color Being Reset");
llSleep(2);
llWhisper(-7564,(string)llGetOwner()+" "+c1+c2);
//-7564
llOwnerSay("Color Setting "+c1+c2);
}
timer()
{
integer own = llGetAgentInfo(llGetOwner());
if(own & AGENT_SITTING)
{
llSetLinkAlpha(LINK_SET, 1, ALL_SIDES);
}
else
{
llSetLinkAlpha(LINK_SET, 0, ALL_SIDES);
llWhisper(-7564,(string)llGetOwner()+" "+c1+c2);
}
}
}



second
--------

CODE

string c1 = "";
string c2 = "";
string c = "";
default
{
state_entry()
{
llListen(-7564, "", "", "");
}
listen(integer channel, string name, key id, string message)
{
c = llGetSubString(message, 0, 37);
c1 = llGetSubString(message, 39, 41);
c2 = llGetSubString(message, -1,-1);
llWhisper(0,message);
if (message == "l on")
{
llSetTexture("27bed03f-fb02-d0a6-35a9-67481dc1653e",6);
llSetTexture("1a083278-6701-c353-b5be-da0b6c95bf29",7);
llSetPrimitiveParams([25,6,.3]);
llSetPrimitiveParams([25,7,.3]);
llSetTextureAnim(ANIM_ON | LOOP, ALL_SIDES,1,2,0,0,10);
llSetPrimitiveParams([PRIM_FULLBRIGHT, 6, TRUE]);
llSetPrimitiveParams([PRIM_FULLBRIGHT, 7, TRUE]);
}
else if (message == "l off")
{
llSetTexture("137441a2-58f8-9a97-5c32-aba29a695241",6);
llSetTexture("137441a2-58f8-9a97-5c32-aba29a695241",7);
llSetPrimitiveParams([25,6,0]);
llSetPrimitiveParams([25,7,0]);
llSetTextureAnim(LOOP, ALL_SIDES,1,1,0,0,0);
llSetPrimitiveParams([PRIM_FULLBRIGHT, ALL_SIDES, FALSE]);
}
else
{
if(c == llGetOwner())
{
if(c1 == "r")
{
llSetColor(<1,0,0>,6);
}
if(c1 == "b")
{
llSetColor(<0,0,1>,6);
}
if(c1 == "y")
{
llSetColor(<1,1,0>,6);
}
if(c1 == "w")
{
llSetColor(<1,1,1>,6);
}
if(c2 == "y")
{
llSetColor(<1,1,0>,7);
}
if(c2 == "w")
{
llSetColor(<1,1,1>,7);
}
if(c2 == "r")
{
llSetColor(<1,0,0>,7);
}
if(c2 == "b")
{
llSetColor(<0,0,1>,7);
}
}
}
}
}
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
03-28-2009 14:40
And the problem is that the color doesn't change? Take a look at your llSetPrimitiveParams statements. They're incomplete. You need to specify a constant like PRIM_COLOR and each of its related parameters. A statement like llSetPrimitiveParams([25,6,.3]); won't do anything.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
03-28-2009 21:10
Well, for starters, stating what you're trying to achieve would help, it appears to be some sort of color changing script... but that aside...

CODE

if(c1 == "r")
{
c1 = "r";
}
if(c1 == "b")
{
c1 = "b";
}
if(c1 == "y")
{
c1 = "y";
}
... etc...


What exactly are you trying to do here? What's the point? What you're saying is:
If c1 is equal to "r", then set c1 to "r". It serves no purpose to set a variable to a value that it's already set to. That's probably part of your problem. If you want more help, perhaps describe what you're trying to do.
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
03-29-2009 01:23
when in doubt, print your variables....
CODE

c = llGetSubString(message, 0, 37);
c1 = llGetSubString(message, 39, 41);
c2 = llGetSubString(message, -1,-1);


keys are only 36 characters not 38
and you expect a single character when testing c1
try
c = llGetSubString(message, 0, 35);
c1 = llGetSubString(message, 37, 37);
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -