From 1e999da79d98d4027037abaefe6c246d9802a303 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 3 Dec 2023 06:27:31 -0700 Subject: [PATCH] Initial implementation of emotes --- README.md | 16 ++++- src/raw/dhb/Gag.lsl | 159 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 173 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff21185..6de0424 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,18 @@ Next Generation Core ======= -This project's initial aim is to create a set of replacement scripts for DHB. Any future targetting can be added as plugins. This project is, from the ground up, designed to be modular. You drop in the script(s) for the features your product supports, or that you want. \ No newline at end of file +This project's initial aim is to create a set of replacement scripts for DHB. Any future targetting can be added as plugins. This project is, from the ground up, designed to be modular. You drop in the script(s) for the features your product supports, or that you want. + +When this project enters a beta or release phase, the scripts will be available, pre-compiled on marketplace for a fee. The fee is designed to go to support the project. + + +License +=== + +This project is licensed under the GPL. As such, as ask if you make changes, fixes, or improvements, please send them upstream for consideration to be merged. + + +Marketplace +====== + +There will be precisely one closed source script bundled with the marketplace contents. That is the update script. It checks for updates and acquires them. \ No newline at end of file diff --git a/src/raw/dhb/Gag.lsl b/src/raw/dhb/Gag.lsl index 32bdd7d..4fa4ad8 100644 --- a/src/raw/dhb/Gag.lsl +++ b/src/raw/dhb/Gag.lsl @@ -53,13 +53,97 @@ integer g_iGagPrim; Main(key kID, integer iAuth) { - list lMenu = ["main..", Checkbox(g_iGagged, "Gag")]; + list lMenu = ["main..", Checkbox(g_iGagged, "Gag"), " ", Checkbox((g_iGagLevel==0), "No Garble"), Checkbox((g_iGagLevel==1), "Loose"), Checkbox((g_iGagLevel == 2), "Medium"), Checkbox((g_iGagLevel==3), "Tight")]; list lHelper = []; string sText = "Gag Menu"; Menu(kID, sText, lMenu, "menu~gag", SetDSMeta([iAuth]), lHelper); } + +string garble(string in) { + + string input = in; + + if(input == "." || input=="," || input == ":" || input == "?" || input ==";" || input == " " || input=="!" || input == ")" || input=="(" || input == "{" || input == "}" || input == "\\" || input == "/")input=input; + + if(input == "a" || input == "e" ) input="eh"; + + if((input == "i" || input == "y") && g_iGagLevel >1)input="eh"; + + if((input == "o" || input=="u") && g_iGagLevel > 1) input = "h"; + + if(input == "c" || input == "k" || input=="q") input="k"; + + if((input == "m" || input=="r") && g_iGagLevel > 1) input="w"; + + if(input == "s" && g_iGagLevel>1) input="sh"; + + if(input == "z")input="shh"; // or maybe silent.. + + if(input == "b" || input == "p" || input == "v") input="f"; + + if(input == "x")input = "ek"; + + + + + if(input=="shh" && g_iGagLevel==3)input=""; + + if(input == "ek" && g_iGagLevel == 3) input="eh"; + + return input; +} + +string garbleString(string input) +{ + integer i=0; + string out; + integer len = llStringLength(input); + for(i = 0;i 0 && g_iGagged) + { + // Update Listeners + llListenRemove(g_iChatHandle); + llListenRemove(g_iEmoteHandle); + g_iChatChannel = llRound(llFrand(0xFFFFF)); + g_iEmoteChannel = llRound(llFrand(0xFFFFF)); + + g_iChatHandle = llListen(g_iChatChannel, "", llGetOwner(), ""); + g_iEmoteHandle = llListen(g_iEmoteChannel, "", llGetOwner(), ""); + + llOwnerSay("@redirchat:" + (string)g_iChatChannel +"=add,rediremote:"+(string)g_iEmoteChannel +"=add"); + + } else { + llOwnerSay("@redirchat:" + (string)g_iChatChannel +"=rem,rediremote:"+(string)g_iEmoteChannel +"=rem"); + llOwnerSay("@clear=redirchat,clear=rediremote"); + llListenRemove(g_iChatHandle); + llListenRemove(g_iEmoteHandle); + } +} default { state_entry() @@ -84,6 +168,42 @@ default } } + listen(integer c,string n,key i,string m) + { + string oldName = llGetObjectName(); + llSetObjectName(llGetDisplayName(llGetOwner())); + if(c == g_iChatChannel) + { + llSay(0, garbleString(m)); + }else if(c == g_iEmoteChannel) + { + list lEmote = llParseStringKeepNulls(m,["\""],[]); + integer x = 0; + integer e = llGetListLength(lEmote); + + for(x=0;x