Jump to content

Is it possible to script this to send IM to another avatar?


Suki Hirano
 Share

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

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

Recommended Posts

I was wondering if it's possible to script an object so that when someone (not the owner of the object) touches, it displays a message inworld for the person who touched it, and then sends a specified avatar an IM? For exampe I have this bell that's placed on the ground, when someone touches I want it to say "Jane Doe rang the bell" in world chat, and then John Smith will receive an IM saying "Jane Doe rang the bell". Thanks.

Link to comment
Share on other sites

key OtherPersonKey = "abcd";
string BellRinger = "";
default{
touch_start(integer total_num){
BellRinger = llKey2Name(llDetectedKey(0)) + "rang the bell.";
llSay(0, BellRinger);
llInstantMessage(OtherPersonKey,  BellRinger);
}
}

 

Edit the top line for the avatar key who will recieve the IM.

If you use this to spam some one you will be banned.

Link to comment
Share on other sites

...or maybe..

 

key person2IM = "<place the key of the IM recipient here>"default{	touch_start(integer total_number)	{		key whoTouchedKey = llDetectedKey(0);				if( whoTouchedKey != llGetOwner() )		{			string message = llKey2Name(whoTouchedKey) + " rang the bell";			llSay(0, message);			llInstantMessage(person2IM, message);		}	}}

 

Link to comment
Share on other sites

  • 3 years later...

Assuming it's the scripted object being dropped, yeah, you'd use the attach() event instead of touch_start(), although it's a little tricky to distinguish that the object is being dropped rather than being detached back into inventory; see that wiki entry for one suggestion.

Also, note that there's now llRegionSayTo() which the script could use for chatting at the object's owner without spamming everybody in the 20m radius of llSay() .

Link to comment
Share on other sites

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