Jump to content

Poseball and doorbell scripts?


HellenaMaezono
 Share

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

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

Recommended Posts

Hi everybody! I was trying to fix a bed. It was at the beginning a full-perm free double bed and, since I needed to have a matching single bed, I provided to edit it. Being a single bed, I need the poses to be for only one person, but the bed obviously rezzes two balls, even if I use only the one destinated to a girl. What should I change into the poseball script to make the bed rez only the girl's poseball?

 

integer ch;
integer group;
integer hear;
integer i;
integer visible;
key avatar;

show() {
    llSetAlpha(1.0, ALL_SIDES);
    llSetScale(<0.2,0.2,0.2>);
    llSetText("", <1.0, 1.0, 1.0>, 1.0);
}
hide() {
    llSetScale(<0.01,0.01,0.01>);
    llSetAlpha(0.0, ALL_SIDES);
    llSetText("", <1.0, 1.0, 1.0>, 1.0); 
}

default {
    on_rez(integer channel) {
        //hide();
        llSitTarget(<0.0,0.0,0.1>,ZERO_ROTATION);
        llSetSitText("Sit Here");
        avatar = NULL_KEY;
        ch = channel;
        group = 0;
        llListenRemove(hear);
        hear = llListen(ch,"",NULL_KEY,"");
        llSetTimerEvent(120);
    }
    changed(integer change) {
        if (change != CHANGED_LINK) return;
        avatar = llAvatarOnSitTarget();
        if (group) {
            if (avatar != NULL_KEY && !llSameGroup(avatar)) {
                llUnSit(avatar);
                llWhisper(0,"no permission to use poseball");
                return;
            }
        }   
        llSay(ch+4,(string)avatar);     //requests perm, sets animation
        if (visible & avatar == NULL_KEY) show(); else hide();
    }
    listen(integer channel, string name, key object, string str) {
        i = llSubStringIndex(str,">");   
        if (i != -1) {
            llSetRot((rotation)llGetSubString(str,i+1,-1));
            llSetPos((vector)llGetSubString(str,0,i));
        } else if (str == "1") {    //PINK
            llSetColor(<0.835,0.345,0.482>,ALL_SIDES);      //soft pink
            //llSetColor(<1.0,0.0,1.0>,ALL_SIDES);            //hard pink
            if (avatar == NULL_KEY) show();
            visible = 1;
        } else if (str == "2") {    //BLUE
            llSetColor(<0.353,0.518,0.827>,ALL_SIDES);      //soft blue
            //llSetColor(<0.0,0.0,1.0>,ALL_SIDES);            //hard blue
            if (avatar == NULL_KEY) show();
            visible = 1;
        } else if (str == "0") {    //HIDE
            hide();
            visible = 0;
        } else if (str == "SHOW") { //SHOW
            if (avatar == NULL_KEY) show();
            visible = 1;
        } else if (str == "ADJUST") {
            llSetAlpha(0.2,ALL_SIDES);
            llSetText("Adjust",<1.0,1.0,1.0>,1.0);
            llSetScale(<0.1,0.1,5.0>);
        } else if (str == "SAVE") {
            llSay(ch+8,(string)llGetPos()+(string)llGetRot());
        } else if (str == "GROUP") {
            group = 1;
        } else if (str == "ALL") {
            group = 0;
        } else if (str == "DIE") {
            llDie();
        } else if (str == "LIVE") {
            llSetTimerEvent(120);
            llSay(ch+4,"ALIVE");    //msg to pose1/2 -> to menu
        }
    }
    timer() {                       //not heard "LIVE" from menu for a while: suicide
        llSay(ch+4,"DIE");          //msg to pose1/2 -> to menu
        llDie();
    }
}

 

Other thing: I've also edited a full-perm, freebie doorbell fitting it to what I needed. What I wanna do is to make it a pager (is that the right name for it?), something that sends a message to the house owners and tell them someone rang their bell. I'd like it to send the messages to me, my boyfriend and my best friend, since we all live in the same house. Which script can be good for this? Please, lemme know.

Thanks to anyone who will read this post and who will try to help me. Hugs :matte-motes-bashful-cute-2:

Link to comment
Share on other sites

As to the bed, the script looks to me like something out of  the ~ball object in an old MLP bed.   

What, therefore, I would suggest you do is obtain a free copy of MLPV2 (the updated version of MLP) and take a look at the MLPV tutorial in the wiki to see how to install the scripts and configure the notecards so the bed only rezzes the one ball. 

If you don't want to do all that, take a careful look at the instructions in one of the notecards the bed must contain -- you don't want to edit the scripts; it's the configuration settings in the notecards you have to change.

As to the pager, take a look at llInstantMessage

Link to comment
Share on other sites

As I look at the script, it never rezzes anything.  The poseballs are always there.  It's just that when you sit down, they are hidden.  That's what the hide() function does, and it's called from the changed event whenever you sit.  You ought to be able to just delete the poseball that you don't want.  Because this is a full-perm bed, there no risk in trying that on a copy.  I'll bet that it works.

Link to comment
Share on other sites

@Innula Zenovka: Thanks a lot for the first link! It has been very useful to me, I can't wait to set everything up! But, for the pager, I did not understand what to do. I'm totally new to scripting :matte-motes-frown:

It says:

  

key owner;
 
default
{
    on_rez(integer start_param)
    {
        owner=llGetOwner()// get the key of the objects owner.
    }
    touch_start(integer total_num)
    {       
        llInstantMessage(owner,llKey2Name(owner)+", " + (string)total_num +" Avatar(s) touched me!");
    }
}

 

But what should I change to make it send the message to all the three of us? Thanks a lot for your reply :matte-motes-big-grin:

@Rolig Loon: Thanks for replying! Being not a scripter, I thought that the bed used to rez the balls... anyways I already tried removing the other poseball. But it doesn't work...

Link to comment
Share on other sites

Try something like this:

integer max;list recipients =["my uuid","my friends's uuid","my other friend's uuud"];default{    state_entry()    {        max = llGetListLength(recipients);    }    touch_start(integer total_number)    {        string name = llGetDisplayName(llDetectedKey(0));       while(max--){// this actually reads the list from bottom to top, but that doesn't matter in this case //read each uuid in turn and send the message           llInstantMessage(llList2Key(recipients,max),name+" is at the door");        }    }}

 If you want to know your, and your friends', uuids, one way to do it is to put this in a prim and ask them to touch it:

default{      touch_start(integer total_number)    {      llOwnerSay((string)llDetectedKey(0));    }}

 That will make their uuid appear in local chat for you (assuming you own the prim, that is).

Because of the delay with llInstantMessage, you might want to get fancy and use the new function, llRegionSayTo, when you can, since that has no delay.   But it only works if the avatar is on the same sim (so it's good if you're at home, less so if you are somewhere else when you have a visitor).   So you would need to do something like

 

integer max;list recipients =["my uuid","my friends's uuid","my other friend's uuud"];default{    state_entry() {        max = llGetListLength(recipients);    }    touch_start(integer total_number){        string name = llGetDisplayName(llDetectedKey(0));       while(max--){           key uuid = llList2Key(recipients,max);// get each uuid on the list in turn, and test if they're on the sim or not           if(llGetAgentSize(uuid)!=ZERO_VECTOR){// llGetAgentSize returns ZERO_VECTOR if the uuid is that of an avatar who is not on the same sim, // so the uuid must belong to someone who is on the sim, so we can say           llRegionSayTo(uuid,0,name+" is at the door"); // no delay            }           else{ // it's returned ZERO_VECTOR, so uuid can't be on the same sim, so we have to use           llInstantMessage(llList2Key(recipients,max),name+" is at the door");//2 second delay             }        }    }}

 

Link to comment
Share on other sites


Innula Zenovka wrote:

Try something like this:
integer max;list recipients =["my uuid","my friends's uuid","my other friend's uuud"];default{    state_entry()    {        max = llGetListLength(recipients);    }    touch_start(integer total_number)    {        string name = llGetDisplayName(llDetectedKey(0));       while(max--){// this actually reads the list from bottom to top, but that doesn't matter in this case //read each uuid in turn and send the message           llInstantMessage(llList2Key(recipients,max),name+" is at the door");        }    }}

 

I tried it. At the beginning it worked:

 Working

But then, it started doing this, and I couldn't stop it! :matte-motes-confused:

Not working

 

If it wasn't doing this, it would have been awesome... but anyways isn't there any way to make it whisper "-Username- just rang your doorbell" without the "doorbell" word at the beginning?

Thanks a lot for your help :)

Link to comment
Share on other sites

Would that be because you didn't put those three UUIDs into the global list at the top of the script, replacing "my uuid", "my friend's uuid" and "my other friend's uuid"?

ETA:  To get rid of the object's name in chat, you'll have to do two things: (1) change the object's name and (2) suppress it.

Changing the name is just a matter of putting llSetObjectName (""); somewhere like in the state_entry event.  Suppressing it is done by putting /me at the start of the message you want to chat, just as you would if you were doing it in world.

Link to comment
Share on other sites

Hellena and I finally got this working in world.  Part of the problem was that I wasn't resetting the value of max after I'd finished looping through the list,  which is one reason it was throwing errors.   

Anyway, here's what we ended up with

 

integer max;list recipients =[// list of uuids goes here];string my_name;default{    state_entry()    {        my_name = llGetObjectName();    }    touch_start(integer total_number)    {          llSetObjectName("");        max = llGetListLength(recipients);        string name = llGetDisplayName(llDetectedKey(0));        llSetObjectName(name);       while(max--){// this actually reads the list from bottom to top, but that doesn't matter in this case //read each uuid in turn and send the message         key uuid = llList2Key(recipients,max);//        llInstantMessage(uuid,"/me is at the door");//2 second delay        }         llSetObjectName(my_name);    }}

 

Link to comment
Share on other sites

  • 3 weeks later...
You are about to reply to a thread that has been inactive for 4677 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...