diff --git a/PRINT:Default.notecard b/PRINT:Default.notecard index 905b8b2..61baf31 100644 --- a/PRINT:Default.notecard +++ b/PRINT:Default.notecard @@ -113,6 +113,29 @@ Each sentence line can only be 240 characters (letters, numbers, symbols, space @uInstantFlood: *first must have really had to go! *Sub starts wetting *pos1 diaper, flooding it and keeps going for quite some time until the diaper is nearly full, even *pos1 bottom is a little wet! | It may be time for *obj to get a new diaper on! +@uHoldwTimer: *first is so busy that she forgets the feeling in *pos1 bladder + +@uHoldmTimer: *first is so busy that she forgets the feeling in *pos1 botty + +@uHoldwButton: *first decides to ignore the feeling in *pos1 bladder + +@uHoldmButton: *first decides to ignore the feeling in *pos1 botty + +@uPotty_W: *first manage to go to the potty + +@uPotty_M: *first manage to go to the potty + +@forcePotty: *first have to potty + +@havetoPee: *first have to pee + +@havetoPoo: *first have to poo + +@noPotty_W: *first dose not manage to pee in potty + +@noPotty_M: *first dose not manage to poo in potty + +@forbitten: *first is not in the position to do this ✭=≈=≈=✭✭=≈=≈=✭ 4. Other People's Actions diff --git a/PRINT:Heavy.notecard b/PRINT:Heavy.notecard index 7192015..84b6f96 100644 --- a/PRINT:Heavy.notecard +++ b/PRINT:Heavy.notecard @@ -119,6 +119,29 @@ Each sentence line can only be 240 characters (letters, numbers, symbols, space @regressionLevel9: Uh oh! *first was doing so well, but it appears *sub may have went backwards in *pos1 training! If *sub is to complete *pos1 training, *sub will need a bit more time working on holding it! +@uHoldwTimer: *first is so busy that she forgets the feeling in *pos1 bladder + +@uHoldmTimer: *first is so busy that she forgets the feeling in *pos1 botty + +@uHoldwButton: *first decides to ignore the feeling in *pos1 bladder + +@uHoldmButton: *first decides to ignore the feeling in *pos1 botty + +@uPotty_W: *first manage to go to the potty. Let all *pos1 Pee out and have now time again + +@uPotty_M: *first manage to go to the potty. Let all out and have now freedom again + +@forcePotty: *oFirstName force *first to potty + +@havetoPee: *first have to pee + +@havetoPoo: *first have to poo + +@noPotty_W: *first dose not manage to pee in potty + +@noPotty_M: *first dose not manage to poo in potty + +@forbitten: *first is not allowed to do this ✭=≈=≈=✭✭=≈=≈=✭ 2. Stages of Mess diff --git a/PRINT:Minimal.notecard b/PRINT:Minimal.notecard index 4c40ea1..59f1a23 100644 --- a/PRINT:Minimal.notecard +++ b/PRINT:Minimal.notecard @@ -7,6 +7,10 @@ 3. User Actions ✭=≈=≈=✭✭=≈=≈=✭ +@havetoPee: *first have to do something + +@havetoPoo: *first have to do something + @uChange: *first changes *ref. @uCheckClean: *first checks the front and back of *pos1 diaper, realizing *sub is still fresh and dry! diff --git a/Potty.lsl b/Potty.lsl index fbd52ce..e5fe8e8 100644 --- a/Potty.lsl +++ b/Potty.lsl @@ -1,10 +1,10 @@ /*========================================================== -DrizzleScript +DrizzleScript potty Created By: Ryhn Teardrop Original Date: Dec 3rd, 2011 GitHub Repository: https://github.com/DoomRater/DrizzleScript -Programming Contributors: Ryhn Teardrop, Brache Spyker +Programming Contributors: Ryhn Teardrop, Brache Spyker, Napysusy Iadyl Resource Contributors: Murreki Fasching, Brache Spyker License: RPL v1.5 (Outlined at http://www.opensource.org/licenses/RPL-1.5) @@ -21,7 +21,11 @@ the software together, so everyone has access to something potentially excellent string g_diaperType; integer g_mainPrim; +integer g_uniqueChan; +integer g_mainListen; string g_mainPrimName = ""; // by default, set to "" +key g_queueid = NULL_KEY; //keep track of people who are waiting in line to use the item + /* Puppy Pawz Pampers Variables */ integer g_wetPrim; @@ -34,6 +38,256 @@ integer g_wetFace = 0; integer g_errorCount = 0; /*End of Kawaii variables*/ +//menu variables passed to preferences +integer g_wetLevel; +integer g_messLevel; +integer g_wetChance; +integer g_messChance; +integer g_wetTimer; +integer g_messTimer; +integer g_tummyRub; +integer g_tickle; +integer g_gender; +integer g_isOn; +integer g_interact; +integer g_chatter; +integer g_crinkleVolume; +integer g_wetVolume; +integer g_messVolume; +integer g_mCalcForecast; // Calculation needet vor Determines how long until the next mess chance +integer g_wCalcForecast; // Calculation needet vor Determines how long until the next wet chance +integer mForecast; // Determines how long until the next mess chance +integer wForecast; // Determines how long until the next wet chance +integer g_timesHeldWet; +integer g_timesHeldMess; +integer g_PlasticPants; +integer g_TimerRandom; +integer g_allowPeePotty; +integer g_allowPooPottty; +integer g_allowHoldPee; +integer g_allowHoldPoo; +integer g_giveWarningPee; +integer g_giveWarningPoo; +integer g_allowSelfChange; +integer g_lockdetach; // 1 = options an take off is forbitten +// End List from menu +integer g_timesHeldWetMultiplier = 10; //how much harder it gets each time you successfully hold it, in percent +integer g_timesHeldMessMultiplier = 10; +integer g_timesHeldWetStrength = 3; //how many times you can hold it before you flood +integer wMessageDone = 0; +integer mMessageDone = 0; +// Time sending Warning bevor wetting +integer wMessageForecast = 0 ; +integer mMessageForecast = 0 ; +integer wManualOK = 0; +integer mManualOK = 0; + + + +integer isDebug = FALSE; +//set isDebug to 1 (TRUE) to enable all debug messages, and to 2 to disable info messages + + + +list g_HoldMenu = ["Not now","❤Flood❤", "Big❤Load","Get❤Stinky", "Hold❤Poo", "Poo❤Potty","Get❤Soggy","Hold❤Pee","Pee❤Potty"]; + + +init() +{ + llListenRemove(g_mainListen); + g_uniqueChan = generateChan(llGetOwner()) + 2; // Remove collision with Menu listen handler via +2 + g_mainListen = llListen(g_uniqueChan, "", "", ""); + findPrims(); + detectDiaperType(); + + llSetTimerEvent(15.0); // Used to check for wet/mess occurances +} + +integer generateChan(key id) { + string channel = "0xE" + llGetSubString((string)id, 0, 6); + return (integer) channel;} + +sendSettings() { + string csv = (string) g_wetLevel + "," + + (string) g_messLevel + "," + + (string) g_wetChance + "," + + (string) g_messChance + "," + + (string) g_wetTimer + "," + + (string) g_messTimer + "," + + (string) g_tummyRub + "," + + (string) g_tickle + "," + + (string) g_gender + "," + + (string) g_isOn + "," + + (string) g_interact + "," + + (string) g_chatter + "," + + (string) g_crinkleVolume + "," + + (string) g_wetVolume + "," + + (string) g_messVolume + "," + + (string) g_mCalcForecast + "," + + (string) g_wCalcForecast + "," + + (string) g_timesHeldWet + "," + + (string) g_timesHeldMess + "," + + (string) g_PlasticPants + "," + + (string) g_TimerRandom + "," + + (string) g_allowPeePotty + "," + + (string) g_allowPooPottty + "," + + (string) g_allowHoldPee + "," + + (string) g_allowHoldPoo + "," + + (string) g_giveWarningPee + "," + + (string) g_giveWarningPoo + "," + + (string) g_lockdetach + "," + + (string) g_allowSelfChange; + llMessageLinked(LINK_THIS, -9, csv, NULL_KEY); +// llMessageLinked(LINK_ALL_OTHERS, 6, csv, NULL_KEY); +} + +parseSettings(string temp) { + integer index; // Used to hold the location of a comma in the CSV + + index = llSubStringIndex(temp, ","); + g_wetLevel = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); // Remove the used data. + + index = llSubStringIndex(temp, ","); + g_messLevel = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wetChance = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_messChance = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wetTimer = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_messTimer = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_tummyRub = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_tickle = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_gender = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_isOn = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_interact = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_chatter = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_crinkleVolume = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wetVolume = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_messVolume = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_mCalcForecast = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wCalcForecast = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldWet = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldMess = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_PlasticPants = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + index = llSubStringIndex(temp, ","); + g_TimerRandom = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPeePotty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPooPottty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_lockdetach = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + g_allowSelfChange = (integer) temp; +} + +printDebugSettings() { + llOwnerSay("Debug Potty: "); + llOwnerSay("Wetness: " + (string) g_wetLevel); + llOwnerSay("Messiness: " + (string) g_messLevel); + llOwnerSay("Wet Hold: " + (string) g_wetChance + "%"); + llOwnerSay("Mess Hold: " + (string) g_messChance + "%"); + llOwnerSay("Wet Frequency: " + (string) g_wetTimer + " Minute(s)"); + llOwnerSay("Mess Frequency: " + (string) g_messTimer + " Minute(s)"); + llOwnerSay("TummyRub Resist: " + (string) g_tummyRub + "%"); + llOwnerSay("Tickle Resist: " + (string) g_tickle + "%"); + llOwnerSay("Gender: " + (string) g_gender); + llOwnerSay("On/Off: " + (string) g_isOn); + llOwnerSay("Other Interaction: " + (string) g_interact); + llOwnerSay("Channel: " + (string) g_uniqueChan); + llOwnerSay("--------"); + llOwnerSay("Wet Prim: " + (string) g_wetPrim); + llOwnerSay("Mess Prim: " + (string) g_messPrim); + llOwnerSay("Crinkle Volume: "+(string) g_crinkleVolume); + llOwnerSay("Wet Sound Volume: "+(string) g_wetVolume); + llOwnerSay("Mess Sound Volume: "+(string) g_messVolume); + llOwnerSay("Times Held (wet): "+(string) g_timesHeldWet); + llOwnerSay("Times Held (mess): "+(string) g_timesHeldMess); + llOwnerSay("Used Memory: " + (string) llGetUsedMemory()); + llOwnerSay("Free Memory: " + (string) llGetFreeMemory()); + llOwnerSay("Time next Mess: " + (string) mForecast); + llOwnerSay("Time next Wet: " + (string) wForecast); + llOwnerSay("Time: " + (string) llRound(llGetTime())); +} + + findPrims() { integer i; // Used to loop through the linked objects integer primCount = llGetNumberOfPrims(); //should be attached, not sat on @@ -75,74 +329,267 @@ detectDiaperType() { adjustWetMessPrims(string msg) { integer index; - index = llSubStringIndex(msg, ":"); // Pull out wet level - integer wetLevel = (integer) llGetSubString(msg, 0, index - 1); - msg = llGetSubString(msg, index+1, -1); - - index = llSubStringIndex(msg, ":"); // Pull out mess level - integer messLevel = (integer) llGetSubString(msg, 0, index - 1); - if(llGetAlpha(ALL_SIDES) != 0.0) { // Only adjust the prims if the model isn't hidden! if(g_diaperType == "Fluffems") { - if(wetLevel == 0) { + if(g_wetLevel == 0) { llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,1>, 0.0]); } - else if(wetLevel == 1) { + else if(g_wetLevel == 1) { llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.666>, 0.20]); } - else if(wetLevel == 2) { + else if(g_wetLevel == 2) { llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.5>, 0.35]); } - else if(wetLevel == 3) { + else if(g_wetLevel == 3) { llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.333>, 0.45]); } - else if(wetLevel == 4) { + else if(g_wetLevel == 4) { llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.25>, 0.55]); } - else if(wetLevel == 5) { + else if(g_wetLevel == 5) { llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,.1667>, 0.65]); } - else if(wetLevel >= 6) { + else if(g_wetLevel >= 6) { llSetLinkPrimitiveParamsFast(g_wetPrim, [PRIM_COLOR, ALL_SIDES, <1,1,0>, 0.85]); } //mess levels - if(messLevel < 3) { + if(g_messLevel <= 2) { llSetLinkPrimitiveParamsFast(g_messPrim, [PRIM_COLOR, ALL_SIDES, <0.749, 0.588, 0.392>, 0.0]); } - else { + else if (g_messLevel = 3) { llSetLinkPrimitiveParamsFast(g_messPrim, [PRIM_COLOR, ALL_SIDES, <0.749, 0.588, 0.392>, 0.65]); } + else { + llSetLinkPrimitiveParamsFast(g_messPrim, [PRIM_COLOR, ALL_SIDES, <0.749, 0.588, 0.392>, 0.85]); + } } else if(g_diaperType == "Kawaii") { - if(wetLevel == 0) { + if(g_wetLevel == 0) { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,1>, 0.0]); } - else if(wetLevel == 1) { + else if(g_wetLevel == 1) { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.666>, 0.20]); } - else if(wetLevel == 2) { + else if(g_wetLevel == 2) { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.5>, 0.35]); } - else if(wetLevel == 3) { + else if(g_wetLevel == 3) { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.333>, 0.45]); } - else if(wetLevel == 4) { + else if(g_wetLevel == 4) { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.25>, 0.55]); } - else if(wetLevel == 5) { + else if(g_wetLevel == 5) { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,.1667>, 0.65]); } - else if(wetLevel >= 6) { + else if(g_wetLevel >= 6) { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_COLOR, g_wetFace, <1,1,0>, 0.85]); } } } }//End WetMessPrims() +// Returns a forecast duration number of seconds in the future. +// @ param [duration] : number of seconds to forecast in script runtime. +// @ return : the forcasted time for timer hub to execute associated command. +integer myTimer(integer duration, string msg) { + integer x = llRound(llGetTime()); + integer y = (integer) llFrand(duration); + integer z; + + if(x + duration > 2000000000) { // Failsafe, resets script time if approaching threshold for integer capacity. + //we need to adjust the forecasts so they aren't unobtainable due to time reset + wForecast -= x; + mForecast -= x; + llResetTime(); + x = llRound(llGetTime()); + } + if (g_TimerRandom == 0) { //timer exaktly + z = duration; + } + else { + z = duration/2 + y; + } + x += z; + if (msg == "W") { + wMessageDone = 0; // Reset Message is given + wMessageForecast = x - 60 - (z/10); // time to give warning + // add one minute more to give a chance to potty + wManualOK = x -z/2; + } + else if (msg == "M") { + mMessageDone = 0; + mMessageForecast = x - 60 - (z/10); // time to give warning + mManualOK = x -z/2; + } + + return x; +} + +// This function gives the wearer a chance to hold their potties +// A percentage is weighed. +// @type = The form of diaper use to be attempted. +// Case 1: Success, Held it, printout +// Case 2: Failure, Had an Accident, printout +integer findPercentage(string type) { + // Add check for trainer mode. + integer toCheck; + + if(type == "W") { + toCheck = (integer) llFrand(100); // Random number between 0 and 99 + ++toCheck; // ++i used to achieve 1 - 100 range. + if(toCheck + (g_timesHeldWet * g_timesHeldWetMultiplier) <= g_wetChance) { //timesHeldWet is a modifier that makes you less likely to hold it. + return FALSE; + } + else { + return TRUE; + } + } + else if(type == "M") {// Use Mess Chance + toCheck = (integer) llFrand(100); // Random number between 0 and 99 + ++toCheck; // ++i used to achieve 1 - 100 range. + if(toCheck + (g_timesHeldMess * g_timesHeldMessMultiplier) <= g_messChance) {//timesHeldMess is a modifier that makes you less likely to hold it. + return FALSE; + } + else + { + return TRUE; + } + } + //If we get here, we clearly don't want something unknown to return TRUE. + return FALSE; +} //End findPercentage(string) + +// This function is called to manage Holding +// @msg = The type of holding, e.g. holding button or Timer +// @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). +handleHold(string msg, key id) { + if(msg == "WHold_Timer") { + //Example of what message looks like: 1:2:g_wetLevel:Name + g_timesHeldWet++; + wMessageDone = 0; + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "WHold_Timer" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + wForecast = myTimer(g_wetTimer * 60 / (g_timesHeldWet + 1),"W"); + } + if(msg == "WHold_Button") { + //Example of what message looks like: 1:2:g_wetLevel:Name + if (wMessageDone == 1) { + g_timesHeldWet++; + wMessageDone = 0; + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "WHold_Button" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + wForecast = myTimer(g_wetTimer * 60 / (g_timesHeldWet + 1),"W"); + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Forbitten" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + if(msg == "MHold_Timer") { + //Example of what message looks like: 1:2:g_wetLevel:Name + g_timesHeldMess++; + mMessageDone = 0; + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "MHold_Timer" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + mForecast = myTimer(g_messTimer * 60 / (g_timesHeldMess + 1),"M"); + } + if(msg == "MHold_Button") { + //Example of what message looks like: 1:2:g_wetLevel:Name + if (mMessageDone == 1) { + g_timesHeldMess++; + mMessageDone = 0; + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "MHold_Button" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + mForecast = myTimer(g_messTimer * 60 / (g_timesHeldMess + 1),"M"); + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Forbitten" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + sendSettings(); +}//End handleHold(string, key) +// This function is called to manage messings +// @msg = The type of accident occuring, e.g. messing yourself, being squeezed/tummy rub, and being forced by a carer to get stinky. +// @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). +handleMessing(string msg, key id) { + g_messLevel++; + g_timesHeldMess = 0; + //new forecast for messing + mForecast = myTimer(g_messTimer * 60,"M"); + sendSettings(); + if(msg == "Self") { + //Example of what message looks like: 1:2:g_wetLevel:Self + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_messLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else if(msg == "Timer") { + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_messLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + playMessSound(g_messVolume); +}//End handleMessing(string, key) +// This function is called to manage wettings +// @msg = The type of accident occuring, e.g. wetting yourself, being tickled, and being forced by a carer to wet. +// @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). +handleWetting(string msg, key id) { + g_wetLevel++; + g_timesHeldWet = 0; + //new forecast for wetting + wForecast = myTimer(g_wetTimer * 60,"W"); + sendSettings(); + if(msg == "Self") { + //Example of what message looks like: 1:2:g_wetLevel:Name + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_wetLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else if(msg == "Timer") { + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_wetLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + playWetSound(g_wetVolume * .00333); +}//End handleWettings(string, key) +// This function is called to manage a special-case wetting. +// @msg = The type of accident occuring, e.g. naturally flooding yourself, or being potentially forced by a carer. +// @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). +handleFlooding(string msg, key id) { + g_wetLevel = g_wetLevel + 4; + g_timesHeldWet = 0; + //new forecast for wetting + wForecast = myTimer(g_wetTimer * 60,"W"); + sendSettings(); + if(msg == "Self") { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Self Flood" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else if(msg == "Timer") { //added to allow separation of timer floods and forced floods + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Self Flood" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + playWetSound(g_wetVolume * .02); //todo: add a special flooding sound +} +playWetSound(float volume) { + if(llGetInventoryType("DrizzleWetSound") != -1) { // Sound exists in inventory + llPlaySound("DrizzleWetSound", volume); + } + else { + if(isDebug==TRUE) { + llOwnerSay("No Sound Found!\nPlease drop a soundfile named: DrizzleWetSound into your model!"); + } + } +} + +playMessSound(float volume) { + if(llGetInventoryType("SusyMessSound") != -1) { // Sound exists in inventory + //todo: create a mess sound + llPlaySound("SusyMessSound", volume); + } + else { + if(isDebug==TRUE) { + llOwnerSay("No Sound Found!\nPlease drop a soundfile named: SusyMessSound into your model!"); + } + } +} + + default { state_entry() { - findPrims(); - detectDiaperType(); + init(); + } + + changed(integer change) { + if(change & (CHANGED_OWNER | CHANGED_INVENTORY)) { + init(); + } } link_message(integer sender_num, integer num, string msg, key id) { @@ -153,5 +600,202 @@ default { adjustWetMessPrims(msg); } } + else if (num == -6 || num == -3 || num == -10) { //save global Variables from menu or Preferences + integer index = llSubStringIndex(msg, ":"); + if(index == -1) { //received settings from Preferences + parseSettings(msg); + return; + } + } + else if(num == -8) { + if(msg == "❤Potty❤" ) { + llDialog(id, "What should I do?", g_HoldMenu, g_uniqueChan); + } + } } + //menu + listen(integer chan, string name, key id, string msg) + { //list g_HoldMenu = ["Not now","★", "DEBUG","Get❤Stinky", "Hold❤Poo", "Poo❤Potty","Get❤Soggy","Hold❤Pee","Pee❤Potty"]; + if(msg == "★") {// Someone misclicked in the menu! + llRegionSayTo(id, 0, "The stars are just there to look pretty! =p"); + } + else if(msg == "Not now") { + //llRegionSayTo(id, 0, msg + "gedrückt"); + } + else if(msg=="DEBUG") { + printDebugSettings(); + } + else if(msg == "Get❤Stinky") { + handleMessing("Self", llGetOwner()); + } + else if(msg == "Hold❤Poo") { + if (g_allowHoldPoo == 1) { + handleHold("MHold_Button", llGetOwner()); // "Timer" is the cause of the holding wenn Holding success + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Forbitten" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + else if(msg == "Poo❤Potty") { + if (g_allowPooPottty == 1) { + if (mManualOK < llRound(llGetTime())) { + g_timesHeldMess = 0; + g_timesHeldWet = 0; + //new forecast for messing + mForecast = myTimer(g_messTimer * 60,"M"); + wForecast = myTimer(g_wetTimer * 60,"W"); + playMessSound(g_messVolume); + sendSettings(); + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Potty_M" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "noPotty_M" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Forbitten" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + else if(msg == "Get❤Soggy") { + handleWetting("Self", llGetOwner()); + } + else if(msg == "Hold❤Pee") { + if (g_allowHoldPee == 1) { + handleHold("WHold_Button", llGetOwner()); // "Timer" is the cause of the holding wenn Holding success + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Forbitten" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + else if(msg == "Pee❤Potty") { + if (g_allowPeePotty == 1) { + if (wManualOK < llRound(llGetTime())) { + g_timesHeldWet = 0; + //new forecast for wetting + wForecast = myTimer(g_wetTimer * 60,"W"); + playWetSound(g_wetVolume * .023); + sendSettings(); + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Potty_W" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "noPotty_W" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Forbitten" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + } + else if(msg == "❤Flood❤") { + handleFlooding("Self", llGetOwner()); + } + else if(msg == "Big❤Load") { + g_messLevel += 2; + handleMessing("Self", llGetOwner()); + } + } // end listen + // This event is used to evaluate/reset the forecasts for wetting or messing, as well + // as determining whether a user succeeds in holding it. + timer() { + integer currentTime = llRound(llGetTime()); + //Check other Skrit force to calculate Forecast + if(g_wCalcForecast == 1) { + wForecast = myTimer(g_wetTimer * 60,"W"); // New Forecast Regardless + g_wCalcForecast = 0; + sendSettings(); + } + else if(g_wCalcForecast == 2) { + if (wManualOK < currentTime) { + g_timesHeldWet = 0; + wForecast = myTimer(g_wetTimer * 60,"W"); // New Forecast Regardless + playWetSound(g_wetVolume * .023); + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Potty_W" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "noPotty_W" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + g_wCalcForecast = 0; + sendSettings(); + } + if(g_mCalcForecast == 1) { + mForecast = myTimer(g_messTimer * 60,"M"); // New Forecast Regardless + g_mCalcForecast = 0; + sendSettings(); + } + else if(g_mCalcForecast == 2) { + if (mManualOK < currentTime) { + mForecast = myTimer(g_messTimer * 60,"M"); // New Forecast Regardless + g_timesHeldMess = 0; + playMessSound(g_messVolume); + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Potty_M" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "noPotty_M" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + g_mCalcForecast = 0; + sendSettings(); + } + + + if(g_isOn == TRUE) { //only if Diaper switches on + if(currentTime <= 60) { + return; + } + //Timer of 0 (Off) prevent accidents. + if(g_wetTimer == 0) { + wForecast = 2000000000; + } + //Timer of 0 (Off) prevent accidents. + if(g_messTimer == 0) { + mForecast = 2000000000; + } + // If both wet and mess forecasts are past their time. . . + if(wForecast <= currentTime && mForecast <= currentTime) { + // New wet forecast. This means the user will mess by default. :D + wForecast += 30; // and a bit lader wet :D + } + + if(wForecast <= currentTime) { // The forecasted time is in the past + if(findPercentage("W") == TRUE) { + if(g_timesHeldWet >= g_timesHeldWetStrength) { // If the user has held it a lot. This time they flood. + handleFlooding("Timer", llGetOwner()); + } + else { + handleWetting("Timer", llGetOwner()); // "Timer" is the cause of the wetting, llGetOwner is to determine what printout to trigger. + } + } + else { + //todo: potty training handler will go here! + handleHold("WHold_Timer", llGetOwner()); // "Timer" is the cause of the holding wenn Holding success + } + } + else if(wMessageForecast <= currentTime && wMessageDone == 0) { // Message bladder has a message + if (g_giveWarningPee == 1) { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "havetoPee" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + wMessageDone = 1; + } + + if(mForecast <= currentTime) { + if(findPercentage("M") == TRUE) { + handleMessing("Timer", llGetOwner()); + } + else { + //todo: potty training handler will go here! + handleHold("WHold_Timer", llGetOwner()); // "Timer" is the cause of the holding wenn Holding success + } + } + else if(mMessageForecast <= currentTime && mMessageDone == 0 ) { // Message bowel has a message + if (g_giveWarningPoo == 1) { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "havetoPoo" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + mMessageDone = 1; + } + + /* llOwnerSay("----\nwetting to go: " + (string) (wForecast-currentTime)); + llOwnerSay("messing to go: " + (string) (mForecast-currentTime)); + llOwnerSay("wetting warning: " + (string) (wMessageForecast-currentTime)); + llOwnerSay("wetting posible: " + (string) (wManualOK-currentTime)); + llOwnerSay("wetting warning done: " + (string) wMessageDone);*/ + } // End g_isOn + }// End timer } diff --git a/Preferences.lsl b/Preferences.lsl index cb574ba..f141c2e 100644 --- a/Preferences.lsl +++ b/Preferences.lsl @@ -1,10 +1,10 @@ /*========================================================== -DrizzleScript +DrizzleScript preferences Created By: Ryhn Teardrop Original Date: Dec 3rd, 2011 GitHub Repository: https://github.com/DoomRater/DrizzleScript -Programming Contributors: Ryhn Teardrop, Brache Spyker +Programming Contributors: Ryhn Teardrop, Brache Spyker, Napysusy Iadyl Resource Contributors: Murreki Fasching, Brache Spyker License: RPL v1.5 (Outlined at http://www.opensource.org/licenses/RPL-1.5) @@ -31,31 +31,43 @@ string g_currMenuMessage; //Potentially usable to determine which timer is being list g_currMenuButtons; list g_Skins; list g_Tapes; +list g_Pants; list g_BackFaces; list g_Panels; list g_Cuties; list g_Printouts; -list g_settingsMenu = ["<--TOP", "★", "Gender", "Skins", "Printouts", "Chatter", "Potty", "Interactions", "Volume"]; +//list g_settingsMenu = ["<--TOP","★", "RLV", "Gender", "Skins", "Printouts", "Chatter", "Potty", "Interactions", "Volume","DEBUG"]; +list g_settingsMenu = ["<--TOP","★", "RLV", "Gender", "Skins", "Printouts", "Chatter", "Potty", "Interactions", "Volume"]; list g_plasticPantsMenu = ["<--BACK","Put❤On","Take❤Off"]; -list g_appearanceMenu = ["<--BACK","Help", "*","Diaper❤Print","Tapes"]; +list g_appearanceMenu = ["<--BACK","Help", "Show Tapes","Diaper❤Print","Tapes","Hide Tapes","Pants❤Print"]; list g_genderMenu = ["<--BACK", "★", "★", "Boy", "Girl"]; list g_chatterMenu = ["<--BACK", "★", "★", "Normal", "Whisper", "Private"]; list g_volumeMenu = ["<--BACK", "★", "★", "Crinkle❤Volume", "Wet❤Volume", "Mess❤Volume"]; list g_pottyMenu = ["<--BACK", "★", "★", "Wet❤Timer", "Mess❤Timer", "★", "Wet%", "Mess%", "★", "❤Tickle❤", "Tummy❤Rub", "★"]; -list g_timerOptions = ["<--BACK", "★", "★", "40", "60", "120", "15", "20", "30", "0", "5", "10"]; // Backwards (Ascending over 3) to make numbers have logical order. +list g_timerOptions = ["<--BACK", "180", "240", "40", "60", "120", "15", "20", "30", "0", "5", "10"]; // Backwards (Ascending over 3) to make numbers have logical order. list g_chanceOptions = ["<--BACK", "90%", "100%", "60%", "70%", "80%", "30%", "40%", "50%", "0%", "10%", "20%"]; // Backwards (Ascending over 3) to make numbers have logical order. -list g_interactionsOptions = ["<--BACK","★", "★","Everyone","Carers❤&❤Me"]; +list g_interactionsOptions = ["<--BACK","★", "★","Everyone","Carers❤&❤Me","Carers"]; + /* For Misc Diaper Models */ integer g_mainPrim; -string g_mainPrimName = ""; // By default, set to "". +integer g_TapeLPrim; +integer g_TapeRPrim; +integer g_TapeBPrim; integer g_plasticPantsPrim; +string g_mainPrimName = ""; // By default, set to "". string g_plasticPantsName = "Plastic Pants"; +string g_TapeLPrimName = "Tape1"; +string g_TapeRPrimName = "Tape2"; +string g_TapeBPrimName = "Tape3"; vector g_plasticPantsSize; //various diapers have different texture settings //ABAR Sculpted diaper bases uses repeat 1.0, 1.0 and offset .03, -.5 string g_diaperType = "Fluffems"; string g_resizerScriptName = ""; //change this to a resizer script name, if provided integer isDebug = FALSE; +integer newTimer = 0; +integer ShowTape = 1; // 0 Hide Tapes + //menu variables passed to preferences integer g_wetLevel; @@ -73,7 +85,20 @@ integer g_chatter; integer g_crinkleVolume; integer g_wetVolume; integer g_messVolume; +integer g_mCalcForecast; +integer g_wCalcForecast; +integer g_timesHeldWet; +integer g_timesHeldMess; integer g_PlasticPants; +integer g_TimerRandom; +integer g_allowPeePotty; +integer g_allowPooPottty; +integer g_allowHoldPee; +integer g_allowHoldPoo; +integer g_giveWarningPee; +integer g_giveWarningPoo; +integer g_allowSelfChange; +integer g_lockdetach; // 1 = options an take off is forbitten //Old variables used in an prim-sculptie based system. //list g_TrainingMenu = ["<--BACK", "★", "★", "Infant", "Toddler", "Adult"]; @@ -110,6 +135,15 @@ findPrims() { } else if(g_plasticPantsName == primName) { g_plasticPantsPrim = i; + } + else if(g_TapeLPrimName == primName) { + g_TapeLPrim = i; + } + else if(g_TapeRPrimName == primName) { + g_TapeRPrim = i; + } + else if(g_TapeBPrimName == primName) { + g_TapeBPrim = i; } //add additional prims to seek here } @@ -135,6 +169,21 @@ fitPlasticPants() { //causes a .2 second llSleep, so be judicial about when it's g_plasticPantsSize = llList2Vector(llGetLinkPrimitiveParams(g_mainPrim, [PRIM_SIZE]), 0) * 1.08; } +ShowTapeStripes() { //Shows or Hide the Tapes on a Fluffems diaper + if (g_diaperType == "Fluffems" && llGetAlpha(ALL_SIDES) == 1.0) { + if (ShowTape == 1) { + llSetLinkAlpha(g_TapeLPrim, 1.0, ALL_SIDES); + llSetLinkAlpha(g_TapeRPrim, 1.0, ALL_SIDES); + llSetLinkAlpha(g_TapeBPrim, 1.0, ALL_SIDES); + } + else if (ShowTape == 0 ) { + llSetLinkAlpha(g_TapeLPrim, 0.0, ALL_SIDES); + llSetLinkAlpha(g_TapeRPrim, 0.0, ALL_SIDES); + llSetLinkAlpha(g_TapeBPrim, 0.0, ALL_SIDES); + } + } +} + detectDiaperType() { key mainPrimCreator = llGetCreator(); //JDroo Resident, creator of Kawaii Diapers @@ -201,6 +250,9 @@ handlePrev(key id) { else if(g_currMenu == "Tapes") { DialogPlus(m_tapesMenu(),g_Tapes, --g_currCount, id); } + else if(g_currMenu == "Pants❤Print") { + DialogPlus(m_PantsMenu(),g_Pants, --g_currCount, id); + } else if(g_currMenu == "Back❤Face") { DialogPlus(m_backFaceMenu(),g_BackFaces, --g_currCount, id); } @@ -227,6 +279,9 @@ handleNext(key id) { else if(g_currMenu == "Tapes") { DialogPlus(m_tapesMenu(), g_Tapes, ++g_currCount, id); } + else if(g_currMenu == "Pants❤Print") { + DialogPlus(m_PantsMenu(), g_Pants, ++g_currCount, id); + } else if(g_currMenu == "Back❤Face") { DialogPlus(m_backFaceMenu(),g_BackFaces, ++g_currCount, id); } @@ -242,6 +297,7 @@ loadAllTextures(list l) { integer i; g_Skins = []; g_Tapes = []; + g_Pants = []; g_BackFaces = []; g_Panels = []; g_Cuties = []; @@ -264,6 +320,9 @@ loadAllTextures(list l) { else if(prefix == "CUTIE:") { g_Cuties += name; } + else if(prefix == "PANTS:") { + g_Pants += name; + } } } @@ -369,6 +428,14 @@ applyTexture(string name, string prefix) { if(prefix == "SKIN:") { llSetLinkPrimitiveParamsFast(g_mainPrim, [PRIM_TEXTURE, ALL_SIDES, texture, repeats, offset, radRotation]); } + else if(prefix == "TAPE:") { + llSetLinkPrimitiveParamsFast(g_TapeLPrim, [PRIM_TEXTURE, ALL_SIDES, texture, repeats, offset, radRotation]); + llSetLinkPrimitiveParamsFast(g_TapeRPrim, [PRIM_TEXTURE, ALL_SIDES, texture, repeats, offset, radRotation]); + llSetLinkPrimitiveParamsFast(g_TapeBPrim, [PRIM_TEXTURE, ALL_SIDES, texture, repeats, offset, radRotation]); + } + if(prefix == "PANTS:") { + llSetLinkPrimitiveParamsFast(g_plasticPantsPrim, [PRIM_TEXTURE, ALL_SIDES, texture, repeats, offset, radRotation]); + } } } @@ -388,14 +455,29 @@ sendSettings() { (string) g_crinkleVolume + "," + (string) g_wetVolume + "," + (string) g_messVolume + "," + - (string) g_PlasticPants; + (string) g_mCalcForecast + "," + + (string) g_wCalcForecast + "," + + (string) g_timesHeldWet + "," + + (string) g_timesHeldMess + "," + + (string) g_PlasticPants + "," + + (string) g_TimerRandom + "," + + (string) g_allowPeePotty + "," + + (string) g_allowPooPottty + "," + + (string) g_allowHoldPee + "," + + (string) g_allowHoldPoo + "," + + (string) g_giveWarningPee + "," + + (string) g_giveWarningPoo + "," + + (string) g_lockdetach + "," + + (string) g_allowSelfChange; llMessageLinked(LINK_THIS, -3, csv, NULL_KEY); - llMessageLinked(LINK_ALL_OTHERS, 6, csv, NULL_KEY); +// llMessageLinked(LINK_ALL_OTHERS, 6, csv, NULL_KEY); + g_wCalcForecast = 0; //send this only once + g_mCalcForecast = 0; //send this only once } parseSettings(string temp) { integer index; // Used to hold the location of a comma in the CSV - + index = llSubStringIndex(temp, ","); g_wetLevel = (integer) llGetSubString(temp, 0, index-1); temp = llGetSubString(temp, index+1, -1); // Remove the used data. @@ -456,8 +538,63 @@ parseSettings(string temp) { g_messVolume = (integer) llGetSubString(temp, 0, index-1); temp = llGetSubString(temp, index+1, -1); - g_PlasticPants = (integer) temp; + index = llSubStringIndex(temp, ","); + g_mCalcForecast = (integer) llGetSubString(temp, 0, index-1); + g_mCalcForecast = 0; // this is not importand vor this skript + temp = llGetSubString(temp, index+1, -1); + index = llSubStringIndex(temp, ","); + g_wCalcForecast = (integer) llGetSubString(temp, 0, index-1); + g_wCalcForecast = 0; // this is not importand vor this skript + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldWet = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldMess = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_PlasticPants = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_TimerRandom = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPeePotty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPooPottty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_lockdetach = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + g_allowSelfChange = (integer) temp; + + ShowTapeStripes(); //Show hide Tapes } printDebugSettings() { @@ -522,6 +659,9 @@ string m_interactions() { else if(g_interact==1) { allowedInteractions = "everyone is"; } + else if(g_interact==2) { + allowedInteractions = "only carers is"; + } return "Who should be able to interact with this diaper?\n\nCurrently "+allowedInteractions+" allowed."; } @@ -567,6 +707,10 @@ string m_tapesMenu() { return "Choose a tape texture.\nPrefix is TAPE:"; } +string m_PantsMenu() { + return "Choose a Plastk Pants texture.\nPrefix is Pants:"; +} + string m_panelMenu() { return "Choose a panel print.\nPrefix is PANEL:"; } @@ -583,8 +727,8 @@ string m_printMenu() { return "Choose a Printout style.\nPrefix is PRINT:"; } + default { - state_entry() { init(); } @@ -619,8 +763,11 @@ default { } link_message(integer sender_num, integer num, string msg, key id) { - if(num == -6) { - parseSettings(msg); + if(num == -6 || num == -9 || num == -10) { + integer index = llSubStringIndex(msg, ":"); + if(index == -1) { //received settings from Preferences + parseSettings(msg); + } } else if(num == -1) { if(msg == "Options" && g_currentid == NULL_KEY || g_currentid == id) { @@ -677,6 +824,10 @@ default { applyTexture(msg, "TAPE:"); offerMenu(id, g_currMenuMessage, g_currMenuButtons); } + else if(~llListFindList(g_Pants, [msg]) && g_currMenu == "Pants❤Print") { + applyTexture(msg, "PANTS:"); + offerMenu(id, g_currMenuMessage, g_currMenuButtons); + } else if(~llListFindList(g_BackFaces, [msg]) && g_currMenu == "Back❤Face") { applyTexture(msg, "BACKFACE:"); offerMenu(id, g_currMenuMessage, g_currMenuButtons); @@ -721,12 +872,20 @@ default { offerMenu(id, m_wetChance(), g_currMenuButtons); } else if(g_currMenu == "Mess❤Timer") { - g_messTimer = msgToNumber(msg); + newTimer = msgToNumber(msg); + if(g_messTimer != newTimer) { + g_messTimer = newTimer; + g_mCalcForecast = 1; + } sendSettings(); offerMenu(id, m_messTimer(), g_currMenuButtons); } else if(g_currMenu == "Wet❤Timer") { - g_wetTimer = msgToNumber(msg); + newTimer = msgToNumber(msg); + if(g_wetTimer != newTimer) { + g_wetTimer = newTimer; + g_wCalcForecast = 1; + } sendSettings(); offerMenu(id, m_wetTimer(), g_currMenuButtons); } @@ -772,6 +931,12 @@ default { sendSettings(); offerMenu(id, m_interactions(), g_currMenuButtons); } + else if(msg=="Carers") { + llRegionSayTo(id, 0, "Only Caretaker can change settings now" ); + g_interact = 2; + sendSettings(); + offerMenu(id, m_interactions(), g_currMenuButtons); + } //chat spam level else if(msg == "Normal") { llMessageLinked(LINK_THIS, -3, "Chatter:2", NULL_KEY); @@ -802,6 +967,10 @@ default { g_currMenu = msg; DialogPlus(m_tapesMenu(), g_Tapes, g_currCount = 0, id); } + else if(msg == "Pants❤Print") { + g_currMenu = msg; + DialogPlus(m_PantsMenu(), g_Pants, g_currCount = 0, id); + } else if(msg == "Panel") { g_currMenu = msg; DialogPlus(m_panelMenu(), g_Panels, g_currCount = 0, id); @@ -818,6 +987,16 @@ default { llOwnerSay("Adding your own skins and notecards is easy! Just prefix your textures with the appropriate tag for where you want it to be and drag it into the diaper! I'll take care of the rest."); offerMenu(id, g_currMenuMessage, g_currMenuButtons); } + else if (msg == "Show Tapes") { + ShowTape = 1; + ShowTapeStripes(); + offerMenu(id, g_currMenuMessage, g_currMenuButtons); + } + else if (msg == "Hide Tapes") { + ShowTape = 0; + ShowTapeStripes(); + offerMenu(id, g_currMenuMessage, g_currMenuButtons); + } else if(msg == "Potty") { g_currMenu = msg; offerMenu(id, m_pottyMenu(), g_pottyMenu); @@ -882,6 +1061,11 @@ default { g_currMenu = msg; offerMenu(id, m_messVolume(), g_chanceOptions); } + else if(msg == "RLV") { + g_currMenu = msg; + sendSettings(); //make sure preferences knows the current settings + llMessageLinked(LINK_THIS, -11, msg, id); // Tell Preferences script to talk to id + } else if(msg == "Resize") { llSetTimerEvent(.1); //queue up the next person in line llMessageLinked(LINK_THIS, 900, "MENU", NULL_KEY); diff --git a/Printouts1.lsl b/Printouts1.lsl index 584bc53..b688678 100644 --- a/Printouts1.lsl +++ b/Printouts1.lsl @@ -54,6 +54,15 @@ string wet6; //string holdwetstage9; //string holdunsuccessful; +// holding +string holtwTimer; +string holtmTimer; +string holtwButton; +string holtmButton; + +string PottyW; +string PottyM; + //Mess Prints string mess1; string mess2; @@ -139,6 +148,12 @@ clearCustomPrints() { wet5=""; wet6=""; + holtwTimer=""; + holtmTimer=""; + holtwButton=""; + holtmButton=""; + PottyW=""; + PottyM=""; mess1=""; mess2=""; mess3=""; @@ -264,6 +279,24 @@ constructPrint(string data, integer append, string printoutType) { else if(printoutType == "@Wet6") { wet6 += data; }// End of wetting printouts + else if(printoutType == "@uHoldwTimer") { + holtwTimer += data; + } + else if(printoutType == "@uHoldmTimer") { + holtmTimer += data; + } + else if(printoutType == "@uHoldwButton") { + holtwButton += data; + } + else if(printoutType == "@uHoldmButton") { + holtmButton += data; + }// End of holding printouts + else if(printoutType == "@uPotty_W") { + PottyW += data; + } + else if(printoutType == "@uPotty_M") { + PottyM += data; + } else if(printoutType == "@Mess1") { mess1 += data; } @@ -444,6 +477,24 @@ constructPrint(string data, integer append, string printoutType) { else if(printoutType == "@Wet6") { wet6 = data; }// End of wetting printouts + else if(printoutType == "@uHoldwTimer") { + holtwTimer = data; + } + else if(printoutType == "@uHoldmTimer") { + holtmTimer = data; + } + else if(printoutType == "@uHoldwButton") { + holtwButton = data; + } + else if(printoutType == "@uHoldmButton") { + holtmButton = data; + }// End of holding printouts + else if(printoutType == "@uPotty_W") { + PottyW = data; + } + else if(printoutType == "@uPotty_M") { + PottyM = data; + } else if(printoutType == "@Mess1") { mess1 = data; } @@ -873,6 +924,25 @@ displayPrintout() { temp = processPrint(wetMessTease); } } + // addet napysusy to do message vor holding + else if(g_useType == "WHold_Button") { + temp = processPrint(holtwButton); + } + else if(g_useType == "WHold_Timer") { + temp = processPrint(holtwTimer); + } + else if(g_useType == "MHold_Button") { + temp = processPrint(holtmButton); + } + else if(g_useType == "MHold_Timer") { + temp = processPrint(holtmTimer); + } + else if(g_useType == "Potty_W") { + temp = processPrint(PottyW); + } + else if(g_useType == "Potty_M") { + temp = processPrint(PottyM); + } if(temp) { //Don't chat at all if we didn't assign temp anything //Remove first word in sentence index = llSubStringIndex(temp, " "); diff --git a/Printouts2.lsl b/Printouts2.lsl index 43e5ec5..5c36ea0 100644 --- a/Printouts2.lsl +++ b/Printouts2.lsl @@ -63,6 +63,14 @@ string carer_forceWet1; //Prints for carer 'Force' options string carer_forceWet2; string carer_forceMess1; string carer_forceMess2; +string carer_forcePotty; + +//Potty stuff +string havetoPee; +string havetoPoo; +string noPotty_W; +string noPotty_M; +string forbitten; //Other Check in Printouts1 (19) @@ -132,6 +140,14 @@ clearCustomPrints() { carer_forceWet2=""; carer_forceMess1=""; carer_forceMess2=""; + carer_forcePotty="";; + +//Potty stuff + havetoPee=""; + havetoPoo=""; + noPotty_W=""; + noPotty_M=""; + forbitten=""; instantFlood=""; @@ -342,6 +358,24 @@ constructPrint(string data, integer append, string printoutType) { else if(printoutType == "@oWedgieMess2") { messWedgie2 += data; } + else if(printoutType == "@forcePotty") { + carer_forcePotty += data; + } + else if(printoutType == "@havetoPee") { + havetoPee += data; + } + else if(printoutType == "@havetoPoo") { + havetoPoo += data; + } + else if(printoutType == "@noPotty_W") { + noPotty_W += data; + } + else if(printoutType == "@noPotty_M") { + noPotty_M += data; + } + else if(printoutType == "@forbitten") { + forbitten += data; + } } else { // Not appending, replace the printout! if(printoutType == "@CareCheckClean") { @@ -480,6 +514,24 @@ constructPrint(string data, integer append, string printoutType) { else if(printoutType == "@oWedgieMess2") { messWedgie2 = data; } + else if(printoutType == "@forcePotty") { + carer_forcePotty = data; + } + else if(printoutType == "@havetoPee") { + havetoPee = data; + } + else if(printoutType == "@havetoPoo") { + havetoPoo = data; + } + else if(printoutType == "@noPotty_W") { + noPotty_W = data; + } + else if(printoutType == "@noPotty_M") { + noPotty_M = data; + } + else if(printoutType == "@forbitten") { + forbitten = data; + } } } @@ -721,6 +773,24 @@ displayPrintout() { } } } + else if(g_useType == "CarerPotty") { + temp = processPrint(carer_forcePotty); + } + else if(g_useType == "havetoPee") { + temp = processPrint(havetoPee); + } + else if(g_useType == "havetoPoo") { + temp = processPrint(havetoPoo); + } + else if(g_useType == "noPotty_W") { + temp = processPrint(noPotty_W); + } + else if(g_useType == "noPotty_M") { + temp = processPrint(noPotty_M); + } + else if(g_useType == "Forbitten") { + temp = processPrint(forbitten); + } if(temp) { //Allow for empty notecards to silence printouts index = llSubStringIndex(temp, " "); llSetObjectName(llGetSubString(temp, 0, index - 1)); diff --git a/Restriction b/Restriction new file mode 100644 index 0000000..81807fd --- /dev/null +++ b/Restriction @@ -0,0 +1,469 @@ +/*========================================================== +DrizzleScript restriction +Created By: Napysusy Iadyl +Original Date: Jan 29th, 2016 +GitHub Repository: https://github.com/DoomRater/DrizzleScript + +Programming Contributors: Ryhn Teardrop, Brache Spyker, Napysusy Iadyl +Resource Contributors: Murreki Fasching, Brache Spyker + +License: RPL v1.5 (Outlined at http://www.opensource.org/licenses/RPL-1.5) + +The license can also be found in the folder these scripts are distributed in. +Essentially, if you edit this script you have to publicly release the result. +(Copy/Mod/Trans on this script) This stipulation helps to grow the community and +the software together, so everyone has access to something potentially excellent. + +*Leave this header here, but if you contribute, add your name to the list!* +============================================================*/ + +/* Script used to offer and manage setting-changing menu options */ + +integer g_uniqueChan; +integer g_mainListen; //needed to keep track of the listens +key g_queueid = NULL_KEY; //keep track of people who are waiting in line to use the item +key g_currentid = NULL_KEY; +string g_currMenu; +string g_currMenuMessage; //Potentially usable to determine which timer is being used? +list g_currMenuButtons; +// +list g_settingRLV =["DONE","LOCK","★","★","Timer","SelfChange","Poo★Warning","Poo★Hold","Poo★Potty","Pee★Warning","Pee★Hold","Pee★Potty"]; +//list g_settingRLV =["DONE","LOCK","Debug","★","Timer","SelfChange","Poo★Warning","Poo★Hold","Poo★Potty","Pee★Warning","Pee★Hold","Pee★Potty"]; +integer isDebug = FALSE; +integer myRLVChanel = 34095; +integer g_RLVListen; +integer RLVenable; +// +// +//menu variables passed to preferences +integer g_wetLevel; +integer g_messLevel; +integer g_wetChance; +integer g_messChance; +integer g_wetTimer; +integer g_messTimer; +integer g_tummyRub; +integer g_tickle; +integer g_gender; +integer g_isOn; +integer g_interact; +integer g_chatter; +integer g_crinkleVolume; +integer g_wetVolume; +integer g_messVolume; +integer g_mCalcForecast; +integer g_wCalcForecast; +integer g_timesHeldWet; +integer g_timesHeldMess; +integer g_PlasticPants; +integer g_TimerRandom; +integer g_allowPeePotty; +integer g_allowPooPottty; +integer g_allowHoldPee; +integer g_allowHoldPoo; +integer g_giveWarningPee; +integer g_giveWarningPoo; +integer g_allowSelfChange; +integer g_lockdetach; // 1 = options an take off is forbitten + +init() +{ + llListenRemove(g_mainListen); + llListenRemove(g_RLVListen); + g_uniqueChan = generateChan(llGetOwner()) + 3; // Remove collision with Menu listen handler via +1 +} + +integer generateChan(key id) { + string channel = "0xE" + llGetSubString((string)id, 0, 6); + return (integer) channel; +} + +//This function serves a new menu directly to the user, and +//informs the person waiting in line that they'll need to try again +//This doesn't give the user ultimate control- carers and users are considered +//equal in this function. +offerMenu(key id, string dialogMessage, list buttons) { + llSetTimerEvent(0.0); + llListenRemove(g_mainListen); + g_currMenuButtons = buttons; + g_currMenuMessage = dialogMessage; + if(g_queueid != NULL_KEY) { + llRegionSayTo(g_queueid, 0, "I'm sorry, someone else is still using the menu! You'll need to try again after they're done."); + g_queueid = NULL_KEY; + } + g_mainListen = llListen(g_uniqueChan, "", id, ""); + llSetTimerEvent(30.0); + llDialog(id, dialogMessage, buttons, g_uniqueChan); +} + + +sendSettings() { + string csv = (string) g_wetLevel + "," + + (string) g_messLevel + "," + + (string) g_wetChance + "," + + (string) g_messChance + "," + + (string) g_wetTimer + "," + + (string) g_messTimer + "," + + (string) g_tummyRub + "," + + (string) g_tickle + "," + + (string) g_gender + "," + + (string) g_isOn + "," + + (string) g_interact + "," + + (string) g_chatter + "," + + (string) g_crinkleVolume + "," + + (string) g_wetVolume + "," + + (string) g_messVolume + "," + + (string) g_mCalcForecast + "," + + (string) g_wCalcForecast + "," + + (string) g_timesHeldWet + "," + + (string) g_timesHeldMess + "," + + (string) g_PlasticPants + "," + + (string) g_TimerRandom + "," + + (string) g_allowPeePotty + "," + + (string) g_allowPooPottty + "," + + (string) g_allowHoldPee + "," + + (string) g_allowHoldPoo + "," + + (string) g_giveWarningPee + "," + + (string) g_giveWarningPoo + "," + + (string) g_lockdetach + "," + + (string) g_allowSelfChange; + llMessageLinked(LINK_THIS, -10, csv, NULL_KEY); + g_wCalcForecast = 0; //send this only once + g_mCalcForecast = 0; //send this only once +} + +parseSettings(string temp) { + integer index; // Used to hold the location of a comma in the CSV + + index = llSubStringIndex(temp, ","); + g_wetLevel = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); // Remove the used data. + + index = llSubStringIndex(temp, ","); + g_messLevel = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wetChance = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_messChance = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wetTimer = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_messTimer = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_tummyRub = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_tickle = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_gender = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_isOn = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_interact = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_chatter = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_crinkleVolume = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wetVolume = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_messVolume = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_mCalcForecast = (integer) llGetSubString(temp, 0, index-1); + g_mCalcForecast = 0; // this is not importand vor this skript + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_wCalcForecast = (integer) llGetSubString(temp, 0, index-1); + g_wCalcForecast = 0; // this is not importand vor this skript + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldWet = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldMess = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_PlasticPants = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_TimerRandom = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPeePotty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPooPottty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_lockdetach = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + g_allowSelfChange = (integer) temp; +} + +printDebugSettings() { + llOwnerSay("restrictions\nUsed Memory: " + (string) llGetUsedMemory()); + llOwnerSay("Free Memory: " + (string) llGetFreeMemory()); + llOwnerSay("RLV viewer: " + (string) RLVenable); +} + +string m_RLVMenu() { + string settings; + settings ="\nToggel restriction settings\n\n"; + if (g_TimerRandom == 0) { + settings += "Timersettings = strictly\n"; + } + else { + settings += "Timersettings = vague\n"; + } // 0 = Timer as Set; 1 = Timer Random betwen 0 and Timer + half Timer + if (g_allowPeePotty == 0) { + settings += "Potty pee is prohibited\n"; + } + else { + settings += "Potty pee is allowed\n"; + } // 1 = Allows wearer to use the Potty + if (g_allowPooPottty == 0) { + settings += "Potty poo is prohibited\n"; + } + else { + settings += "Potty poo is allowed\n"; + } // 1 = Allows wearer to use the Potty + if (g_allowHoldPee == 0) { + settings += "Hold pee is prohibited\n"; + } + else { + settings += "Hold pee is allowed\n"; + } // 1 = Allows wearer to use the Button Hold it dosnt chang the random Holding + if (g_allowHoldPoo == 0) { + settings += "Hold poo is prohibited\n"; + } + else { + settings += "Hold poo is allowed\n"; + } // 1 = Allows wearer to use the Button Hold it dosnt chang the random Holding + if (g_giveWarningPee == 0) { + settings += "No pee warning appears\n"; + } + else { + settings += "Pee warning appears\n"; + } // 1 = Give a warning to the Wearer 10% of setTimer bevor a accident happents + if (g_giveWarningPoo == 0) { + settings += "No poo warning appears\n"; + } + else { + settings += "Poo warning appears\n"; + } // 1 = Give a warning to the Wearer 10% of setTimer bevor a accident happents + if (g_allowSelfChange == 0) { + settings += "Self Change is not allowed\n"; + } + else { + settings += "Self change is allowed\n"; + } // 1 = Allows wearer to change self + if (g_lockdetach == 0) { + settings += "Diaper is not looked\n"; + } + else { + settings += "Diaper is looked\n"; + } // 1 = options an take off is forbitten + return settings; +} + +default { + state_entry() { + init(); + } + + attach(key id) { + if(id) { // Attached + // listener RLV request + g_RLVListen = llListen(myRLVChanel, "", "", ""); + llSetTimerEvent(30.0); + RLVenable = 0; + llOwnerSay("@versionnew=" + (string) myRLVChanel); + } + } + + changed(integer change) { + if(change & (CHANGED_OWNER | CHANGED_INVENTORY)) { + init(); + } + } + + timer() { + llSetTimerEvent(0.0); + llListenRemove(g_mainListen); + if(g_queueid != NULL_KEY) { + g_currentid = g_queueid; + g_queueid = NULL_KEY; + g_currMenu = ""; + offerMenu(g_currentid, m_RLVMenu(), g_settingRLV); + } + else { + g_currentid = NULL_KEY; + } + } + + link_message(integer sender_num, integer num, string msg, key id) { + if(num == -6 || num == -9|| num == -3) { + integer index = llSubStringIndex(msg, ":"); + if(index == -1) { //received settings from Preferences + parseSettings(msg); + return; + } + } + else if(num == -11) { + if(msg == "RLV" && g_currentid == NULL_KEY || g_currentid == id) { + g_currentid = id; + g_currMenu = ""; + offerMenu(id, m_RLVMenu(), g_settingRLV); + } + else if(msg == "RLV" && g_queueid == NULL_KEY) { + g_queueid = id; + llRegionSayTo(id, 0, "Please wait a few seconds..."); + llSetTimerEvent(5.0); //five seconds should be enough time to wait in line + } + } + } + + listen(integer chan, string name, key id, string msg) { + if (chan == myRLVChanel) { + llOwnerSay(msg); + integer index = llSubStringIndex(msg, "RestrainedLove"); + if(index != -1) { //received settings from Preferences + RLVenable = 1; + llListenRemove(g_RLVListen); + if (g_lockdetach == 1) { + llOwnerSay("@detach=n"); + g_settingRLV = llListReplaceList(g_settingRLV, ["UNLOCK"], 1, 1); + } + else { + g_settingRLV = llListReplaceList(g_settingRLV, ["LOCK"], 1, 1); + } + } + + } + + if(msg == "★") {// Someone misclicked in the menu! + llRegionSayTo(id, 0, "The stars are just there to look pretty! =p"); + offerMenu(id, g_currMenuMessage, g_currMenuButtons); + } + //list g_settingRLV + else if(msg == "Debug") { + llOwnerSay(msg + m_RLVMenu()); + // RLV Viewer? + llOwnerSay("@versionnew=" + (string) myRLVChanel); + printDebugSettings(); + offerMenu(id, g_currMenuMessage, g_currMenuButtons); + } + else if(msg == "LOCK" || msg == "UNLOCK") { + if (RLVenable == 1) { //works only if RLV is enable + if (g_lockdetach == 1) { + g_lockdetach = 0; + llOwnerSay("@detach=y"); + g_settingRLV = llListReplaceList(g_settingRLV, ["LOCK"], 1, 1); + llOwnerSay("Your diaper is now unlocked"); + } + else { + g_lockdetach = 1; + llOwnerSay("@detach=n"); + g_settingRLV = llListReplaceList(g_settingRLV, ["UNLOCK"], 1, 1); + llOwnerSay("Your diaper is now locked"); + } + } + else { + llOwnerSay("RLV is not ready"); + } + sendSettings(); + } + else if(msg == "Timer") { + g_TimerRandom = !g_TimerRandom; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + else if(msg == "SelfChange") { + g_allowSelfChange = !g_allowSelfChange; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + else if(msg == "Pee★Warning") { + g_giveWarningPee = !g_giveWarningPee; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + else if(msg == "Pee★Potty") { + g_allowPeePotty = !g_allowPeePotty; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + else if(msg == "Pee★Hold") { + g_allowHoldPee = !g_allowHoldPee; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + else if(msg == "Poo★Warning") { + g_giveWarningPoo = !g_giveWarningPoo; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + else if(msg == "Poo★Hold") { + g_allowHoldPoo = !g_allowHoldPoo; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + else if(msg == "Poo★Potty") { + g_allowPooPottty = !g_allowPooPottty; + sendSettings(); + offerMenu(id, m_RLVMenu(), g_currMenuButtons); + } + } +} diff --git a/menu.lsl b/menu.lsl index 5afd0e0..dd3a638 100644 --- a/menu.lsl +++ b/menu.lsl @@ -1,10 +1,10 @@ /*========================================================== -DrizzleScript +DrizzleScript menu Created By: Ryhn Teardrop Original Date: Dec 3rd, 2011 GitHub Repository: https://github.com/DoomRater/DrizzleScript -Programming Contributors: Ryhn Teardrop, Brache Spyker +Programming Contributors: Ryhn Teardrop, Brache Spyker, Napysusy Iadyl Resource Contributors: Murreki Fasching, Brache Spyker License: RPL v1.5 (Outlined at http://www.opensource.org/licenses/RPL-1.5) @@ -19,9 +19,10 @@ the software together, so everyone has access to something potentially excellent // Main Script used for the Diaper, is the central hub of // communication between all other scripts -list g_userMenu = ["Show/Hide", "Options", "On/Off", "❤Flood❤", "Check", "Change", "Get❤Soggy", "Get❤Stinky", "Caretakers","Update"]; -list g_careMenu = ["Check", "Change", "Tease", "Raspberry", "Poke", "Options","Show/Hide", "❤ ❤ ❤", "Carer❤List"]; -list g_careMenuDiaper = ["Force❤Wet", "Force❤Mess","❤Tickle❤", "Tummy❤Rub", "Wedgie", "Spank"]; +list g_userMenu = ["Show/Hide", "Options", "On/Off", "Check", "Change", "Caretakers","Update","❤Potty❤"]; +list g_userMenuS = [ "Check" ,"❤Potty❤","Change"]; +list g_careMenu = ["Check", "Change","Force❤Potty", "❤ ❤ ❤", "Options", "❤ ❤ ❤","Show/Hide", "Carer❤List","On/Off"]; +list g_careMenuDiaper = ["Force❤Wet", "Force❤Mess","❤Tickle❤", "Tummy❤Rub", "Wedgie", "Spank", "Poke", "Raspberry", "Tease"]; list g_userCareMenu = ["<--BACK", "*", "*", "Add", "Remove", "List"]; list g_inboundMenu = ["❤Tickle❤", "Tummy❤Rub", "Tease", "Check", "Change", "Raspberry", "Spank", "Wedgie", "Poke"]; list g_offMenu = ["On", "Options", "Show/Hide"]; @@ -52,21 +53,28 @@ integer g_tummyRub = 50; //Percent integer g_tickle = 50; //Percent integer g_gender = 1; // 0:Male || 1:Female, this diaper was being edited for a girl integer g_isOn = TRUE; -integer g_interact = TRUE; //will control whether non-carers can interact with the diaper +integer g_interact = 1; //will control whether non-carers can interact with the diaper integer g_chatter = 2; // 0:self-chatter 1:Whisper chatter 2:say chatter integer g_CrinkleVolume = 10; integer g_WetVolume = 100; //this value is thirded on normal wets integer g_MessVolume = 100; integer g_PlasticPants = FALSE; integer g_timesHeldWetStrength = 3; //how many times you can hold it before you flood -integer g_timesHeldWetMultiplier = 10; //how much harder it gets each time you successfully hold it, in percent -integer g_timesHeldMessMultiplier = 10; +integer g_TimerRandom = 1; +integer g_allowPeePotty = 1; +integer g_allowPooPottty = 1; +integer g_allowHoldPee = 1; +integer g_allowHoldPoo = 1; +integer g_giveWarningPee = 1; +integer g_giveWarningPoo = 1; +integer g_allowSelfChange = 1; +integer g_lockDetach = 0; // 1 = options an take off is forbitten //End Saved Non-Carer Settings -integer g_mForecast = 0; // Determines how long until the next mess chance -integer g_wForecast = 0; // Determines how long until the next wet chance -integer timesHeldWet = 0; -integer timesHeldMess = 0; +integer g_mCalcForecast = 0; // Determines how long until the next mess chance +integer g_wCalcForecast = 0; // Determines how long until the next wet chance +integer g_timesHeldWet = 0; +integer g_timesHeldMess = 0; string g_newCarer = ""; integer g_isCrinkling = FALSE; //just to tell the diaper if someone is still walking @@ -123,7 +131,7 @@ init() } g_mainListen = llListen(g_uniqueChan, "", "", ""); g_voiceListen = llListen(1,"","",g_commandHandle); - + sendToCore("SYNC"); //catch-all command asking the HUD to send us both memory core data AND carers } @@ -186,6 +194,18 @@ stopCrinkleSound() { llStopSound(); } + +playCrinkleSound(float volume) { + if(llGetInventoryType("DrizzleCrinkleSound") != -1) { // Sound exists in inventory + llPlaySound("DrizzleCrinkleSound", volume); + } + else { + if(isDebug==TRUE) { + llOwnerSay("No Sound Found!\nPlease drop a soundfile named: DrizzleCrinkleSound into your model!"); + } + } +} + playWetSound(float volume) { if(llGetInventoryType("DrizzleWetSound") != -1) { // Sound exists in inventory llPlaySound("DrizzleWetSound", volume); @@ -246,31 +266,11 @@ parseSettings(string temp) { temp = llGetSubString(temp, index+1, -1); index = llSubStringIndex(temp, ","); - integer newTimer = (integer) llGetSubString(temp, 0, index-1); - //This is messy but needed here - if(g_wetTimer != newTimer) { - if(newTimer == 0) { - g_wForecast = 2000000000; - } - else { - g_wForecast = myTimer(newTimer * 60); - } - g_wetTimer = newTimer; - } + g_wetTimer = (integer) llGetSubString(temp, 0, index-1); temp = llGetSubString(temp, index+1, -1); index = llSubStringIndex(temp, ","); - newTimer = (integer) llGetSubString(temp, 0, index-1); - //A little more messy - if(g_messTimer != newTimer) { - if(newTimer == 0) { - g_mForecast = 2000000000; - } - else { - g_mForecast = myTimer(newTimer * 60); - } - g_messTimer = newTimer; - } + g_messTimer = (integer) llGetSubString(temp, 0, index-1); temp = llGetSubString(temp, index+1, -1); index = llSubStringIndex(temp, ","); @@ -309,25 +309,62 @@ parseSettings(string temp) { g_MessVolume = (integer) llGetSubString(temp, 0, index-1); temp = llGetSubString(temp, index+1, -1); - g_PlasticPants = (integer) temp; + index = llSubStringIndex(temp, ","); + g_mCalcForecast = (integer) llGetSubString(temp, 0, index-1); + g_mCalcForecast = 0; //Used in another script + temp = llGetSubString(temp, index+1, -1); -}//End parseSettings(string) + index = llSubStringIndex(temp, ","); + g_wCalcForecast = (integer) llGetSubString(temp, 0, index-1); + g_wCalcForecast = 0; // this is not importand vor this skript + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldWet = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_timesHeldMess = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); -// Returns a forecast duration number of seconds in the future. -// @ param [duration] : number of seconds to forecast in script runtime. -// @ return : the forcasted time for timer hub to execute associated command. -integer myTimer(integer duration) { - integer x = llRound(llGetTime()); + index = llSubStringIndex(temp, ","); + g_PlasticPants = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); - if(x + duration > 2000000000) { // Failsafe, resets script time if approaching threshold for integer capacity. - //we need to adjust the forecasts so they aren't unobtainable due to time reset - g_wForecast -= x; - g_mForecast -= x; - llResetTime(); - x = llRound(llGetTime()); - } - return x + duration; -} + index = llSubStringIndex(temp, ","); + g_TimerRandom = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPeePotty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowPooPottty = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_allowHoldPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPee = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_giveWarningPoo = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + index = llSubStringIndex(temp, ","); + g_lockDetach = (integer) llGetSubString(temp, 0, index-1); + temp = llGetSubString(temp, index+1, -1); + + g_allowSelfChange = (integer) temp; +}//End parseSettings(string) /* Sends a message to the SaveSettings script containing a CSV of all values stored here. @@ -350,11 +387,23 @@ sendSettings() { (string) g_CrinkleVolume + "," + (string) g_WetVolume + "," + (string) g_MessVolume + "," + - (string) g_PlasticPants; - //llMessageLinked(LINK_ALL_OTHERS, 6, csv, NULL_KEY); //depreciated now that memory core is no longer attached - //todo: detect if memory core is attached and has sent us data first before sending + (string) g_mCalcForecast + "," + + (string) g_wCalcForecast + "," + + (string) g_timesHeldWet + "," + + (string) g_timesHeldMess + "," + + (string) g_PlasticPants + "," + + (string) g_TimerRandom + "," + + (string) g_allowPeePotty + "," + + (string) g_allowPooPottty + "," + + (string) g_allowHoldPee + "," + + (string) g_allowHoldPoo + "," + + (string) g_giveWarningPee + "," + + (string) g_giveWarningPoo + "," + + (string) g_lockDetach + "," + + (string) g_allowSelfChange; sendToCore("SETTINGS:"+csv); //tell memory core new data - llMessageLinked(LINK_THIS, -6, csv, NULL_KEY); + g_wCalcForecast = 0; //send this only once + g_mCalcForecast = 0; //send this only once } integer generateChan(key id) { @@ -393,29 +442,6 @@ integer findPercentage(string type) { return TRUE; } } - else if(type == "W") { - toCheck = (integer) llFrand(100); // Random number between 0 and 99 - ++toCheck; // ++i used to achieve 1 - 100 range. - if(toCheck + (timesHeldWet * g_timesHeldWetMultiplier) <= g_wetChance) { //timesHeldWet is a modifier that makes you less likely to hold it. - timesHeldWet++; // The more times you hold it, the more likely you are to potty next time. - return FALSE; - } - else { - return TRUE; - } - } - else if(type == "M") {// Use Mess Chance - toCheck = (integer) llFrand(100); // Random number between 0 and 99 - ++toCheck; // ++i used to achieve 1 - 100 range. - if(toCheck + (timesHeldMess * g_timesHeldMessMultiplier) <= g_messChance) {//timesHeldMess is a modifier that makes you less likely to hold it. - timesHeldMess++; // The more times you hold it, the more likely you are to potty next time. - return FALSE; - } - else - { - return TRUE; - } - } //If we get here, we clearly don't want something unknown to return TRUE. return FALSE; } //End findPercentage(string) @@ -424,47 +450,49 @@ integer findPercentage(string type) { // @msg = The type of change occuring, e.g. Changing yourself, being changed, and being changed by a carer. // @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). handleChange(string msg, key id) { - g_wetLevel = 0; - g_messLevel = 0; - - //Let Printouts 2 know to reset its forced variables. - llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + "Change", NULL_KEY); if(msg == "Self") { - llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Self Change" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + if (g_allowSelfChange == 1) { + g_wetLevel = 0; + g_messLevel = 0; + sendSettings(); + llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Self Change" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } + else { + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Forbitten" + ":" + llKey2Name(llGetOwner()), llGetOwner()); + } } else if(msg == "Carer") { + g_wetLevel = 0; + g_messLevel = 0; + sendSettings(); llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Carer Change" + ":" + llKey2Name(id), id); } else if(msg == "Other") { + g_wetLevel = 0; + g_messLevel = 0; + sendSettings(); llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Normal Change" + ":" + llKey2Name(id), id); } -// adjustWetMessVisuals(); //This automatically happens due to the link messages we are sending. - sendSettings(); + }//End handleChange(string, id) + // This function is called to manage wettings // @msg = The type of accident occuring, e.g. wetting yourself, being tickled, and being forced by a carer to wet. // @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). handleWetting(string msg, key id) { g_wetLevel++; - if(msg == "Self") { - //Example of what message looks like: 1:2:g_wetLevel:Name - llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_wetLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); - } - else if(msg == "Timer") { - llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_wetLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); - } - else if(msg == "Tckl") { + g_timesHeldWet = 0; + //new forecast for wetting + g_wCalcForecast = 1; + sendSettings(); + if(msg == "Tckl") { llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Tickle Success" + ":" + llKey2Name(id), id); } else if(msg == "Force") { llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Force Wet" + ":" + llKey2Name(id), id); } playWetSound(g_WetVolume * .00333); - timesHeldWet = 0; - //new forecast for wetting - g_wForecast = myTimer(g_wetTimer * 60); - sendSettings(); }//End handleWettings(string, key) // This function is called to manage messings @@ -472,43 +500,19 @@ handleWetting(string msg, key id) { // @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). handleMessing(string msg, key id) { g_messLevel++; - if(msg == "Self") { - //Example of what message looks like: 1:2:g_wetLevel:Self - llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_messLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); - } - else if(msg == "Timer") { - llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "g_messLevel" + ":" + llKey2Name(llGetOwner()), llGetOwner()); - } - else if(msg == "Rub") { + g_timesHeldMess = 0; + //new forecast for messing + g_mCalcForecast = 1; + sendSettings(); + if(msg == "Rub") { llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Rub Success" + ":" + llKey2Name(id), id); } else if(msg == "Force") { llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Force Mess" + ":" + llKey2Name(id), id); } playMessSound(g_MessVolume * .00333); - timesHeldMess = 0; - //new forecast for messing - g_mForecast = myTimer(g_messTimer * 60); - sendSettings(); }//End handleMessing(string, key) -// This function is called to manage a special-case wetting. -// @msg = The type of accident occuring, e.g. naturally flooding yourself, or being potentially forced by a carer. -// @id = The key of the user who triggered this function. We use this to identify what message to send to the printouts script(s). -handleFlooding(string msg, key id) { - g_wetLevel = g_wetLevel + 4; - if(msg == "Self") { - llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Self Flood" + ":" + llKey2Name(llGetOwner()), llGetOwner()); - } - else if(msg == "Timer") { //added to allow separation of timer floods and forced floods - llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Self Flood" + ":" + llKey2Name(llGetOwner()), llGetOwner()); - } - playWetSound(g_WetVolume * .01); //todo: add a special flooding sound - timesHeldWet = 0; - //new forecast for wetting - g_wForecast = myTimer(g_wetTimer * 60); - sendSettings(); -} /* Updates wet/mess prims to show as required. @@ -525,6 +529,7 @@ adjustWetMessVisuals() { toggleHide() { if(llGetAlpha(ALL_SIDES) == 0.0) { // Hidden; Show it. llSetLinkAlpha(LINK_SET, 1.0, ALL_SIDES); + sendSettings(); } else { // Shown; Hide it. llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES); @@ -562,8 +567,8 @@ printDebugSettings() { llOwnerSay("Crinkle Volume: "+(string) g_CrinkleVolume); llOwnerSay("Wet Sound Volume: "+(string) g_WetVolume); llOwnerSay("Mess Sound Volume: "+(string) g_MessVolume); - llOwnerSay("Times Held (wet): "+(string) timesHeldWet); - llOwnerSay("Times Held (mess): "+(string) timesHeldMess); + llOwnerSay("Times Held (wet): "+(string) g_timesHeldWet); + llOwnerSay("Times Held (mess): "+(string) g_timesHeldMess); llOwnerSay("Used Memory: " + (string) llGetUsedMemory()); llOwnerSay("Free Memory: " + (string) llGetFreeMemory()); } @@ -623,7 +628,7 @@ makeButtonsForCarers() { //construct g_ButtonCarers from g_Carers } // Returns a value from 0 to 2 to classify the menu access level for a given user. -// @id - The user whose access level is to be assessed. +// @id - The user or object whose access level is to be assessed. // 0 = Owner, 1 = Carer, 2 = Outsider integer getToucherRank(key id) { if(llGetOwnerKey(id) == llGetOwner()) { @@ -641,28 +646,43 @@ mainMenu(key id) { integer userRank = getToucherRank(id); if(g_isOn) { // Diaper's On if(userRank == 0) { - llDialog(llGetOwner(), "User Menu for " + llKey2Name(llGetOwner()) + "'s diaper.", g_userMenu, g_uniqueChan); + if(g_interact == 2 || g_lockDetach == 1) { //hide Option when interaction set to only caretaker + llDialog(llGetOwner(), "User Menu for " + llKey2Name(llGetOwner()) + "'s diaper.", g_userMenuS, g_uniqueChan); + } + else { + llDialog(llGetOwner(), "User Menu for " + llKey2Name(llGetOwner()) + "'s diaper.", g_userMenu, g_uniqueChan); + } } else if(userRank == 1) { - llDialog(id, "Carer Menu for " + llKey2Name(llGetOwner()) + "'s diaper.", g_careMenu, g_uniqueChan); + llDialog(llGetOwnerKey(id), "Carer Menu for " + llKey2Name(llGetOwner()) + "'s diaper.", g_careMenu, g_uniqueChan); } //todo: Allow restriction to this menu! else if(userRank == 2 && g_interact == 1) { - llDialog(id, "General Menu for " + llKey2Name(llGetOwner()) + "'s diaper.", g_inboundMenu, g_uniqueChan); + llDialog(llGetOwnerKey(id), "General Menu for " + llKey2Name(llGetOwner()) + "'s diaper.", g_inboundMenu, g_uniqueChan); } else if(g_diaperType == "Kawaii") { - nedryError(id); + nedryError(llGetOwnerKey(id)); } } else { // Diaper's Off if(userRank == 0) { + if (g_interact == 2) { //hide Option when interaction set to only caretaker { + if(g_diaperType == "Kawaii") { + nedryError(llGetOwner()); + } + else { + llOwnerSay("Your diaper is off. Sorry, you can't turn it back on!"); + } + } + else { llDialog(llGetOwner(), "Your diaper is off. No pottying or carer scanning will be done, but you can still change settings!", g_offMenu, g_uniqueChan); + } } else if(userRank == 1) { - llDialog(id, "Good news! You're a carer. This means you can turn this diaper back on if you wish!", g_offMenu, g_uniqueChan); + llDialog(llGetOwnerKey(id), "Good news! You're a carer. This means you can turn this diaper back on if you wish!", g_offMenu, g_uniqueChan); } else if(g_diaperType == "Kawaii") { - nedryError(id); + nedryError(llGetOwnerKey(id)); } } } @@ -714,7 +734,16 @@ default { attach(key id) { if(id) { // Attached - + string carers = llDumpList2String(g_Carers,", "); + if (carers == "") { + llOwnerSay("No carer on your list- Resetting interaction level."); + g_interact = 0; + g_lockDetach = 0; + } + else { + llOwnerSay("Carer List: " + carers); + } + sendSettings(); // send settings to all other skripts } else if(g_exitText) { @@ -724,6 +753,11 @@ default { } } + changed(integer change) { + if(change & CHANGED_OWNER) { + init(); + } + } //Searches the area, stashing the names of those nearby in one list, and their keys in another sensor(integer num_detected) { integer i = 0; @@ -827,11 +861,9 @@ default { } else if(g_isOn) { //for future use with potty training - if(msg == "Hold❤It" && userRank == 0) { - g_userResponded = TRUE; - } - else if(msg == "Go❤Potty" && userRank == 0) { - g_userResponded = TRUE; + if(msg == "❤Potty❤" && userRank == 0) { + sendSettings(); //make sure preferences knows the current settings + llMessageLinked(LINK_THIS, -8, msg, id); // Tell Preferences script to talk to id } //Carers stuff else if(llKey2Name(id) == g_newCarer) { //shaping up security @@ -889,18 +921,6 @@ default { else if(msg == "<--BACK") { mainMenu(id); } - else if(msg == "Get❤Soggy" && userRank == 0) { - handleWetting("Self", id); - mainMenu(id); - } - else if(msg == "Get❤Stinky" && userRank == 0) { - handleMessing("Self", id); - mainMenu(id); - } - else if(msg == "❤Flood❤" && userRank == 0) { - handleFlooding("Self", id); - mainMenu(id); - } else if(msg == "Force❤Mess" && userRank == 1) { handleMessing("Force", id); mainMenu(id); @@ -909,6 +929,14 @@ default { handleWetting("Force", id); mainMenu(id); } + else if (msg == "Force❤Potty" && userRank == 1) { + //new check forgast potty + g_wCalcForecast = 2; + g_mCalcForecast = 2; + sendSettings(); + llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "CarerPotty" + ":" + llKey2Name(id), id); + mainMenu(id); + } else if(msg == "Check") { if(userRank == 0) { // User checked self llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Self Check" + ":" + llKey2Name(llGetOwner()), llGetOwner()); @@ -950,7 +978,7 @@ default { mainMenu(id); } //check for carer userrank or if outsiders are allowed to trigger events - else if(userRank == 1 || g_interact == TRUE) { + else if(userRank == 1 || g_interact == 1) { if(msg == "Tummy❤Rub") { if(findPercentage("Rub")) { // They messied! handleMessing("Rub", id); @@ -974,6 +1002,7 @@ default { mainMenu(id); } else if(msg == "Poke") { + playCrinkleSound(g_CrinkleVolume*0.01); llMessageLinked(LINK_THIS, -2, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Poke" + ":" + llKey2Name(id), id); mainMenu(id); } @@ -986,6 +1015,7 @@ default { mainMenu(id); } else if(msg == "Wedgie") { + playCrinkleSound(g_CrinkleVolume*0.01); llMessageLinked(LINK_THIS, -4, (string) g_gender + ":" + (string) g_wetLevel + ":" + (string) g_messLevel + ":" + "Wedgie" + ":" + llKey2Name(id), id); mainMenu(id); } @@ -996,47 +1026,6 @@ default { // This event is used to evaluate/reset the forecasts for wetting or messing, as well // as determining whether a user succeeds in holding it. timer() { - if(g_isOn == TRUE) { - //Timer of 0 (Off) prevent accidents. - if(g_wetTimer == 0) { - g_wForecast = 2000000000; - } - //Timer of 0 (Off) prevent accidents. - if(g_messTimer == 0) { - g_mForecast = 2000000000; - } - integer currentTime = llRound(llGetTime()); - if(currentTime <= 60) { - return; - } - // If both wet and mess forecasts are past their time. . . - if(g_wForecast <= currentTime && g_mForecast <= currentTime) { - // New wet forecast. This means the user will mess by default. :D - g_wForecast = myTimer(g_wetTimer * 60); - } - - if(g_wForecast <= currentTime) { // The forecasted time is in the past - if(findPercentage("W") == TRUE) { - if(timesHeldWet >= g_timesHeldWetStrength) { // If the user has held it a lot. This time they flood. - handleFlooding("Timer", llGetOwner()); - } - else { - handleWetting("Timer", llGetOwner()); // "Timer" is the cause of the wetting, llGetOwner is to determine what printout to trigger. - } - } - else { - //todo: potty training handler will go here! - } - g_wForecast = myTimer(g_wetTimer * 60); // New Forecast Regardless - } - - if(g_mForecast <= currentTime) { - if(findPercentage("M") == TRUE) { - handleMessing("Timer", llGetOwner()); - } - g_mForecast = myTimer(g_messTimer * 60); - } - }//End g_isOn if //reset the Kawaii error count each minute g_errorCount = 0; }//End of timer @@ -1049,6 +1038,7 @@ default { // 1 to 5 = Storage Prim Messages // 6 = Setting Message from Memory Core // -6 = Setting Message to Preferences + // -8 = Potty link_message(integer sender_num, integer num, string msg, key id) { string temp; @@ -1058,11 +1048,10 @@ default { else if(num == -2 || num == -4) return; // Printouts is being used else if(num == -7) return; // Particles is being used */ - else if(num == -3) { //Update from Preferences + else if(num == -3 || num == -9 || num == -10) { //Update from Preferences integer index = llSubStringIndex(msg, ":"); if(index == -1) { //received settings from Preferences sendToCore("SETTINGS:"+msg); - parseSettings(msg); return; } string setting = llGetSubString(msg, 0, index-1);