User:Toy Wylie/RLV Documentation/redirchat

From Second Life Wiki
Jump to navigation Jump to search


@redirchat

Type

Exception

Implemented

Implemented since RLV version 1.16

Usage

@redirchat:<channel number>=<add/rem>

Purpose

When active (@redirchat:11223344=add), this restriction redirects whatever the user says on the public channel ("/0") to the private channel provided in the option field. If several redirections are issued, the chat message will be redirected to each channel. It does not apply to emotes, and will not trigger any animation (typing start, typing stop, nodding) when talking. This restriction does not superdede @sendchannel.

Notes

* As of RLV v1.22.1 / RLVa 1.1.0 @redirchat also truncates emotes on channel 0. It's not clear if this is a bug or a missing note in the API. An additional @emote=add works around this side-effect.

See Also

Example

<lsl>integer listenHandle;

integer redirect = FALSE;

default {

   touch_start(integer total_number)
   {
       if (llDetectedKey(0) != llGetOwner()) return;

       redirect = 1-redirect;

       if(redirect)
       {
           listenHandle = llListen(11223344, "", llGetOwner(), "");
           llOwnerSay("@redirchat:11223344=add");
           llSay(0, "Chat redirected to channel 11223344.");
       }
       else
       {
           llListenRemove(listenHandle);
           llOwnerSay("@redirchat:11223344=rem");
           llSay(0, "Chat back on public channel.");
       }
   }
   
   listen(integer channel, string name, key id, string message)
   {
       llSay(0, name + ": " + message);
   }

}

</lsl>