Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Function Args: v

JohnLe Fukai
Registered User
Join date: 31 Aug 2006
Posts: 6
07-07-2007 15:37
Apparently SL is broken.


From: someone

vector red=<1.0,0.0,0.0>;
vector green=<0.0,1.0,0.0>;
vector blue=<0.0,0.0,1.0>;
vector yellow=<1.0,1.0,0.0>;
vector purple=<1.0,0.0,1.0>;
vector orange=<1.0,0.5,0.0>;
vector pink=<1.0,0.75294,0.79608>;
vector black=<0.0,0.0,0.0>;
vector white=<1.0,1.0,1.0>;
integer channel=360;
list menuItems=["Reset","Look","Effectz"];
list lookItems=["< Back","StrapTex","Colorz"];
list colorItems=["< Back","Body","Buttons","Strap","Texture"];
list itemColorsMenu=["< Back","Red","Green","Blue","Yellow","Purple","Orange","Pink","Black","White"];
list strapTexture=["< Back","SL","More >","Tux","Script","Notepad","Firefox","Heart","Scully","Pedestrian","Star","Smiley"];
list moreStrapTexture=["< Back","Apple","Vista"];
list effectzItems=["< Back","STOP","Particlez","Breadcrumb","Sparkler"];
// ,"Fire"
list effectzTextures=["< Back","STOP","More >","Firefox","Tux","Script","Notepad","Apple","Heart","Scully","Pedestrian","Kid"];
list moreEffectzTextures=["< Back","STOP","SL","Smiley","Star","Vista"];
list breadTextures=["< Back","STOP","More >","Firefox","Tux","Script","Notepad","Apple","Heart","Scully","Pedestrian","Kid"];
list mBreadTextures=["< Back","STOP","SL","Smiley","Star","Vista"];
string optionz="Spin ya optionz:";
string lookz="Change ya lookz:";
string colorz="What ya wanna Color?";
string zapBody="Zap ya Body Colorz:";
string zapButtons="Zap ya Buttonz Colorz:";
string zapStrap="Zap ya Strap Colorz:";
string zapTexture="Zap ya Texture Colorz:";
string setTexture="Pick ya texture for the Strap:";
string zapEffectz="Effectz Stuff";
string ZapEffectzTexture="Spin ya Textures:";
key apple="b08cf7d5-a1d1-1598-79ac-65026522782a";
key firefox="27a39dd4-093d-82e3-7f41-a9ce4c10ddf5";
key heart="38adf8a6-b7f2-d427-74ff-c52c2cd7fac6";
key LSL="6543a818-dfe7-056c-8121-4041f7078ea7";
key notepad="27194cfa-11a7-6f7f-4ac9-43577d123fcd";
key scully="3c2c489a-1a87-2b38-9c6c-2c1023450644";
key SL="f337230a-c8ef-3d1a-b068-3a6f7e411fbb";
key tux="4b49be95-f9a5-6fdf-de67-74cb3a0321e8";
key pedestrian="943c2d33-70dc-0a28-9e63-5cdb212d0d1f";
key heyKid="dddc0ad9-d87e-71d8-3a42-5d29c18f7209";
key countdown="dd443d49-8c49-7892-52f0-d2784159c8ee";
key smiley="e18fc4a7-08be-9b1d-f0e3-88a7e4c1de7a";
key star="d56422da-0251-3a86-de1c-cc4af745869d";
key vista="d1651b28-cj78-aedf-05cc-b48f64bd338d";

watchBodyColor(vector setColor){
llSetLinkColor(2,setColor,ALL_SIDES);
llSetLinkColor(6,setColor,ALL_SIDES);
llSetLinkColor(7,setColor,ALL_SIDES);
llSetLinkColor(8,setColor,ALL_SIDES);
llSetLinkColor(11,setColor,ALL_SIDES);
llSetLinkColor(13,setColor,ALL_SIDES);
llSetLinkColor(15,setColor,ALL_SIDES);
llSetLinkColor(17,setColor,ALL_SIDES);
return;
}

buttonsColor(vector setColor){
llSetLinkColor(10,setColor,ALL_SIDES);
llSetLinkColor(12,setColor,ALL_SIDES);
llSetLinkColor(14,setColor,ALL_SIDES);
llSetLinkColor(16,setColor,ALL_SIDES);
llSetLinkColor(18,setColor,ALL_SIDES);
return;
}

strapColor(vector setColor){
llSetLinkColor(5,setColor,ALL_SIDES);
return;
}

strapColor2(vector setColor){
llSetLinkColor(3,setColor,1);
llSetLinkColor(3,setColor,3);
return;
}

strapColorTexture(vector setColor){
llSetLinkColor(3,setColor,0);
return;
}

goEffectz(integer linkNumber,string effectzTexture){llMessageLinked(LINK_THIS,linkNumber,effectzTexture,NULL_KEY);return;}

goDialog(string dialogText,list dialogList){llListen(channel,"",llGetOwner(),"";);llDialog(llGetOwner(),dialogText,dialogList,channel);return;}

default{
changed(integer change){if(change &CHANGED_OWNER)llResetScript();}
state_entry(){
goEffectz(3,NULL_KEY);
llSetStatus(STATUS_PHANTOM,TRUE);
llSetTexture(countdown,ALL_SIDES);
llSetTextureAnim (ANIM_ON|LOOP,ALL_SIDES,10,1,0,0,1);
llOwnerSay("\nFunky Chunky Digi-Watch\nClick on your JShock to get the dialog";);
llSetLinkTexture(3,scully,0);watchBodyColor(orange);buttonsColor(red);strapColor(red);strapColor2(red);strapColorTexture(yellow);
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state firstDialog{
state_entry(){goDialog(optionz,menuItems);}
listen(integer channel,string name,key id,string message){
if(message=="Reset";){state default;}
else if(message=="Look";){state lookItemsState;}
else if(message=="Effectz";){state effectzItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){goDialog(optionz,menuItems);}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state lookItemsState{
state_entry(){goDialog(lookz,lookItems);}
listen(integer channel,string name,key id,string message){
if(message=="StrapTex";){state strapTextureState;}
else if(message=="Colorz";){state colorItemsState;}
else if(message=="< Back";){state firstDialog;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state colorItemsState{
state_entry(){goDialog(colorz,colorItems);}
listen(integer channel,string name,key id,string message){
if(message=="Body";){state bodyColorsState;}
else if(message=="Buttons";){state buttonColorsState;}
else if(message=="Strap";){state strapColorsState;}
else if(message=="Texture";){state strapTextureColorsState;}
else if(message=="< Back";){state lookItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state strapTextureState{
state_entry(){goDialog(setTexture,strapTexture);}
listen(integer channel,string name,key id,string message){
if(message=="SL";){llSetLinkTexture(3,SL,0);goDialog(setTexture,strapTexture);goEffectz(2,SL);}
else if(message=="Firefox";){llSetLinkTexture(3,firefox,0);goDialog(setTexture,strapTexture);goEffectz(2,firefox);}
else if(message=="Tux";){llSetLinkTexture(3,tux,0);goDialog(setTexture,strapTexture);goEffectz(2,tux);}
else if(message=="Script";){llSetLinkTexture(3,LSL,0);goDialog(setTexture,strapTexture);goEffectz(2,LSL);}
else if(message=="Notepad";){llSetLinkTexture(3,notepad,0);goDialog(setTexture,strapTexture);goEffectz(2,notepad);}
else if(message=="Heart";){llSetLinkTexture(3,heart,0);goDialog(setTexture,strapTexture);goEffectz(2,heart);}
else if(message=="Scully";){llSetLinkTexture(3,scully,0);goDialog(setTexture,strapTexture);goEffectz(2,scully);}
else if(message=="Pedestrian";){llSetLinkTexture(3,pedestrian,0);goDialog(setTexture,strapTexture);goEffectz(2,pedestrian);}
else if(message=="Star";){llSetLinkTexture(3,star,0);goDialog(setTexture,strapTexture);goEffectz(2,star);}
else if(message=="Smiley";){llSetLinkTexture(3,smiley,0);goDialog(setTexture,strapTexture);goEffectz(2,smiley);}
else if(message=="More >";){state mStrapText;}
else if(message=="< Back";){state lookItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state mStrapText{
state_entry(){goDialog(setTexture,moreStrapTexture);}
listen(integer channel,string name,key id,string message){
if(message=="Apple";){llSetLinkTexture(3,apple,0);goDialog(setTexture,moreStrapTexture);goEffectz(2,apple);}
else if(message=="Vista";){llSetLinkTexture(3,vista,0);goDialog(setTexture,moreStrapTexture);goEffectz(2,vista);}
else if(message=="< Back";){state strapTextureState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state effectzItemsState{
state_entry(){goDialog(zapEffectz,effectzItems);}
listen(integer channel,string name,key id,string message){
if(message=="STOP";){goEffectz(3,NULL_KEY);goDialog(zapEffectz,effectzItems);}
else if(message=="Particlez";){state effectzTexturesState;}
else if(message=="Breadcrumb";){goEffectz(4,smiley);goDialog(zapEffectz,effectzItems);}
else if(message=="Sparkler";){goEffectz(5,NULL_KEY);goDialog(zapEffectz,effectzItems);}
// else if(message=="Fire";){fireEffectz();goDialog(zapEffectz,effectzItems);}
else if(message=="< Back";){state firstDialog;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state effectzTexturesState{
state_entry(){goDialog(ZapEffectzTexture,effectzTextures);}
listen(integer channel,string name,key id,string message){
if(message=="More >";){state moreEffectzTexturesState;}
else if(message=="Firefox";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,firefox);}
else if(message=="Apple";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,apple);}
else if(message=="Script";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,LSL);}
else if(message=="Heart";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,heart);}
else if(message=="Notepad";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,notepad);}
else if(message=="Scully";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,scully);}
else if(message=="Tux";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,tux);}
else if(message=="Pedestrian";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,pedestrian);}
else if(message=="Kid";){goDialog(ZapEffectzTexture,effectzTextures);goEffectz(1,heyKid);}
else if(message=="STOP";){goEffectz(3,NULL_KEY);goDialog(ZapEffectzTexture,effectzTextures);}
else if(message=="< Back";){state effectzItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state moreEffectzTexturesState{
state_entry(){goDialog(ZapEffectzTexture,moreEffectzTextures);}
listen(integer channel,string name,key id,string message){
if(message=="SL";){goDialog(ZapEffectzTexture,moreEffectzTextures);goEffectz(1,SL);}
else if(message=="Smiley";){goDialog(ZapEffectzTexture,moreEffectzTextures);goEffectz(1,smiley);}
else if(message=="Star";){goDialog(ZapEffectzTexture,moreEffectzTextures);goEffectz(1,star);}
else if(message=="Vista";){goDialog(ZapEffectzTexture,moreEffectzTextures);goEffectz(1,vista);}
else if(message=="STOP";){goEffectz(3,NULL_KEY);goDialog(ZapEffectzTexture,moreEffectzTextures);}
else if(message=="< Back";){state effectzTexturesState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state breadEffectz{
state_entry(){goDialog(ZapEffectzTexture,effectzTextures);}
listen(integer channel,string name,key id,string message){
if(message=="More >";){state mbreadEffectz;}
else if(message=="Firefox";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,firefox);}
else if(message=="Apple";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,apple);}
else if(message=="Script";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,LSL);}
else if(message=="Heart";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,heart);}
else if(message=="Notepad";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,notepad);}
else if(message=="Scully";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,scully);}
else if(message=="Tux";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,tux);}
else if(message=="Pedestrian";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,pedestrian);}
else if(message=="Kid";){goDialog(ZapEffectzTexture,breadTextures);goEffectz(4,heyKid);}
else if(message=="STOP";){goEffectz(3,NULL_KEY);goDialog(ZapEffectzTexture,breadTextures);}
else if(message=="< Back";){state effectzItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state mbreadEffectz{
state_entry(){goDialog(ZapEffectzTexture,moreEffectzTextures);}
listen(integer channel,string name,key id,string message){
if(message=="SL";){goDialog(ZapEffectzTexture,mBreadTextures);goEffectz(4,SL);}
else if(message=="Smiley";){goDialog(ZapEffectzTexture,mBreadTextures);goEffectz(4,smiley);}
else if(message=="Star";){goDialog(ZapEffectzTexture,mBreadTextures);goEffectz(4,star);}
else if(message=="Vista";){goDialog(ZapEffectzTexture,mBreadTextures);goEffectz(4,vista);}
else if(message=="STOP";){goEffectz(3,NULL_KEY);goDialog(ZapEffectzTexture,mBreadTextures);}
else if(message=="< Back";){state breadEffectz;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state strapColorsState{
state_entry(){goDialog(zapStrap,itemColorsMenu);}
listen(integer channel,string name,key id,string message){
if(message=="Red";){strapColor(red);strapColor2(red);goDialog(zapStrap,itemColorsMenu);}
else if(message=="Green";){strapColor(green);strapColor2(green);goDialog(zapStrap,itemColorsMenu);}
else if(message=="Blue";){strapColor(blue);strapColor2(blue);goDialog(zapStrap,itemColorsMenu);}
else if(message=="Yellow";){strapColor(yellow);strapColor2(yellow);goDialog(zapStrap,itemColorsMenu);}
else if(message=="Purple";){strapColor(purple);strapColor2(purple);goDialog(zapStrap,itemColorsMenu);}
else if(message=="Orange";){strapColor(orange);strapColor2(orange);goDialog(zapStrap,itemColorsMenu);}
else if(message=="Pink";){strapColor(pink);strapColor2(pink);goDialog(zapStrap,itemColorsMenu);}
else if(message=="Black";){strapColor(black);strapColor2(black);goDialog(zapStrap,itemColorsMenu);}
else if(message=="White";){strapColor(white);strapColor2(white);goDialog(zapStrap,itemColorsMenu);}
else if(message=="< Back";){state colorItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state strapTextureColorsState{
state_entry(){goDialog(zapTexture,itemColorsMenu);}
listen(integer channel,string name,key id,string message){
if(message=="Red";){strapColorTexture(red);goDialog(zapTexture,itemColorsMenu);}
else if(message=="Green";){strapColorTexture(green);goDialog(zapTexture,itemColorsMenu);}
else if(message=="Blue";){strapColorTexture(blue);goDialog(zapTexture,itemColorsMenu);}
else if(message=="Yellow";){strapColorTexture(yellow);goDialog(zapTexture,itemColorsMenu);}
else if(message=="Purple";){strapColorTexture(purple);goDialog(zapTexture,itemColorsMenu);}
else if(message=="Orange";){strapColorTexture(orange);goDialog(zapTexture,itemColorsMenu);}
else if(message=="Pink";){strapColorTexture(pink);goDialog(zapTexture,itemColorsMenu);}
else if(message=="Black";){strapColorTexture(black);goDialog(zapTexture,itemColorsMenu);}
else if(message=="White";){strapColorTexture(white);goDialog(zapTexture,itemColorsMenu);}
else if(message=="< Back";){state colorItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state buttonColorsState{
state_entry(){goDialog(zapButtons,itemColorsMenu);}
listen(integer channel,string name,key id,string message){
if(message=="Red";){buttonsColor(red);goDialog(zapButtons,itemColorsMenu);}
else if(message=="Green";){buttonsColor(green);goDialog(zapButtons,itemColorsMenu);}
else if(message=="Blue";){buttonsColor(blue);goDialog(zapButtons,itemColorsMenu);}
else if(message=="Yellow";){buttonsColor(yellow);goDialog(zapButtons,itemColorsMenu);}
else if(message=="Purple";){buttonsColor(purple);goDialog(zapButtons,itemColorsMenu);}
else if(message=="Orange";){buttonsColor(orange);goDialog(zapButtons,itemColorsMenu);}
else if(message=="Pink";){buttonsColor(pink);goDialog(zapButtons,itemColorsMenu);}
else if(message=="Black";){buttonsColor(black);goDialog(zapButtons,itemColorsMenu);}
else if(message=="White";){buttonsColor(white);goDialog(zapButtons,itemColorsMenu);}
else if(message=="< Back";){state colorItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state bodyColorsState{
state_entry(){goDialog(zapBody,itemColorsMenu);}
listen(integer channel,string name,key id,string message){
if(message=="Red";){watchBodyColor(red);goDialog(zapBody,itemColorsMenu);}
else if(message=="Green";){watchBodyColor(green);goDialog(zapBody,itemColorsMenu);}
else if(message=="Blue";){watchBodyColor(blue);goDialog(zapBody,itemColorsMenu);}
else if(message=="Yellow";){watchBodyColor(yellow);goDialog(zapBody,itemColorsMenu);}
else if(message=="Purple";){watchBodyColor(purple);goDialog(zapBody,itemColorsMenu);}
else if(message=="Orange";){watchBodyColor(orange);goDialog(zapBody,itemColorsMenu);}
else if(message=="Pink";){watchBodyColor(pink);goDialog(zapBody,itemColorsMenu);}
else if(message=="Black";){watchBodyColor(black);goDialog(zapBody,itemColorsMenu);}
else if(message=="White";){watchBodyColor(white);goDialog(zapBody,itemColorsMenu);}
else if(message=="< Back";){state colorItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){state firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}
}

state buy{
state_entry(){
string sName=llKey2Name(llDetectedKey(0));
llOwnerSay(sName+" is buying a J-Shock";);
}
}
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
07-07-2007 16:51
apparently you expect someone to read tru a 4 page script and guess whatever it is your talking about

im not that person, nor i doubt anyone else is
ed44 Gupte
Explorer (Retired)
Join date: 7 Oct 2005
Posts: 638
07-08-2007 18:33
You really have not told us what the symptoms are.

With a program that size you have probably hit the compiler's limits. You will get syntax errors that do not make sense.

It's probably a good idea to break your program into multiple scripts and connect them with llMessageLinked using LINK_THIS.
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
07-08-2007 19:23
I tried compiling the script, and yeah, got the same error(s) you did.

I am betting it's the size of the script, 17,588 bytes by my count. You have 16K to work with once it is compiled down into stack and heap. So maybe you've blown it there. I'd recommend splitting the script into more than one, and communicating/coordinating between them via llMessageLinked.

But yeah, if this is indeed the issue, an error message that was a LITTLE more clear would be nice!
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
07-08-2007 19:41
I'm not up for trying to compile this, but a quick glance at the script suggests that it could be vastly simplified, probably obviating the need to break it into multiple communicating scripts. One big win would be to replace separate conditionals for every possible dialog response with a look-up in paired lists of dialog button names and their associated texture keys or color vectors.
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-09-2007 13:28
I agree with Qie, something like this for your states would be easier to work with/maintain:

list colorVectors=[red,green,blue,yellow,purple,orange,pink,black,white];
list colorNames=["red","green","blue","yellow","purple","orange","pink","black","white"];
list itemColorsMenu=["< Back"]+colorNames;

state strapColorsState{
state_entry()
{
goDialog(zapStrap,itemColorsMenu);
}//state_entry

listen(integer channel,string name,key id,string message)
{
integer index = llListFindList( colorNames, [message] );
if(index != -1)
{
integer colorVal = llList2integer(colorVectors,index);
strapColor(colorval);
strapColor2(colorVal);
}
else if(message=="< Back";)
{
state colorItemsState;
}
}//listen

touch_start(integer total_number)
{
if(llDetectedKey(0)==llGetOwner())
{
state firstDialog;
}
else
{
string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);
}
}//touch_start
}//state strapColorsState


or for a better estimate of script size:
From: someone

state strapColorsState{
state_entry(){goDialog(zapStrap,itemColorsMenu);}
listen(integer channel,string name,key id,string message){
if(message=="Red";){strapColor(red);strapColor2(red);goDialog(zapStr ap,itemColorsMenu);}
else if(message=="Green";){strapColor(green);strapColor2(green);goDialog(za pStrap,itemColorsMenu);}
else if(message=="Blue";){strapColor(blue);strapColor2(blue);goDialog(zapS trap,itemColorsMenu);}
else if(message=="Yellow";){strapColor(yellow);strapColor2(yellow);goDialog( zapStrap,itemColorsMenu);}
else if(message=="Purple";){strapColor(purple);strapColor2(purple);goDialog( zapStrap,itemColorsMenu);}
else if(message=="Orange";){strapColor(orange);strapColor2(orange);goDialog( zapStrap,itemColorsMenu);}
else if(message=="Pink";){strapColor(pink);strapColor2(pink);goDialog(zapS trap,itemColorsMenu);}
else if(message=="Black";){strapColor(black);strapColor2(black);goDialog(za pStrap,itemColorsMenu);}
else if(message=="White";){strapColor(white);strapColor2(white);goDialog(za pStrap,itemColorsMenu);}
else if(message=="< Back";){state colorItemsState;}
}
touch_start(integer total_number){if(llDetectedKey(0)==llGetOwner()){s tate firstDialog;}else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sNam e+" clicked your J-Shock.";);}}
}


becomes
From: someone

state strapColorsState{
state_entry(){goDialog(zapStrap,itemColorsMenu);}//state_entry
listen(integer channel,string name,key id,string message){
integer index = llListFindList( colorNames, [message] );
if(index != -1){integer colorVal = llList2integer(colorVectors,index);
strapColor(colorval);strapColor2(colorVal);}
else if(message=="< Back";){state colorItemsState;}}//listen
touch_start(integer total_number){
if(llDetectedKey(0)==llGetOwner()){state firstDialog;}
else{string sName=llKey2Name(llDetectedKey(0));llOwnerSay(sName+" clicked your J-Shock.";);}}//touch_start}//state strapColorsState