Apps Home
|
Create an App
minifieddevoted
Author:
chadmck
Description
Source Code
Launch App
Current Users
Created by:
Chadmck
function ParseCommand(e){var t=e.m.split(" "),r=t[0];if(!r)return!1;var s=this.dataStore.getUserSecurity(e.user),o=this.dataStore.getUserFromList(e.user),n=this.dataStore.getUserLevel(o);switch(r){case"/save":return!(s<3)&&(this.dataStore.save(),!0);case"/greeting":return 3==s&&greeting(),!0;case"/bestow":if(s<3)return!1;var a=this.dataStore.getUserFromList(t[1]),l=t[2];return this.dataStore.giftExperience(a.username,parseInt(l),t[2]),selfNotice("You have gifted "+l+" experience to "+a.username),!0;case"/bonusxp":return!(s<3)&&(setBonus(t[1]),!0);case"/newevent":return!(s<3)&&(this.dataStore.newEvent(t[1].replace(/_/g," "),t[2].replace(/_/g," "),t[3],t[4].replace(/_/g," "),t[5],!0),!0);case"/colors":return!(s<3)&&(showColors(),!0);case"/killevent":return!(s<3)&&(this.dataStore.getEventFromList(t[1]).Remove(),!0);case"/status":return announceAllEvents(e.user),!0;case"/help":return showCommands(o),!0;case"/tick":return!(s<3)&&(tick=t[1]?1e3*t[1]:3e4,!0);case"/roster":return!(s<3)&&(roster(t[1]),!0);case"/info":return info(e.user),!0;case"/speak":return n<Powers.Speak.rankReq||(speak(o),!0);case"/minor":return n<Powers.MinorBless.rankReq||(minor(o),!0);case"/proclaim":if(n<Powers.Proclamation.rankReq)return!0;u="";for(i=1;i<t.length;i++)u+=" ",u+=t[i];return proclaim(o,u),!0;case"/major":return n<Powers.MajorBless.rankReq||(major(o),!0);case"/declare":if(n<Powers.Declaration.rankReq)return!0;var u="";for(i=1;i<t.length;i++)u+=" ",u+=t[i];return declare(o,u),!0;default:return!1}}function eventSummary(){if(!(this.dataStore.events.length=0)){for(var e="Currently Running Events: ",t=0;t<this.dataStore.events.length;t++){var r=this.dataStore.events[t];e=e+r.title+" "+r.tip_total+"/"+r.goal+" Reward - "+r.reward+" | "}cb.sendNotice(e,"","",Colors.wine),cb.setTimeout(eventSummary,tick)}}function announceAllEvents(e){for(var t=0;t<this.dataStore.events.length;t++)this.dataStore.events[t].Announce(e)}function speak(e){msg=e.username+" has used their speak to the goddess power. You should PM them.",selfNotice(msg)}function minor(e){msg=e.username+" has used their minor blessing power...give them something already!",selfNotice(msg)}function major(e){msg=e.username+" has used thier major blessing power ...give them something good!",selfNotice(msg)}function proclaim(e,t){cb.changeRoomSubject(t)}function declare(e,t){cb.sendNotice("This feature is not ready, message the Goddess your rule :) ",e.username)}function showCommands(e){var t=this.dataStore.getUserLevel(e),r="The following is the list of commands that you have available at your rank and level, along with a brief description.Some of these commands have more detailed help using /help *command*\n";r+="/help - this command, provides help on the app.\n",r+="/status - return information on any running events and their totals.\n",r+="/info - get general information regarding the Devoted guild system, the room in general , and basic help.\n",3==this.dataStore.getUserSecurity(e.username)&&(r+="/tick - change the interval between event updates to the room (Default is 30 seconds) - format: /tick *seconds*\n",r+="/save - provides the save data string as a notice to you alone. This string should be copied to a file and saved for use next launch\n",r+="/greeting - displays the basic room greeting to the room.\n",r+="/bestow - grant experience to a user, format: /bestow *user* *amount* *announce* , where announce is a true or false.\n",r+="/newevent - begin a new event - titles must be unique - format: /newevent *title* *description* *goal* *reward* *battle* - where battle is a true or false. To imitate spaces in title and description , use underscores.\n",r+="/killevent - stops an event prematurely - format: /killevent *title*.\n",r+="/colors - displays a string in each available color also showing its name.\n",r+="/roster - display a roster of the devoted. Format: /roster *user* - if user is ommitted it goes to the room.\n"),t>=Powers.Speak.rankReq&&(r+="/speak - call upon your speak to the goddess power.\n"),t>=Powers.MinorBless.rankReq&&(r+="/minor - request a minor blessing from the goddess.\n"),t>=Powers.MajorBless.rankReq&&(r+="/major - request a major blessing from the goddess.\n"),t>=Powers.Proclamation.rankReq&&(r+="/proclaim *subject* - make a proclamation (change room subject).\n"),t>=Powers.Declaration.rankReq&&(r+="/declare *rule* - make the goddess obey your whim for one hour.\n"),cb.sendNotice(r,e.username,"",Colors.blood)}function setBonus(e){"off"==e?(this.XpMod=1,cb.sendNotice("Bonus Experience is over, orders of the Goddess","","",Colors.drearysky)):(this.XpMod=parseInt(e),cb.sendNotice("An Experience Bonus of "+e+"x has been initiated. All Praise the Goddess!!"))}function selfNotice(e){cb.sendNotice(e,cb.room_slug,Colors.black,Colors.white)}function showColors(){for(var e in Colors)cb.sendNotice("This line has been colored using "+e,cb.room_slug,"",Colors[e])}function format_username(e){return null===e?"--":e.substring(0,12)}function announceNewConsort(){var e="A new Consort has been chosen by the Goddess! Congratulations "+this.dataStore.high_tip_username+", you have claimed this title with an offering of "+this.dataStore.high_tip_amount+"tokens. The Goddess smiles upon you , pondering what to do with her new toy.";cb.sendNotice(e,"","",Colors.rose)}function announceConsort(){if(null==this.dataStore.high_tip_username)return!1;var e="The Goddess' current Consort is "+this.dataStore.high_tip_username+" with an offering of "+this.dataStore.high_tip_amount+"tokens. Become the Godess' new favorite plaything by showering her with a greater offering!";cb.sendNotice(e,"","",Colors.rose),cb.setTimeout(announceConsort,tick)}function info(e){var t="This room operates a guild management app for the Devoted guild. Show love for your Goddess of Pleasure, HaileyRains by joining the Devoted! As a member of the devoted, your tips will earn you experience, and that experience will earn you levels.Raising levels will raise your rank, and with increased rank comes increased power within the guild. Each rank has powers that are available to it , as well as additional bonuses as the Goddess wishes. This will be an ever evolving system, and you are free to supply Hailey with suggestions for additions you would like to see. This info command will be updated frequently with new information. Relax, have fun, and be one of the Devoted! \n";t+="Level and Rank Structure\n",t+="============================\n";var r="";for(i=0;i<Levels.length;i++){var s=this.dataStore.getUserRank(i+1),o="";s.name!=r&&(r=s.name,o="Rank: "+s.name),t+="Level "+i+" Experience: "+Levels[i]+" "+o+"\n"}t+="\n",t+="Powers:\n",t+="=========================\n";for(var n in Powers){var a=Powers[n],l=this.dataStore.getRankByLevelReq(a.rankReq);t+=a.name+": "+a.helpText+" | Rank Required: "+l.name+"\n"}t+="\n",t+="Goddess' Consort: this is a fancy , Goddess pleasing term for the room's highest tipper. This favored toy of the Godess will receive a random blessing when entering the temple.\n",cb.sendNotice(t,e,"",Colors.drearysky)}function roster(e){var t=" Roster of the Devoted \n";t+="===========================\n";for(var r=this.dataStore.users.sort(mycomparator),s=0;s<r.length;s++){var o=r[s],n=this.dataStore.getUserLevel(o),a=this.dataStore.getUserRank(n),i="";o.username==this.dataStore.high_tip_username&&(i="*CONSORT*"),t+=o.username+" | Level "+n+" "+a.name+" "+i+"\n"}cb.sendNotice(t,e,"",Colors.pumpkin)}function mycomparator(e,t){return parseInt(e.experience)-parseInt(t.experience)}function greeting(e){var t="Welcome to the domain of your Goddess "+cb.room_slug+". This room is powered by -=Devoted=- App by ChadMck.\nGive offerings to the goddess , and become a member of the Devoted! In order to participate, you must be a loyal follower, so go ahead and take care of that now. Your Goddess Awaits.....";if(e){var r=this.dataStore.getUserFromList(e),s=this.dataStore.getUserLevel(r);s>0&&(t="Welcome back "+r.username+"! You are currently a level "+s+" "+this.dataStore.getUserRank(s).name+" of the devoted!\nContinue to please your Goddess, and the rewards shall be great indeed.\n"),r.username==this.dataStore.high_tip_username&&cb.sendNotice("The Goddess' Consort has arrived! All praise "+r.username+", the most deviant, devoted worshipper of the Goddess!","","",Colors.royal)}cb.sendNotice(t,e,"",Colors.lilac,"bold")}function init(){this.dataStore=(new Data).load(cb.settings.Data),this.dataStore.loadEvents(),greeting(),cb.setTimeout(this.eventSummary,tick),cb.setTimeout(this.announceConsort,tick)}var XpMod=1,tick=6e4,tips_this_session=0,hinttask=0,Colors={blood:"#b30000",red:"#ff0000",lilac:"#c299ff",darkblue:"#0000b3",orange:"#ff471a",gold:"#ffd11a",silver:"#f2f2f2",grass:"#2eb82e",rose:"#ff66cc",pussy:"#ff99cc",dirt:"#663300",royal:"#6600cc",absence:"#1a1a00",canary:"#ffff66",black:"#000000",white:"#ffffff",pumpkin:"#ff9933",bark:"#67594c",seafoam:"#ccffcc",grey:"#bfbfbf",softyellow:"#ffffe5",babybreath:"#e5ffff",cyan:"#1affff",teal:"#66ffff",velvet:"#b784a7",wine:"#ffb3b3",toupe:"#b38b6d",lime:"#8cff1a",drearysky:"#94bfac",olive:"#4b5729",lupin:"#f7d0cf",scarlet:"#FD0E35",tangerine:"#FF9966"},Genders={male:{longDesc:"male",cbVal:"m",pronoun:"he",posessive:"his"},female:{longDesc:"female",cbVal:"f",pronoun:"she",posessive:"her"},trans:{longDesc:"transsexual",cbVal:"s",pronoun:"(s)he",posessive:"his/her"},couple:{longDesc:"a couple",cbVal:"c",pronoun:"they",posessive:"their"},invalid:{longDesc:"unknown",cbVal:"",pronoun:"he",posessive:"his"}};Genders.getByCbVal=function(e){for(var t in this)if(this[t].cbVal==e)return this[t];return Genders.invalid};var Levels=[0,100,250,500,1e3,2e3,5e3,1e4,25e3,5e4,1e5,25e4,5e5,75e4,1e6,15e5,25e5],Ranks={Follower:{name:"Follower",powers:0,title:"",color:"",levelReq:0},Initiate:{name:"Initiate",powers:0,title:"",color:Colors.absence,levelReq:1},Novice:{name:"Novice",powers:1,title:"",color:Colors.grass,levelReq:3},Devoted:{name:"Devoted",powers:2,title:"",color:Colors.darkblue,levelReq:5},Watcher:{name:"Watcher",powers:3,title:"Watcher",color:Colors.silver,levelReq:8},Obsessed:{name:"Obsessed",powers:4,title:"Obsessed",color:Colors.gold,levelReq:10},Favored:{name:"Favored",powers:5,title:"Favored",color:Colors.pussy,levelReq:13},Master:{name:"Master",powers:7,title:"Eminence",color:Colors.royal,levelReq:16}},Powers={Speak:{name:"Speak with the Goddess",cmd:"/speak",helpText:"/speak",usesPerDay:0,usesLeft:0,rankReq:1},MinorBless:{name:"Request Minor Blessing",cmd:"/minor",helpText:"/minor",usesPerDay:0,usesLeft:0,rankReq:3},Proclamation:{name:"Make a Proclomation (Change Subject)",cmd:"/proclaim",helpText:"/proclaim *Subject*",usesPerDay:0,usesLeft:0,rankReq:5},MajorBless:{name:"Request Major Blessing",cmd:"/major",helpText:"/major",usesLeft:0,usesPerDay:0,rankReq:8},Declaration:{name:"Declare a Rule (Within Reason)",cmd:"/declare",helpText:"/declare *rule request*",usesPerDay:0,usesLeft:0,rankReq:10}},Data=function(e){var t=new Object;return e?(t.high_tip_username=e.high_tip_username,t.high_tip_amount=e.high_tip_amount,t.last_tip_username=e.last_tip_username,t.last_tip_amount=e.last_tip_amount,t.users=e.users||new Array,t.events=e.events||new Array):(t.high_tip_username=null,t.high_tip_amount=0,t.last_tip_username=null,t.last_tip_amount=0,t.users=new Array,t.events=new Array),t.loadEvents=function(){var e=this,r=e.events;e.events=new Array;for(var s=0;s<r.length;s++){var o=r[s],n=t.newEvent(o.title,o.description,o.goal,o.reward,o.battle);n.highest_tip=o.highest_tip,n.highest_tipper=o.highest_tipper,n.tip_total=o.tip_total,e.events.push(n)}},t.load=function(e){return e?new Data(JSON.parse(e)):Data()},t.save=function(){for(var e=new Array,t=0;t<this.users.length;t++)(r=this.users[t]).experience<1&&e.push(r);for(t=0;t<e.length;t++){var r=e[t];this.users=cbjs.arrayRemove(this.users,r)}selfNotice(JSON.stringify(this))},t.newEvent=function(e,t,r,s,o,n){var a=this,i=new Object;return i.title=e,i.description=t,i.goal=r,i.reward=s,i.battle=o,i.highest_tipper="",i.highest_tip=0,i.tip_total=0,a.getEventFromList(e)?(selfNotice("There is already an Event by the title "+e+". Please create the event again with a different name , or end the previous event"),!1):(i.tipTowardGoal=function(e,t){if(i.tip_total+=t,t>i.highest_tip&&(i.highest_tip=t,i.highest_tipper=e),i.tip_total>=i.goal)i.goalMet();else{var r=e+" has offered "+t+" toward "+i.title+". The Goddess Thanks You!\nCurrently at "+i.tip_total+"/"+i.goal+"!";cb.sendNotice(r,"","",Colors.red)}},i.goalMet=function(){var e=i.title+" has been completed! The Goddess is pleased!\nHere comes the Reward! "+i.reward;cb.sendNotice(e,"","",Colors.red),selfNotice("You owe the room a "+i.reward),i.Remove()},i.Announce=function(e){e||(e="");var t="Show your devotion and "+i.title+"!\n"+i.description+"\nWe have currently collected "+i.tip_total+" of the "+i.goal+" required in offerings.\nA "+i.reward+" awaits our Success!";cb.sendNotice(t,e,"",Colors.velvet)},i.Remove=function(){a.events=cbjs.arrayRemove(a.events,i),selfNotice("Event "+i.title+" has been removed"),i=null},1!=n?i:(a.events.push(i),void i.Announce()))},t.getEventFromList=function(e){for(var t=this,r=0;r<t.events.length;r++){var s=t.events[r];if(s.title==e)return s}return!1},t.getUserFromList=function(e){for(var t=this,r=0;r<t.users.length;r++){var s=t.users[r];if(s.username==e)return s}var o=new Object;return o.username=e,o.experience=0,o},t.getUserLevel=function(e){return e.experience>Levels[1]?e.experience>Levels[2]?e.experience>Levels[3]?e.experience>Levels[4]?e.experience>Levels[5]?e.experience>Levels[6]?e.experience>Levels[7]?e.experience>Levels[8]?e.experience>Levels[9]?e.experience>Levels[10]?e.experience>Levels[11]?e.experience>Levels[12]?e.experience>Levels[13]?e.experience>Levels[14]?e.experience>Levels[15]?e.experience>Levels[16]?16:15:14:13:12:11:10:9:8:7:6:5:4:3:2:1:0},t.getRankByLevelReq=function(e){var t=Ranks.Follower;for(var r in Ranks)Ranks[r].levelReq==e&&(t=Ranks[r]);return t},t.getUserRank=function(e){var t=Ranks.Follower;for(var r in Ranks)e>=Ranks[r].levelReq&&Ranks[r].levelReq>t.levelReq&&(t=Ranks[r]);return t},t.getUserSecurity=function(e){if(e==cb.room_slug)return 3;var t=this.getUserLevel(this.getUserFromList(e));return t?t>13?2:t>0?1:0:0},t.experienceGain=function(e,t){var r=this,s=r.getUserLevel(e);r.users=cbjs.arrayRemove(r.users,e),e={username:e.username,experience:parseInt(e.experience)+t};var o=r.getUserLevel(e);return r.users.push(e),o>s&&r.levelUp(e,s,o),e},t.levelUp=function(e,t,r){var s="Congratulations are in order! "+e.username+"'s devotion has brought them closer to the Goddess! They are now a level "+r+" "+this.getUserRank(r).name+" of the Devoted!";cb.sendNotice(s,"","",Colors.tangerine)},t.giftExperience=function(e,r,s){var o=this.getUserFromList(e);t.experienceGain(o,r),cb.sendNotice(r+" experience has just been bestowed upon you by the Goddess! Rejoice!",e,"",Colors.lilac),s&&cb.sendNotice(r+" experience has just been bestowed upon "+e+" by the Goddess! Rejoice!","","",Colors.lilac),cb.drawPanel()},t.ManageUserList=function(e){var r=this.getUserFromList(e.from_user),s=e.amount*XpMod;r=t.experienceGain(r,s);var o=this.getUserLevel(r),n=r.username+" has just placed an offering of "+e.amount+" and gained "+s+" experience ";return XpMod>1&&(n=n+"( "+XpMod+"x Bonus Exp)"),n=n+"! "+Genders.getByCbVal(e.from_user_gender).pronoun+" is a Level "+o+" "+this.getUserRank(o).name+" member of the Devoted!",cb.sendNotice(n,"","",Colors.pussy),r},t};cb.settings_choices=[{name:"Data",type:"str",minLength:1,maxLength:8e5,required:!1}],cb.onMessage(function(e){return ParseCommand(e)&&(e["X-Spam"]=!0),e}),cb.onEnter(function(e){greeting(e.user)}),cb.onTip(function(e){var t=this;t.dataStore.total_tipped+=e.amount,t.tips_this_session+=e.amount;for(var r=this.dataStore.ManageUserList(e),s=0;s<t.dataStore.events.length;s++)t.dataStore.events[s].tipTowardGoal(r.username,e.amount);this.dataStore.last_tip_amount=e.amount,this.dataStore.last_tip_username=e.from_user,e.amount>this.dataStore.high_tip_amount&&(this.dataStore.high_tip_amount=e.amount,this.dataStore.high_tip_username=e.from_user,announceNewConsort()),cb.drawPanel()}),cb.onDrawPanel(function(e){if(e.user==cb.room_slug)return{template:"3_rows_of_labels",row1_label:"Tips this session :",row1_value:""+this.tips_this_session,row2_label:"Consort:",row2_value:this.dataStore.high_tip_username+" ("+this.dataStore.high_tip_amount+")",row3_label:"Latest Tip Received:",row3_value:this.dataStore.last_tip_username+" ("+this.dataStore.last_tip_amount+")"};var t=this.dataStore.getUserFromList(e.user),r=this.dataStore.getUserLevel(t);return{template:"3_rows_12_22_31",row1_label:"Devoted Level :",row1_value:r,row2_label:"Devoted Rank :",row2_value:this.dataStore.getUserRank(r).name,row3_value:t.experience+"/"+Levels[r+1]+" experience to next level."}}),init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.