Jump to content

Using RLV to replace local chat messages


grantjgrayman
 Share

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

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

Recommended Posts

Hello and thank you in advance,

I am moving my first steps into scripting LSL, trying to create my own RLV collar. I have seen and bought a few items that are able to replace or modify the text spoken by the wearer in local chat: when these items are active, the original message typed from me does not appear in local chat, what is show instead is an elaborated message produced by some script in the object I am wearing.

Trying to replicate this behaviour though i keep saying my original message in the in the local chat, followed by a second message, elaborated by my own script. I tried muting myself using RLV commands, but I can still see the three dots "..." appearing in local, meaning that I tried to talk.

How can I accoplish that kind of complete "silence" in local chat, and have only the elaborated message displayed?

Here are some pictures to better explain my issue.

Original text:

https://gyazo.com/6d8471712671602df0a3b0dd9402888c

Working RLV text modifier:

https://gyazo.com/a8904b425175c0dd0288ef6136917257

My attempts:

https://gyazo.com/f12ac7e1fc8c3f4624db231c4ada387b

Thank you for your time and any help you could give me,

Grant

Link to comment
Share on other sites

It's been a few months since I played with this sort of thing. iirc you need to rerout what you say to a different channel using rlv, then have the object pretend to be you by either having your display name as the objects name (yes display name not username, that's what worked best for me) or having the objects name blank and it saying your slurl along with whatever it changes your text to.

have a look at @rediremote:<channel_number>=<rem/add> and @redirchat:<channel_number>=<rem/add>

or, just buy aphasia https://marketplace.secondlife.com/p/Aphasia-Speech-Hearing-Control-Pet-Play/10622590

  • Like 1
Link to comment
Share on other sites

Ahh found my garbler I wrote a few months ago:

string gName;
integer gChannel = 36035;
integer gListenHandle;


list forbidden = ["I"," i "," me ","me."," my "," mine"," myself"];
list garbleList = 
["th", "f",
 "ch", "h",
 "ph", "f",
 "sh", "f",
 "wh", "oo",
 "ck", "hh",
 "d", "",
 "j", "",
 "k", "hh",
 "l", "oo", // was "w"
 "q", "kw",
 "s", "f",
 "t", "h",
 "v", "f",
 "w", "oo",
 "x", "ks",
 "z", "sh"
];

integer contains(string str, list needles)
{
    integer index = llGetListLength(needles);
    while(--index >= 0)
    {
        if(~llSubStringIndex(str,llList2String(needles,index)))
            return TRUE;
    }
    return FALSE;
}
integer startswith(string haystack, string needle) // http://wiki.secondlife.com/wiki/llSubStringIndex
{
    return llDeleteSubString(haystack, llStringLength(needle), 0x7FFFFFF0) == needle;
}
string strReplace(string str, string search, string replace) {
    return llDumpList2String(llParseStringKeepNulls((str = "") + str, [search], []), replace);
}
string garble(string str,list searchReplace)
{
    integer index_max = llGetListLength(searchReplace);
    integer index=-1;
    while(index < index_max)
    {
        str=strReplace(str,llList2String(searchReplace,++index),llList2String(searchReplace,++index));
    }
    return str;
}
string garbleEnstrung(string text,list searchReplace)
{
    list parsed = llParseString2List(text,[],["\""]);
    integer phrases = llGetListLength(parsed);
    integer index = 0;
    while(index<phrases)
    {
        if(index%4==2)
        {   parsed = llListReplaceList
                (parsed,[garble(llList2String(parsed,index),garbleList)],index,index);
            ++index;
        }
        else
            ++index;
    }
    return llDumpList2String(parsed,"");
}
default
{
    state_entry()
    {
        gListenHandle = llListen(gChannel,"",llGetOwner(),"");
        llSetLinkPrimitiveParamsFast(0,[PRIM_NAME,""]);
        gName = "secondlife:///app/agent/"+(string)llGetOwner()+"/inspect ";
        llOwnerSay("@redirchat:"+(string)gChannel+"=add");
        llOwnerSay("@rediremote:"+(string)gChannel+"=add");
        
    }

    listen(integer CH, string Name,key ID,string text)
    {
        if(startswith(text,"/me "))
        {

            llSay(0,"/me "+gName+garbleEnstrung(llDeleteSubString(text,0,3),garbleList));
        }
        else
        {   
            if(contains(text,forbidden))
                llSay(0,"/me "+gName+"is forbidden from using personal pronouns.");
            else
            {
                text = garble(text,garbleList);
                llSay(0,gName+text);
            }
        }
    }
    changed(integer mask)
    {
        llResetScript();
    }
    attach(key ID)
    {
        if(ID!=NULL_KEY)
        {   llSetLinkPrimitiveParamsFast(0,[PRIM_NAME,""]);
            llSay(0,"secondlife:///app/agent/"+(string)llGetOwner()+"/inspect"+
                " is under speech restriction.");
            llOwnerSay("@redirchat:"+(string)gChannel+"=add");
            llOwnerSay("@rediremote:"+(string)gChannel+"=add");
        }
    }
}

probably not the best implementation for a lot of those functions, but it gets the idea across at least.

  • Like 1
Link to comment
Share on other sites

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