Skip to content

Instantly share code, notes, and snippets.

@antonyfairport
Created February 10, 2020 22:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save antonyfairport/7a024e13ab6d71da1c723bd3cccc523d to your computer and use it in GitHub Desktop.
default
{
state_entry()
{
llOwnerSay( "Ready to test; touch me to redirect chat and emotes" );
}
touch_end( integer _ )
{
state Redirect;
}
}
state Redirect
{
state_entry()
{
llOwnerSay( "@redirchat:172342=add,rediremote:172343=add" );
llOwnerSay( "Chat is now redirected, touch me again to stop." );
llListen( 172342, "", "", "" );
llListen( 172343, "", "", "" );
}
listen( integer channel, string name, key id, string message )
{
if ( channel == 172342 )
{
llOwnerSay( "Chat redirected: " + message );
}
else if ( channel == 172343 )
{
llOwnerSay( "Emote redirected: " + message );
}
}
touch_end( integer _ )
{
state Free;
}
}
state Free
{
state_entry()
{
llOwnerSay( "@redirchat:172342=rem,rediremote:172343=rem" );
llOwnerSay( "Redirections removed. Touch again to put in place." );
}
touch_end( integer _ )
{
state Redirect;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment