Jump to content

Syntax Error in Texture Script for Timer()


DahliaReine
 Share

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

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

Recommended Posts

Hi all, 

I'm very new to scripts and I'm trying to use a script that worksk on other grids however is giving me an error when trying to use here. Basically, the script when touched will call a menu for Upper and Lower that then gives submenus that contain inventory textures.The error is found at the beginning of timer() I'm hoping someone can help me sort it. Thanks in advance.

This is the script - 

// by Nitewind Armistice

// License GNU/BSD
// Feel free to use and modify
// Keep the authors/ modifiers references included
// NOT FOR SALE!

list main_menu = ["Upper", "Lower"]; // Main menu
list Pants_menu = ["Foot", "Full Body", "None", "Panties", "Shorts", "Thighs", "Toes"]; // Sub-Menu for Lower
list Shirt_menu = ["Long Sleeve", "TShirt", "None"]; // Sub-Menu for Upper
integer listen_channel = -123456; // Channel that you script will listen on make sure it is not a public channel and
// set the same in the other scripts that you are using with the hud
integer handle;

default
{
on_rez(integer start_param)
{
// rests the script when rezzed
llResetScript();
}

changed(integer change)
{
// reset script when the owner or the inventory changed
if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
llResetScript();
}
state_entry()
{
handle = llListen(listen_channel,"",llGetOwner(),""); // only listens for the owner of the item that this
// script is in
llListenControl(handle,FALSE);
}

touch_start(integer total_number)
{
llListenControl(handle,TRUE); // open listen handler to listen for any of the buttons that are touched
llSetTimerEvent(30.0); // set that time for the listen handler is open to be used it is done in seconds
llDialog(llDetectedKey(0),"Try a selection...", main_menu, listen_channel);
}

listen(integer channel, string name, key id, string message)
{
if (message == "Lower") // if the Pant button is pressed it will goto the sub-menu pants
{
llDialog(id,message + " Dialog", Pants_menu, listen_channel);
}

if (message == "Upper") // if the Pant button is pressed it will goto the sub-menu shirt
{
llDialog(id,message + " Dialog", Shirt_menu, listen_channel);
}
if (message == "Back") // this is listneing for the button to be pushed it will go back to the main menu
{
llDialog(id,message + " Dialog", main_menu, listen_channel);
}
}
}
timer()
}
llSetTimerEvent(0.0); // sets timer to 0.0 second
llOwnerSay("You waited too long to pick, resetting menu."); // message owner this message when 30 seconds is up
llListenControl(handle,FALSE); // shuts off listening handler where they will have to touch the hud again to // get the menu
} // End Script

 

Link to comment
Share on other sites

It would be much easier to spot a common error like this if you were careful to indent your script properly. If you do that, you'll see that you have one too many close brackets } in your listen event. All brackets have to be matched.

  • Like 1
Link to comment
Share on other sites

// by Nitewind Armistice

// License GNU/BSD

// Feel free to use and modify

// Keep the authors/ modifiers references included

// NOT FOR SALE!

list main_menu = ["Upper", "Lower"]; // Main menu

list Pants_menu = ["Foot", "Full Body", "None", "Panties", "Shorts", "Thighs", "Toes"]; // Sub-Menu for Lower

list Shirt_menu = ["Long Sleeve", "TShirt", "None"]; // Sub-Menu for Upper

integer listen_channel = -123456; // Channel that you script will listen on make sure it is not a public channel and

// set the same in the other scripts that you are using with the hud

integer handle;

 

default

{

on_rez(integer start_param)

{

// rests the script when rezzed

llResetScript();

}

 

changed(integer change)

{

// reset script when the owner or the inventory changed

if (change & (CHANGED_OWNER | CHANGED_INVENTORY))

llResetScript();

}

state_entry()

{

handle = llListen(listen_channel,"",llGetOwner(),""); // only listens for the owner of the item that this

// script is in

llListenControl(handle,FALSE);

}

 

touch_start(integer total_number)

{

llListenControl(handle,TRUE); // open listen handler to listen for any of the buttons that are touched

llSetTimerEvent(30.0); // set that time for the listen handler is open to be used it is done in seconds

llDialog(llDetectedKey(0),"Try a selection...", main_menu, listen_channel);

}

 

listen(integer channel, string name, key id, string message)

{

if (message == "Lower") // if the Pant button is pressed it will goto the sub-menu pants

{

llDialog(id,message + " Dialog", Pants_menu, listen_channel);

}

 

if (message == "Upper") // if the Pant button is pressed it will goto the sub-menu shirt

{

llDialog(id,message + " Dialog", Shirt_menu, listen_channel);

}

if (message == "Back") // this is listneing for the button to be pushed it will go back to the main menu

{

llDialog(id,message + " Dialog", main_menu, listen_channel);

}

}

 

timer()

{

llSetTimerEvent(0.0); // sets timer to 0.0 second

llOwnerSay("You waited too long to pick, resetting menu."); // message owner this message when 30 seconds is up

llListenControl(handle,FALSE); // shuts off listening handler where they will have to touch the hud again to // get the menu

}

 

} // End Script

  • Like 1
Link to comment
Share on other sites

Thank you both so much. The script now saves with no errors, but it doesn't give me the pop up menu as it did before. Any ideas? The master prim is set to touch. The slave prim contains 2 scripts. 1 for upper and the other for lower which saved fine. Thanks again.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3233 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...