Apps Home
|
Create an App
Gold Kingdom
Author:
main_account
Description
Source Code
Launch App
Current Users
Created by:
Main_Account
var colors = { red: { solid: "rgba(213, 0, 50, {})" }, blue: { solid: "rgba(24, 4, 103, {})" }, green: { solid: "rgba(0, 105, 0, {})" }, orange: { solid: "rgba(255, 124, 11, {})" }, purple: { solid: "rgba(97, 49, 117, {})" }, pink: { solid: "rgba(238, 19, 123, {})" }, yellow: { solid: "rgba(226, 238, 31, {})" }, brown: { solid: "rgba(100, 36, 36, {})" }, black: { solid: "rgba(0, 0, 0, {})" }, gray: { solid: "rgba(105,105,105,{})" }, white: { solid: "rgba(255, 255, 255,{})" }, crimson: { solid: "rgba(237, 20, 61,{})" }, violet: { solid: "rgba(238, 130, 238,{})" }, gold: { solid: "rgba(255, 215, 0,{})" }, maroon: { solid: "rgba(128, 0, 0,{})" }, wheat: { solid: "rgba(245, 222, 179,{})" }, cyan: { solid: "rgba(0, 255, 255,{})" }, magenta: { solid: "rgba(255, 0, 255,{})" }, navy: { solid: "rgba(0, 0, 128,{})" }, salmon: { solid: "rgba(250, 128, 114,{})" }, "matte black": { solid: "rgba(37, 37, 37,{})" }, teal: { solid: "rgba(0, 128, 128,{})" } } var gradients = { "star wine": "linear-gradient(to right, #b8cbb8 0%, #b8cbb8 0%, #b465da 0%, #cf6cc9 33%, #ee609c 66%, #ee609c 100%)", "old hat": "linear-gradient(to right, #e4afcb 0%, #b8cbb8 0%, #b8cbb8 0%, #e2c58b 30%, #c2ce9c 64%, #7edbdc 100%)", "deep blue": "linear-gradient(to right, #6a11cb 0%, #2575fc 100%)", "shy rainbow": "linear-gradient(120deg, #eea2a2 0%, #bbc1bf 19%, #57c6e1 42%, #b49fda 79%, #7ac5d8 100%)", "kind steel": "linear-gradient(-20deg, #e9defa 0%, #fbfcdb 100%)", "sharp blue": "linear-gradient(to right, #00c6fb 0%, #005bea 100%)", "soft cherish": "linear-gradient(to right, #dbdcd7 0%, #dddcd7 24%, #e2c9cc 30%, #e7627d 46%, #b8235a 59%, #801357 71%, #3d1635 84%, #1c1a27 100%)", "premium dark": "linear-gradient(to right, #434343 0%, black 100%)", "alchemist lab": "linear-gradient(-20deg, #d558c8 0%, #24d292 100%)", "happy memories": "linear-gradient(-60deg, #ff5858 0%, #f09819 100%)", "frozen berry": "linear-gradient(to right, #e8198b 0%, #c7eafd 100%)", "young grass": "linear-gradient(to right, #9be15d 0%, #00e3ae 100%)", "sea lord": "linear-gradient(-225deg, #2CD8D5 0%, #C5C1FF 56%, #FFBAC3 100%)", "sugar lollipop": "linear-gradient(-225deg, #A445B2 0%, #D41872 52%, #FF0066 100%)", "blessing": "linear-gradient(to right, #fddb92 0%, #d1fdff 100%)", "happy fish": "linear-gradient(to right,#89f7fe,#66a6ff)", "cold night": "linear-gradient(315deg,#380036,#0CBABA)", "bloody morning": "linear-gradient(to right,#B91372,#6B0F1A)", "mars conquest": "linear-gradient(to right,#EC9F05,#FF4E00)", "silent birth": "linear-gradient(30deg,#E61D8C,#C7E9FB)", "wet desert": "linear-gradient(to right,#F9ABA4,#EFECEC)", "bloody snow": "linear-gradient(to right,#FE0944,#FEAE96)", "pink lemon": "linear-gradient(42deg,#ff706e,#ff163f,#ffce00)" } var stickerCollection = [":snail_sticker",":crab_sticker",":frog_sticker",":exam_sticker",":key_sticker",":apple_sticker",":flask_sticker", ":ant_sticker", ":coffee_sticker", ":toast_sticker", ":pineapple_sticker", ":danger_sticker", ":gift_sticker", ":planet_sticker", ":cotton_candy_sticker"]; var wordList = ["anencephalous", "argle-bargle", "batrachomyomachy", "billingsgate", "bloviate", "blunderbuss", "borborygm", "boustrophedon", "bowyang", "brouhaha", "bumbershoot", "callipygian", "canoodle", "cantankerous", "catercornered", "cockalorum", "cockamamie", "codswallop", "collop", "collywobbles", "comeuppance", "crapulence", "crudivore", "discombobulate", "donnybrook", "doozy", "dudgeon", "ecdysiast", "eructation", "fard", "fartlek", "fatuous", "filibuster", "firkin", "flibbertigibbet", "flummox", "folderol", "formication", "fuddy-duddy", "furbelow", "furphy", "gaberlunzie", "gardyloo!", "gastromancy", "gazump", "gobbledygook", "gobemouche", "godwottery", "gongoozle", "gonzo", "goombah", "hemidemisemiquaver", "hobbledehoy", "hocus-pocus", "hoosegow", "hootenanny", "jackanapes", "kerfuffle", "klutz", "la-di-da", "lagopodous", "lickety-split", "lickspittle", "logorrhea", "lollygag", "malarkey", "maverick", "mollycoddle", "mugwump", "mumpsimus", "namby-pamby", "nincompoop", "oocephalus", "ornery", "pandiculation", "panjandrum", "pettifogger", "pratfall", "quean", "rambunctious", "ranivorous", "rigmarole", "shenanigan", "sialoquent", "skedaddle", "skullduggery", "slangwhanger", "smellfungus", "snickersnee", "snollygoster", "snool", "tatterdemalion", "troglodyte", "turdiform", "unremacadamized"]; var activeWord = ""; var activeSticker = ""; var gameMode = ""; var claimed = false; class User { constructor(name, points, bColor = "white", tone = .1) { this.name = name; this.points = points; this.bColor = bColor; this.fColor = "black"; this.tone = tone; this.stickers = []; this.mode = "solid"; //solid, gradient this.gradient = ""; this.participated = false; //played game this round this.rankReward = false; //displayed the fontcolor and gradient message } findRank(points) { let newTone; switch (true) { case (points >= 200): if (!this.rankReward) { cb.sendNotice("you have unlocked the gradient store, check it out with -gradients.", this.name, "#518fff", "#fff"); this.rankReward = true; } newTone = 1; break; case (points >= 120): if (!this.rankReward) { cb.sendNotice("you have unlocked the gradient store, check it out with -gradients.", this.name, "#518fff", "#fff"); this.rankReward = true; } newTone = 1; break; case (points >= 100): if (!this.rankReward) { cb.sendNotice("you have unlocked the gradient store, check it out with -gradients.", this.name, "#518fff", "#fff"); this.rankReward = true; } newTone = 1; break; case (points >= 80): this.rankReward = false; newTone = .8; break; case (points >= 60): this.rankReward = false; newTone = .6; break; case (points >= 40): this.rankReward = false; newTone = .4; break; case (points >= 20): this.rankReward = false; newTone = .2; break; default: this.rankReward = false; newTone = .1; } this.tone = newTone; } } var allUsers = {} cb.onEnter(function (user) { if (!allUsers[user.user]) { allUsers[user.user] = new User(user.user, 0); } cb.sendNotice("Psst! You wanna change your chat color? Just type -color", user.user, "#518fff", "#fff") cb.sendNotice("you have unlocked -fontcolor, type -fontcolor green to try it out.", user.user, "#518fff", "#fff"); }) var muted = []; cb.onMessage(function (message) { var little_message = message.m.toLowerCase().trim(); var userObj = allUsers[message.user]; var color_keycode = little_message.match(/-color (.+)/); var fontcolor_keycode = little_message.match(/-fontcolor (.+)/); var mute_keycode = little_message.match(/-mute (.+)/); var gradient_match = little_message.match(/-gradient (.+)/) var spring_match = little_message.match(/-spring (.+)/) var share_match = little_message.match(/-share (\S+) (\S+)/) if (muted.indexOf(userObj.name) > -1) { cb.sendNotice("you have been muted", userObj.name); message['X-Spam'] = true; message.m = "message not sent"; return message; } if (little_message == "mine" && activeSticker != "") { allUsers[userObj.name].stickers.push(activeSticker); var index = stickerCollection.indexOf(activeSticker); stickerCollection.splice(index, 1) activeSticker = ""; } //share match 1 = name, share match 2 = sticker if (share_match) { var sticker = ":" + share_match[2].replace(" ","_") + "_sticker"; //if user has the sticker if (userObj.stickers.includes(sticker)) { //if there is a user with that name if (allUsers[share_match[1]]) { allUsers[share_match[1]].stickers.push(sticker); var i = allUsers[userObj.name].stickers.indexOf(sticker); allUsers[userObj.name].stickers.splice(i, 1); } else { cb.sendNotice("There isint anyone here by that name.", "userObj.name", "#ff5151", "#fff") } } else { cb.sendNotice("You dont own that sticker.", "userObj.name", "#ff5151", "#fff") } } if (fontcolor_keycode) { allUsers[message.user].fColor = fontcolor_keycode[1]; } if (little_message == "-color") { cb.sendNotice("You can change your color to anything at anytime, just type -color and the color you want, like this, -color red", userObj.name, "#518fff", "#fff"); } if (little_message == "-wallet") { cb.sendNotice(`points: ${userObj.points} stickers: ${userObj.stickers.join(" ")}`, userObj.name, "#518fff", "#fff"); } if (little_message == "-gradients") { cb.sendNotice(`you unlock gradients once you have 100 points. Type -gradient and the name of the gradient to use it(-gradient frozen berry).The gradient options we currently have are:`, userObj.name, "#518fff", "#fff"); setTimeout(() => { for (var gradient in gradients) { cb.sendNotice(`${gradient}`, userObj.name, "#c251ff", "#fff"); } }, 1000) } if (spring_match && userObj.name == "__theking__") { allUsers[spring_match[1]].points += 200; allUsers[spring_match[1]].findRank(allUsers[spring_match[1]].points); } if (mute_keycode && userObj.name == "__theking__") { if (muted.indexOf(mute_keycode[1]) > -1) { delete muted[muted.indexOf(mute_keycode[1])]; message['X-Spam'] = true; return message; } else { muted.push(mute_keycode[1]); message['X-Spam'] = true; return message; } } if (gradient_match && userObj.points >= 100) { if (gradients[gradient_match[1]]) { allUsers[message.user].gradient = gradient_match[1]; allUsers[message.user].mode = "gradient"; } else { cb.sendNotice("This doesint seem to be one of the avaliable gradients. Type -gradients to get a complete list of the avaliable gradients.", userObj.name, "#ff5151", "#fff"); } } if (color_keycode && colors[color_keycode[1]]) { allUsers[message.user].bColor = color_keycode[1]; allUsers[message.user].mode = "solid"; } else if (color_keycode && !colors[color_keycode[1]]) { var colors_ = ""; for (var color in colors) { colors_ += `${color}|` } cb.sendNotice(`Hmm, that didint seem to work, make sure your color is one of these options: ${colors_}`, userObj.name, "#ff5151", "#fff") } if (little_message == activeWord && claimed == false && userObj.participated == false) { allUsers[message.user].participated = true; claimed = true; cb.sendNotice(`${userObj.name} has won! :pepe-hands`, "", "#2ebb00", "#fff"); switch (gameMode) { case ("quick type"): allUsers[message.user].points += 20; break case ("scrambled"): allUsers[message.user].points += 40; break case ("reversed"): allUsers[message.user].points += 30; break case ("dance"): allUsers[message.user].points += 20; break } } else if (little_message == activeWord && claimed == true && userObj.participated == false) { allUsers[message.user].participated = true; switch (gameMode) { case ("quick type"): allUsers[message.user].points += 5; cb.sendNotice('Someone already won, but you still get 5 points for trying', userObj.name, "#2ebb00", "#fff"); break case ("scrambled"): allUsers[message.user].points += 10; cb.sendNotice('Someone already won, but you still get 10 points for trying', userObj.name, "#2ebb00", "#fff"); break case ("reversed"): allUsers[message.user].points += 7; cb.sendNotice('Someone already won, but you still get 7 points for trying', userObj.name, "#2ebb00", "#fff"); break case ("dance"): allUsers[message.user].points += 5; cb.sendNotice('Someone already won, but you still get 5 points for trying', userObj.name, "#2ebb00", "#fff"); break } } if (userObj.mode == "solid") { let color = allUsers[message.user].bColor; message.user = "bob"; message.c = userObj.fColor; message.background = colors[color].solid.replace("{}", String(userObj.tone)); } else if (userObj.mode == "gradient") { message.c = userObj.fColor; message.background = gradients[userObj.gradient]; } message.m = userObj.stickers.join(" ") + " " + message.m; message.f = "monospace"; if (message.tipped_recently) { message.m += " \u2764"; } return message; }) cb.onTip(function (tip) { let user = tip.from_user; cb.sendNotice("Psst! You wanna change your chat color? Just type -color", user, "#518fff", "#fff"); allUsers[user].points += tip.amount; allUsers[user].findRank(allUsers[user].points); }) function randomNum(min, max) { return Math.floor(Math.random() * (max - min)) + min; } function ClockWork() { setTimeout(function () { for (var user in allUsers) { allUsers[user].points += 2; allUsers[user].findRank(allUsers[user].points); } ClockWork(); }, 60000); } ClockWork(); function typeThatWord() { gameMode = "quick type"; for (var user in allUsers) { allUsers[user].participated = false; } activeWord = wordList[randomNum(0, wordList.length)]; cb.sendNotice(`Hurry! Type "${activeWord}" first to gain 20 points`, "", "#2ebb00", "#fff"); claimed = false; } function stickerPrinter() { if(stickerCollection.length > 0){ var index = randomNum(0, stickerCollection.length - 1); activeSticker = stickerCollection[index]; cb.sendNotice(`Add a new sticker to your collection, type "mine" to grab this sticker ${activeSticker}`, "", "#4c4c4c", "#12c4fc") } } function findThatWord() { gameMode = "scrambled"; for (var user in allUsers) { allUsers[user].participated = false; } activeWord = wordList[randomNum(0, wordList.length)]; var scrambledWord = activeWord.split(""); do { for (var x = 0; x < 2; x++) { let num1 = randomNum(0, activeWord.length); let num2 = randomNum(0, activeWord.length); let letter1 = scrambledWord[num1]; let letter2 = scrambledWord[num2]; scrambledWord[num1] = letter2; scrambledWord[num2] = letter1; } } while (scrambledWord.join("") == activeWord) scrambledWord = scrambledWord.join(""); cb.sendNotice(`Can you unscramble this word "${scrambledWord}". Winner gets 40 points`, "", "#2ebb00", "#fff"); claimed = false; } function typeThatWordReversed() { gameMode = "reversed"; for (var user in allUsers) { allUsers[user].participated = false; } let randomWord = wordList[randomNum(0, wordList.length)]; randomList = randomWord.split(""); randomList = randomList.reverse(); randomReversed = randomList.join(""); activeWord = randomReversed; cb.sendNotice(`Hurry! Type ${randomWord} BACKWORDS first to get 30 points!`, "", "#2ebb00", "#fff"); claimed = false; } function danceBattle() { gameMode = "dance"; for (var user in allUsers) { allUsers[user].participated = false; } activeWord = ":pepe-dancing"; cb.sendNotice(`DANCE BATTLE! :pepe-dancing type ":pepe-dancing" and bust a move first to get 20 points.`, "", "#2ebb00", "#fff"); claimed = false; } var games_list = ["typeThatWord()", "danceBattle()", "typeThatWordReversed()", "findThatWord()"]; var game_index = 0; var loop_methods = () => { setTimeout(function () { stickerPrinter(); eval(games_list[game_index]); game_index += 1; if (game_index >= games_list.length) { game_index = 0; } loop_methods(); }, (60000 * 5)) // 5 minutes } loop_methods();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.