Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripting a window tinter...

Avenge Niangao
Registered User
Join date: 25 Jul 2006
Posts: 9
08-30-2007 12:43
I am scripting a window tinter with a function for the owner to
set it from only the owner to group. I got that done
I'm also adding function like unlock/lock doors because my SL
brother makes houses and I'm making this for him.
I use the same else if (message == "";) for the group and owner
But for some reason after i added the main menu to go to tinting or unlocking...
I click tinting in owner mode it brings me to the percents i click one and nothing works.
Its EXACTLY the same as group except the stuff that make it so the group can use... The only thing in owner that isn't in group is the main menu in group it automatically brings you to percents...... Any ideas?


I've even tried changing channel. Putting on llSay(0, "test 1";); but it doesn't show up.
Avenge Niangao
Registered User
Join date: 25 Jul 2006
Posts: 9
08-30-2007 13:07
Bump...
Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
08-30-2007 16:48
In order for us to help you, it would be good that you post the code or atleast the part where you think the problem is.

p.s. I'll suggest that you don't bump. It's forbidden.
_____________________
state_entry()
{
llListen(SL Forums, "", NULL_KEY, "";);
}
Avenge Niangao
Registered User
Join date: 25 Jul 2006
Posts: 9
08-30-2007 17:03
Sorry i deleted it lol..

Ill just post what i have...



integer CHANNEL = 100;
integer ADMIN_CHANNEL = 100;
list MENU_MAIN = ["0% Tint","25% Tint","50% Tint","75% Tint","100% Tint"];
list ADMIN_MENU = ["Owner","Group"];
list LOCKING_MENU = ["Lock", "Unlock"];
list START_MENU = ["Tinting", "Locking"];

default
{
on_rez(integer param)
{
llResetScript();
llSetObjectName("Window Tinter";);
}

state_entry() {
llSetObjectDesc("Owner Mode";);
llListen(CHANNEL, "",llGetOwner(), "";);
llListen(ADMIN_CHANNEL,"",llGetOwner(),"";);

}
touch_start(integer total_number)
{

if(llDetectedKey(0) == llGetOwner())
{
llDialog(llDetectedKey(0), "Please Pick The Tint Of Window You Want.", START_MENU, CHANNEL);
}
else llInstantMessage(llDetectedKey(0),"You are not the owner.";);
}

listen(integer channel, string name, key id, string message)
{
if(message == "-admin";)
{
llDialog(id,"Please Select the Mode. \n Default: Owner \n Current Mode: "+llGetObjectDesc(),ADMIN_MENU,ADMIN_CHANNEL);
}
if (llListFindList(ADMIN_MENU, [message]) != -1)
{

if (message == "Group";)
state group;

if (message == "Owner";)
llInstantMessage(id,"This mode is already active! Please choose another.";);


}
if (llListFindList(START_MENU, [message]) != -1)
{

if (message == "Tinting";)
{
llDialog(id, "Please pick what you would like to do.", MENU_MAIN, CHANNEL);
{
if (llListFindList(MENU_MAIN, [message]) != -1)
{

if (message == "0% Tint";)
llShout(100, "test 1";);

else if (message == "25% Tint";)
llShout(100, "test 2";);
else if (message == "50% Tint";)
llShout(100, "test 3";);
else if (message == "75% Tint";)
llShout(100, "test 4";);
else if (message == "100% Tint";)
llShout(100, "test 5";);
}
}
}
}
}
}
state group
{
state_entry() {
llSetObjectDesc("Group Mode";);
llListen(CHANNEL, "","", "";);
llListen(ADMIN_CHANNEL,"",llGetOwner(),"";);

}
touch_start(integer total_number)
{
if(llDetectedGroup(0) == TRUE)
{
llDialog(llDetectedKey(0), "Please Pick The Tint Of Window You Want.", MENU_MAIN, CHANNEL);
}
else llInstantMessage(llDetectedKey(0),"You are not in the group.";);
}

listen(integer channel, string name, key id, string message)
{
if(message == "-admin";)
{
llDialog(id,"Please Select the Mode. \n Default: Owner \n Current Mode: "+llGetObjectDesc(),ADMIN_MENU,ADMIN_CHANNEL);
}
if (llListFindList(ADMIN_MENU, [message]) != -1)
{

if (message == "Group";)
llInstantMessage(id,"This mode is already active! Please choose another.";);

if (message == "Owner";)
state default;

}
if (llListFindList(MENU_MAIN, [message]) != -1)
{

if (message == "0% Tint";)
llShout(100, "test 1";);

else if (message == "25% Tint";)
llShout(100, "test 2";);
else if (message == "50% Tint";)
llShout(100, "test 3";);
else if (message == "75% Tint";)
llShout(100, "test 4";);
else if (message == "100% Tint";)
llShout(100, "test 5";);
}
}
}




I'm kind of learning scripting so i thought this would be a good test for me...
Wasnt fixed =[
Avenge Niangao
Registered User
Join date: 25 Jul 2006
Posts: 9
08-30-2007 17:22
Fixed..
Thanks for trying to help.
Darko Lednev
Registered User
Join date: 20 Aug 2007
Posts: 31
08-30-2007 17:59
1. on_rez place after state_entry
2. Why two listen commands on the same channel. One is enough.
3. Not good to use fixed channel (My opinion). Use random generator.

This doesn't solve the problem thou but from what I can see (without testing) there is no execution of Locking message from START_MENU.
_____________________
state_entry()
{
llListen(SL Forums, "", NULL_KEY, "";);
}
Avenge Niangao
Registered User
Join date: 25 Jul 2006
Posts: 9
08-30-2007 18:31
Fixed thanks to darko