From 791f4081c01eed91a1b1770bc8cc8b52e6f7aad0 Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Sun, 8 Feb 2026 23:31:08 +0000 Subject: [PATCH 1/9] Reverb Vibe Init --- eventfunctions/toys/vibe_reverb.js | 28 ++++++++++++++++++++++++++++ toys/Vibrator/vibe_reverb.js | 25 +++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 eventfunctions/toys/vibe_reverb.js create mode 100644 toys/Vibrator/vibe_reverb.js diff --git a/eventfunctions/toys/vibe_reverb.js b/eventfunctions/toys/vibe_reverb.js new file mode 100644 index 00000000..4ac7c2e1 --- /dev/null +++ b/eventfunctions/toys/vibe_reverb.js @@ -0,0 +1,28 @@ +const { messageSendChannel } = require("../../functions/messagefunctions"); +const { setUserVar, getUserVar } = require("../../functions/usercontext"); + +function msgfunction(userid, data) { + + // Catch Message, Update End Time and Increment Vibe Intensity + setUserVar(userid, "soundVibeEndTime", Date.now() + 180000); + setUserVar(userid, "soundVibeDecayTime", Date.now() + 30000); + setUserVar(userid, "soundVibeIntensity", Math.min(getUserVar(userid, "soundVibeIntensity") + 1, 20)); + return; +} + +async function functiontick(userID) { + if (getUserVar(userID, "soundVibeEndTime") < Date.now()) { + console.log(`${userID}'s Sound Vibe has stopped`) + setUserVar(userID, "soundVibeEndTime", undefined) + } + + // Decay Intensity until 0 + if (getUserVar(userID, "soundVibeDecayTime") < Date.now() && getUserVar(userID, "soundVibeDecayTime") != null) + { + setUserVar(userID, "soundVibeIntensity", Math.max(getUserVar(userID, "soundVibeIntensity") - 1, 0)); + setUserVar(userID, "soundVibeDecayTime", Date.now() + 30000); + } +} + +exports.functiontick = functiontick; +exports.msgfunction = msgfunction; \ No newline at end of file diff --git a/toys/Vibrator/vibe_reverb.js b/toys/Vibrator/vibe_reverb.js new file mode 100644 index 00000000..cdf367bf --- /dev/null +++ b/toys/Vibrator/vibe_reverb.js @@ -0,0 +1,25 @@ +const { getUserVar, setUserVar } = require("../../functions/usercontext") + +// This vibrator will only function if getUserVar(userID, "soundVibeEndTime") has any value +exports.vibescale = (data) => { + console.log(`${data.userID}`) + return Math.max(0, Math.min(getUserVar(data.userID, "soundVibeIntensity")/10, 2)); +} // Ranging between 0 and 2 + +exports.calcVibeEffect = (data) => { + return (getUserVar(data.userID, "soundVibeEndTime") ? data.intensity * this.vibescale() : 0) +} + +exports.onUnequip = (data) => { + setUserVar(data.userID, "soundVibeEndTime", undefined); + setUserVar(data.userID, "soundVibeDecayTime", undefined); + setUserVar(data.userID, "soundVibeIntensity", 0); +} + +exports.onEquip = (data) => { + setUserVar(data.userID, "soundVibeEndTime", undefined); + setUserVar(data.userID, "soundVibeDecayTime", undefined); + setUserVar(data.userID, "soundVibeIntensity", 0); +} + +exports.toyname = "Reverb Vibe" \ No newline at end of file From 49819ff16bd6c5c7234c4c43346cc633d4d1b861 Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Mon, 9 Feb 2026 01:06:05 +0000 Subject: [PATCH 2/9] Standardised the Function Calls in Default Toy --- toys/defaulttoy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/defaulttoy.js b/toys/defaulttoy.js index d11ef9a7..92e75b4e 100644 --- a/toys/defaulttoy.js +++ b/toys/defaulttoy.js @@ -43,7 +43,7 @@ function Toy() { // Calculation for effective arousal change // Note, this should be used for checks more focused around the vibe - it will be // further multiplied by the chastity's checks for this, if applicable. - this.calcVibeEffect = function (data) { return 0 } + this.calcVibeEffect = (data) => { return 0 } // Name for the toy this.toyname = "Default Toy" From 271e9ea105f84ac11cc89f2327cff21edf9f3e3e Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Mon, 9 Feb 2026 01:08:57 +0000 Subject: [PATCH 3/9] Initial Reverb Vibe Version. Constants Defined for each value. Implements reverbEndTime, reverbDecayTime, and reverbVibeIntensity as UserVars. Vibe will run for 3 minutes, incremented by 15s for every message during the time period. reverbVibeIntensity will increment by 1 for every message sent and decrement by 1 every 30s, within the range of 0 and 20. vibescaling scales based on reverbVibeIntensity/10 --- eventfunctions/toys/vibe_reverb.js | 38 ++++++++++++++++++++++-------- toys/Vibrator/vibe_reverb.js | 22 +++++++++-------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/eventfunctions/toys/vibe_reverb.js b/eventfunctions/toys/vibe_reverb.js index 4ac7c2e1..ff1d65e2 100644 --- a/eventfunctions/toys/vibe_reverb.js +++ b/eventfunctions/toys/vibe_reverb.js @@ -1,26 +1,44 @@ const { messageSendChannel } = require("../../functions/messagefunctions"); const { setUserVar, getUserVar } = require("../../functions/usercontext"); +const initial_timespan = 180000 +const timespan_inc = 15000 +const decay_period = 30000 + function msgfunction(userid, data) { // Catch Message, Update End Time and Increment Vibe Intensity - setUserVar(userid, "soundVibeEndTime", Date.now() + 180000); - setUserVar(userid, "soundVibeDecayTime", Date.now() + 30000); - setUserVar(userid, "soundVibeIntensity", Math.min(getUserVar(userid, "soundVibeIntensity") + 1, 20)); + if(getUserVar(userid, "reverbEndTime") == undefined) { + // Set initial 3 minute timer + setUserVar(userid, "reverbEndTime", Date.now() + initial_timespan); + } else { + // Increment by 15s per Message + setUserVar(userid, "reverbEndTime", getUserVar(userid, "reverbEndTime") + timespan_inc); + } + + // Declare Initial Decay Time + if(getUserVar(userid, "reverbDecayTime") == undefined) { + setUserVar(userid, "reverbDecayTime", Date.now() + decay_period); + } + + // Increment Intensity Modifier + setUserVar(userid, "reverbVibeIntensity", Math.min(getUserVar(userid, "reverbVibeIntensity") + 1, 20)); return; } async function functiontick(userID) { - if (getUserVar(userID, "soundVibeEndTime") < Date.now()) { - console.log(`${userID}'s Sound Vibe has stopped`) - setUserVar(userID, "soundVibeEndTime", undefined) + // Clear Values When Vibe Stops + if (getUserVar(userID, "reverbEndTime") < Date.now() && getUserVar(userID, "reverbVibeIntensity") == 0) { + console.log(`${userID}'s Reverb Vibe has stopped`) + setUserVar(userID, "reverbEndTime", undefined) + setUserVar(userID, "reverbDecayTime", undefined) } - // Decay Intensity until 0 - if (getUserVar(userID, "soundVibeDecayTime") < Date.now() && getUserVar(userID, "soundVibeDecayTime") != null) + // Decay Intensity every Decay Period until 0 + if (getUserVar(userID, "reverbDecayTime") < Date.now() && getUserVar(userID, "reverbDecayTime") != undefined) { - setUserVar(userID, "soundVibeIntensity", Math.max(getUserVar(userID, "soundVibeIntensity") - 1, 0)); - setUserVar(userID, "soundVibeDecayTime", Date.now() + 30000); + setUserVar(userID, "reverbVibeIntensity", Math.max(getUserVar(userID, "reverbVibeIntensity") - 1, 0)); + setUserVar(userID, "reverbDecayTime", Date.now() + decay_period); } } diff --git a/toys/Vibrator/vibe_reverb.js b/toys/Vibrator/vibe_reverb.js index cdf367bf..b8bfe810 100644 --- a/toys/Vibrator/vibe_reverb.js +++ b/toys/Vibrator/vibe_reverb.js @@ -1,25 +1,27 @@ const { getUserVar, setUserVar } = require("../../functions/usercontext") -// This vibrator will only function if getUserVar(userID, "soundVibeEndTime") has any value +// This vibrator will only function if getUserVar(userID, "reverbEndTime") has any value exports.vibescale = (data) => { - console.log(`${data.userID}`) - return Math.max(0, Math.min(getUserVar(data.userID, "soundVibeIntensity")/10, 2)); + //console.log(`${data.userID}`) + //console.log(`${getUserVar(data.userID, "reverbVibeIntensity")/10}`); + return Math.max(0, Math.min(getUserVar(data.userID, "reverbVibeIntensity")/10, 2)); } // Ranging between 0 and 2 exports.calcVibeEffect = (data) => { - return (getUserVar(data.userID, "soundVibeEndTime") ? data.intensity * this.vibescale() : 0) + //console.log(`${data.userID}`) + return (getUserVar(data.userID, "reverbEndTime") ? data.intensity * this.vibescale(data) : 0) } exports.onUnequip = (data) => { - setUserVar(data.userID, "soundVibeEndTime", undefined); - setUserVar(data.userID, "soundVibeDecayTime", undefined); - setUserVar(data.userID, "soundVibeIntensity", 0); + setUserVar(data.userID, "reverbEndTime", undefined); + setUserVar(data.userID, "reverbDecayTime", undefined); + setUserVar(data.userID, "reverbVibeIntensity", 0); } exports.onEquip = (data) => { - setUserVar(data.userID, "soundVibeEndTime", undefined); - setUserVar(data.userID, "soundVibeDecayTime", undefined); - setUserVar(data.userID, "soundVibeIntensity", 0); + setUserVar(data.userID, "reverbEndTime", undefined); + setUserVar(data.userID, "reverbDecayTime", undefined); + setUserVar(data.userID, "reverbVibeIntensity", 0); } exports.toyname = "Reverb Vibe" \ No newline at end of file From 8f263310ea6293f12c8ce982a6064cdd2d4ce15a Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Mon, 9 Feb 2026 03:41:39 +0000 Subject: [PATCH 4/9] Initial Regex checks --- eventfunctions/toys/vibe_reverb.js | 54 +++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/eventfunctions/toys/vibe_reverb.js b/eventfunctions/toys/vibe_reverb.js index ff1d65e2..dafacb46 100644 --- a/eventfunctions/toys/vibe_reverb.js +++ b/eventfunctions/toys/vibe_reverb.js @@ -7,7 +7,10 @@ const decay_period = 30000 function msgfunction(userid, data) { - // Catch Message, Update End Time and Increment Vibe Intensity + // Catch Message, and Check for OOC, Whispers, or Shouting + intensity = volumetest(data.msgcontent) + + //Update End Time and Increment Vibe Intensity if(getUserVar(userid, "reverbEndTime") == undefined) { // Set initial 3 minute timer setUserVar(userid, "reverbEndTime", Date.now() + initial_timespan); @@ -42,5 +45,54 @@ async function functiontick(userID) { } } +function volumetest(message) { + // Split into lines + + // Discard OOC Lines + let OOC = new RegExp(/^[*][^*].*[^*][*]$/, "g"); + + if(message.match(OOC)) + { + console.log(`OOC: ${message}`); + return 0 + } + + // Check for Shout in remaining message chunks + //let loud = new RegExp("**", "g"); + if(message.match(/(\b[A-Z]['A-Z]+|\b[A-Z]\b)/g)) + { + console.log("SHOUT DETECTED"); + return 4 + } + + // Check for Loudness across all lines. Update Intensity if greater, and default to 0 in the case of no text + let intensity = 0; + + /*/ + + msgLines.forEach(line => { + switch(line) { + //**ALLCAPS** + case(line.match(/(\b[A-Z]['A-Z]+|\b[A-Z]\b)/g)): + return 4; + //**Message** OR ALLCAPS + case((line.match(loud) || []).length > 2): + if(intensity < 2) + intensity = 2; + //-# Message + case(line.startsWith("-#")): + if(intensity < 0.5) + intensity = 0.5; + //Regular Text + default: + if(intensity < 1) + intensity = 1; + } + }); + //*/ + + return intensity; +} + exports.functiontick = functiontick; exports.msgfunction = msgfunction; \ No newline at end of file From 98ad3d4fc653a8c78a52204ae74f5b773da00299 Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Tue, 10 Feb 2026 01:54:16 +0000 Subject: [PATCH 5/9] Finalised message filtering and checks on the contents of each line. Now alters the scaling based on how loud the person is being, both in how slowly it begins to decay again, and in how much the vibrations ramp up. --- eventfunctions/toys/vibe_reverb.js | 119 ++++++++++++++++------------- 1 file changed, 68 insertions(+), 51 deletions(-) diff --git a/eventfunctions/toys/vibe_reverb.js b/eventfunctions/toys/vibe_reverb.js index dafacb46..593bfba0 100644 --- a/eventfunctions/toys/vibe_reverb.js +++ b/eventfunctions/toys/vibe_reverb.js @@ -5,93 +5,110 @@ const initial_timespan = 180000 const timespan_inc = 15000 const decay_period = 30000 +const newline = new RegExp(/[^\r\n]+/g) +const OOC = new RegExp(/^[*][^*].*[^*][*]$/) +const LOUD = new RegExp(/(\b[A-Z]['A-Z]+|\b[A-Z]\b)/) +const BOLD = new RegExp(/([\*][\*])/) + function msgfunction(userid, data) { // Catch Message, and Check for OOC, Whispers, or Shouting intensity = volumetest(data.msgcontent) + //console.log(intensity); //Update End Time and Increment Vibe Intensity if(getUserVar(userid, "reverbEndTime") == undefined) { // Set initial 3 minute timer setUserVar(userid, "reverbEndTime", Date.now() + initial_timespan); } else { - // Increment by 15s per Message - setUserVar(userid, "reverbEndTime", getUserVar(userid, "reverbEndTime") + timespan_inc); + // Increment reverbEndTime by 15s x intensity per Message + setUserVar(userid, "reverbEndTime", getUserVar(userid, "reverbEndTime") + (timespan_inc * intensity)); } - // Declare Initial Decay Time + // Declare Initial reverbDecayTime if(getUserVar(userid, "reverbDecayTime") == undefined) { - setUserVar(userid, "reverbDecayTime", Date.now() + decay_period); + setUserVar(userid, "reverbDecayTime", Date.now() + (decay_period * intensity)); + } + else + { + // Override Next Decay time with a new value based on the intensity if it is longer than the current delay + setUserVar(userid, "reverbDecayTime", Math.max(Date.now() + (decay_period * intensity), getUserVar(userid, "reverbDecayTime"))); } - // Increment Intensity Modifier - setUserVar(userid, "reverbVibeIntensity", Math.min(getUserVar(userid, "reverbVibeIntensity") + 1, 20)); + // Increment reverbVibeIntensity based on intensity of message text + setUserVar(userid, "reverbVibeIntensity", Math.min(getUserVar(userid, "reverbVibeIntensity") + (1 * intensity), 20)); return; } async function functiontick(userID) { - // Clear Values When Vibe Stops - if (getUserVar(userID, "reverbEndTime") < Date.now() && getUserVar(userID, "reverbVibeIntensity") == 0) { - console.log(`${userID}'s Reverb Vibe has stopped`) - setUserVar(userID, "reverbEndTime", undefined) - setUserVar(userID, "reverbDecayTime", undefined) - } - // Decay Intensity every Decay Period until 0 if (getUserVar(userID, "reverbDecayTime") < Date.now() && getUserVar(userID, "reverbDecayTime") != undefined) { setUserVar(userID, "reverbVibeIntensity", Math.max(getUserVar(userID, "reverbVibeIntensity") - 1, 0)); setUserVar(userID, "reverbDecayTime", Date.now() + decay_period); } + + // Clear Values When Vibe Stops + if (getUserVar(userID, "reverbEndTime") < Date.now() && getUserVar(userID, "reverbVibeIntensity") == 0) { + console.log(`${userID}'s Reverb Vibe has stopped`) + setUserVar(userID, "reverbEndTime", undefined) + setUserVar(userID, "reverbDecayTime", undefined) + } } function volumetest(message) { // Split into lines + arrayOfLines = message.match(newline); + console.log(`ARRAY OF LINES: ${arrayOfLines}\n`); + intensityMod = 0; // Discard OOC Lines - let OOC = new RegExp(/^[*][^*].*[^*][*]$/, "g"); - - if(message.match(OOC)) - { - console.log(`OOC: ${message}`); - return 0 + arrayOfLines.forEach((line) => { + + // Check for Whispers + let Whisper = false; + if(line.startsWith("-#")) + { + Whisper = true; + line = line.replace("-# ", ""); } - // Check for Shout in remaining message chunks - //let loud = new RegExp("**", "g"); - if(message.match(/(\b[A-Z]['A-Z]+|\b[A-Z]\b)/g)) + // Ignore OOC Lines + if(OOC.test(line)) { - console.log("SHOUT DETECTED"); - return 4 - } - - // Check for Loudness across all lines. Update Intensity if greater, and default to 0 in the case of no text - let intensity = 0; - - /*/ - - msgLines.forEach(line => { - switch(line) { - //**ALLCAPS** - case(line.match(/(\b[A-Z]['A-Z]+|\b[A-Z]\b)/g)): - return 4; - //**Message** OR ALLCAPS - case((line.match(loud) || []).length > 2): - if(intensity < 2) - intensity = 2; - //-# Message - case(line.startsWith("-#")): - if(intensity < 0.5) - intensity = 0.5; - //Regular Text - default: - if(intensity < 1) - intensity = 1; + //console.log(`OOC: ${line} : ${Whisper}`); + } + else if(!Whisper && LOUD.test(line) && (line.match(BOLD) || []).length >= 2) + { + //console.log(`BRIAN: ${line} : ${Whisper}`); + return intensityMod = 4; + } + else if(!Whisper && LOUD.test(line)){ + if(intensityMod < 3) intensityMod = 3; + //console.log(`LOUD: ${line} : ${Whisper}`); + } + else if(!Whisper && (line.match(BOLD) || []).length >= 2) + { + if(intensityMod < 2) intensityMod = 2; + //console.log(`BOLD : ${line} : ${Whisper}`); + } + else if(Whisper && (line.match(BOLD) || []).length >= 2) + { + if(intensityMod < 0.75) intensityMod = 0.75; + //console.log(`BOLD Whisper: ${line} : ${Whisper}`); + } + else if(Whisper) + { + if(intensityMod < 0.5) intensityMod = 0.5; + //console.log(`Whisper: ${line} : ${Whisper}`); + } + else + { + if(intensityMod < 1) intensityMod = 1; + //console.log(`Normal: ${line} : ${Whisper}`); } }); - //*/ - - return intensity; + return intensityMod; } exports.functiontick = functiontick; From f76b889c022cd92030d44aae791325118c010f41 Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Tue, 10 Feb 2026 01:59:14 +0000 Subject: [PATCH 6/9] Added OOC Escape check --- eventfunctions/toys/vibe_reverb.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eventfunctions/toys/vibe_reverb.js b/eventfunctions/toys/vibe_reverb.js index 593bfba0..1af75609 100644 --- a/eventfunctions/toys/vibe_reverb.js +++ b/eventfunctions/toys/vibe_reverb.js @@ -16,6 +16,9 @@ function msgfunction(userid, data) { intensity = volumetest(data.msgcontent) //console.log(intensity); + // Escape if purely OOC message + if (intensity == 0) return; + //Update End Time and Increment Vibe Intensity if(getUserVar(userid, "reverbEndTime") == undefined) { // Set initial 3 minute timer From 1dc34b7ff94f5bf52a645482c0afa677a1a63e7b Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Wed, 11 Feb 2026 02:41:31 +0000 Subject: [PATCH 7/9] Converted calcVibeEffect to a function --- toys/Vibrator/vibe_reverb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/Vibrator/vibe_reverb.js b/toys/Vibrator/vibe_reverb.js index b8bfe810..d0c2ab23 100644 --- a/toys/Vibrator/vibe_reverb.js +++ b/toys/Vibrator/vibe_reverb.js @@ -7,7 +7,7 @@ exports.vibescale = (data) => { return Math.max(0, Math.min(getUserVar(data.userID, "reverbVibeIntensity")/10, 2)); } // Ranging between 0 and 2 -exports.calcVibeEffect = (data) => { +exports.calcVibeEffect = function(data) { //console.log(`${data.userID}`) return (getUserVar(data.userID, "reverbEndTime") ? data.intensity * this.vibescale(data) : 0) } From 29e5654d509b75086217d32dfd55a50cbbb7e8b0 Mon Sep 17 00:00:00 2001 From: Pyrotech Date: Wed, 11 Feb 2026 02:45:46 +0000 Subject: [PATCH 8/9] Removed Console Print from outgoing code block --- eventfunctions/toys/vibe_reverb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventfunctions/toys/vibe_reverb.js b/eventfunctions/toys/vibe_reverb.js index 1af75609..24a249ce 100644 --- a/eventfunctions/toys/vibe_reverb.js +++ b/eventfunctions/toys/vibe_reverb.js @@ -62,7 +62,7 @@ async function functiontick(userID) { function volumetest(message) { // Split into lines arrayOfLines = message.match(newline); - console.log(`ARRAY OF LINES: ${arrayOfLines}\n`); + //console.log(`ARRAY OF LINES: ${arrayOfLines}\n`); intensityMod = 0; // Discard OOC Lines From f7ca8a7dffbd500eaa92fa5c6ba53351e1e31f09 Mon Sep 17 00:00:00 2001 From: Enraa Date: Mon, 16 Feb 2026 18:02:32 -0800 Subject: [PATCH 9/9] NaN check (for safety) --- toys/Vibrator/vibe_reverb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/Vibrator/vibe_reverb.js b/toys/Vibrator/vibe_reverb.js index d0c2ab23..314c23f1 100644 --- a/toys/Vibrator/vibe_reverb.js +++ b/toys/Vibrator/vibe_reverb.js @@ -4,7 +4,7 @@ const { getUserVar, setUserVar } = require("../../functions/usercontext") exports.vibescale = (data) => { //console.log(`${data.userID}`) //console.log(`${getUserVar(data.userID, "reverbVibeIntensity")/10}`); - return Math.max(0, Math.min(getUserVar(data.userID, "reverbVibeIntensity")/10, 2)); + return (isNaN(Math.max(0, Math.min(getUserVar(data.userID, "reverbVibeIntensity")/10, 2))) ? 0 : Math.max(0, Math.min(getUserVar(data.userID, "reverbVibeIntensity")/10, 2))); } // Ranging between 0 and 2 exports.calcVibeEffect = function(data) {