Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list g_learned;
- list g_punctuation=[".","?","!","'","\"",";","(",")",","];
- list g_lastSpoken;
- string censorWord(string word)
- {
- if(llListFindList(g_learned+g_punctuation, [llToLower(word)])!=-1) return word;
- else
- {
- integer num=llStringLength(word);
- string str;
- while(num--) str+="_";
- return str;
- }
- }
- integer RLV_ON;
- integer rlv_listenID;
- integer g_rlvCH=624634;
- checkRLV()
- {
- RLV_ON=0;
- rlv_listenID=llListen(g_rlvCH, "",llGetOwner(), "");
- llOwnerSay("@versionnum="+(string)g_rlvCH);
- llSetTimerEvent(30.0);
- }
- integer toggleBlock=1;
- default
- {
- state_entry()
- {
- llListen(0, "", "", "");
- checkRLV();
- }
- changed(integer change)
- {
- if(change & CHANGED_OWNER) llResetScript();
- }
- on_rez(integer rz)
- {
- checkRLV();
- }
- touch_start(integer num_detected)
- {
- if(llDetectedKey(0)==llGetOwner())
- {
- if(RLV_ON)
- {
- toggleBlock=!toggleBlock;
- if(toggleBlock)
- {
- llOwnerSay("@recvchat_sec=n");
- llOwnerSay("RLV restraints ON");
- }
- else
- {
- llOwnerSay("@recvchat_sec=y");
- llOwnerSay("RLV restraints OFF");
- }
- }
- }
- }
- attach(key id)
- {
- if(id==NULL_KEY) llOwnerSay("@recvchat_sec=y");
- }
- listen(integer channel, string name, key id, string message)
- {
- if(channel ==0)
- {
- if(id!=llGetOwner())
- {
- g_lastSpoken=llParseString2List(llToLower(message), [" "],g_punctuation);
- integer length=llGetListLength(g_lastSpoken);
- integer lp;
- string finalText;
- for (lp=0; lp<length; lp++)
- {
- finalText+=censorWord(llList2String(g_lastSpoken,lp))+" ";
- }
- llOwnerSay(finalText);
- }
- else
- {
- message=llToLower(message);
- if(llListFindList(g_lastSpoken, [message])!=-1)
- {
- if(llListFindList(g_learned, [message])==-1)
- {
- g_learned+=message;
- llOwnerSay("You just learned the word: "+message);
- }
- }
- }
- }
- else if (channel == g_rlvCH)
- {
- RLV_ON=1;
- if(llGetAttached()) llOwnerSay("@recvchat_sec=n");
- else llOwnerSay("@recvchat_sec=y");
- llListenRemove(rlv_listenID);
- }
- }
- timer()
- {
- llListenRemove(rlv_listenID);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement