Jump to content

Well somehow i have this wrong Help Please


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

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

Recommended Posts

Well somehow i bet i have some brackets missing or not in the right place on this script.

I get error..

string dialogInfo = "\nPlease make a choice.";
key ToucherID;
key ToucherOwner;
integer dialogChannel;
integer listenHandle;

default
{state_entry()

{dialogChannel = -200 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );}

touch_start(integer num_detected)

{ToucherID = llDetectedKey(0);ToucherOwner = llGetOwner();if (ToucherID == ToucherOwner)
{llListenRemove(listenHandle);listenHandle = llListen(dialogChannel, "", ToucherID, "");
llDialog(ToucherID, dialogInfo, dialogChannel);llSetTimerEvent(60.0);}}

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

{if (message == "-"){}

llListenRemove(listenHandle);
//  stop timer since the menu was clicked

llSetTimerEvent(0);
if (message == "Purple")
{llRegionSay(-200,"Purple");}

else

{llRegionSay(-200,"");}}

timer()

{llSetTimerEvent(0); llListenRemove(listenHandle);llRegionSay(-200, "Sorry. You snooze you lose.");}}

 

Your Help would be great if someone sees my error.

Thank You321879325_error2.jpg.c8a3f85bf5869bb2d5d553ef29453294.jpg

Link to post
Share on other sites

You will find scripting to be a lot easier if you pay very close attention to formatting  code so that it is readable.  That includes indenting properly and putting your curly brackets consistently in predictable places, like this:

string dialogInfo = "\nPlease make a choice.";
key ToucherID;
key ToucherOwner;
integer dialogChannel;
integer listenHandle;

default
{
    state_entry()
    {
        dialogChannel = -200 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );
    }

    touch_start(integer num_detected)
    {
        ToucherID = llDetectedKey(0);
        ToucherOwner = llGetOwner();
        if (ToucherID == ToucherOwner)
        {
            llListenRemove(listenHandle);
            listenHandle = llListen(dialogChannel, "", ToucherID, "");
            llDialog(ToucherID, dialogInfo, dialogChannel);		// <<<  Here is your mistake
            llSetTimerEvent(60.0);
        }
    }

    listen(integer channel, string name, key id, string message)
    {
        if (message == "-")
        {
			//Note that this if test doesn't do anything right now.
        }
        llListenRemove(listenHandle);    //  stop timer since the menu was clicked
        llSetTimerEvent(0);
        if (message == "Purple")
        {
            llRegionSay(-200,"Purple");
        }
        else
        {
            llRegionSay(-200,"");
        }
    }

    timer()

    {
        llSetTimerEvent(0);
        llListenRemove(listenHandle);
        llRegionSay(-200, "Sorry. You snooze you lose.");
    }
}

 As you can see, you do have all the proper number of matched brackets.  The problem is your llDialog statement.  You forgot to tell it what list to use for the button labels.

  • Like 1
Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 480 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...