Bots Home
|
Create an App
Fixed Lucky Number
Author:
sherminator68b
Description
Source Code
Launch Bot
Current Users
Created by:
Sherminator68b
function getNumbers() { for (var e = cb.settings.low; e <= cb.settings.high; e++) numbers.push(e), tempNumbers.push(e), hints.push(e); range = numbers.join(" ").toString(), hints.splice(lucky, 1) } function getPrizeValues() { var e = cb.settings.prizeList; prizes = e.split(","), prizeTips = shuffle(tempNumbers), prizeTips = prizeTips.splice(0, cb.settings.prizeCount), "Yes" == cb.settings.clear && (prizeTips.shift(), prizeTips.push(lucky)), prizeTips.sort(function(e, t) { return e - t }) } function getHint() { hint = hints[Math.floor(Math.random() * hints.length)], hints = hints.filter(function(e) { return hint > lucky ? hint >= e : e >= hint }), hints.splice(hints.indexOf(hint), 1), 0 == hints.length && (cb.chatNotice("There are no hints remaining!", "", "", bcp.black, "bold"), noHint = !0) } function shuffle(e) { e.splice(e.indexOf(lucky), 1); for (var t, n, i = e.length; 0 !== i;) n = Math.floor(Math.random() * i), i -= 1, t = e[i], e[i] = e[n], e[n] = t; return e } function prizeWin(e, t) { if (numbers.splice(numbers.indexOf(e), 1), range = numbers.join(" ").toString(), cb.drawPanel(), prizeTips.includes(e)) { var n = Math.floor(Math.random() * prizes.length), i = prizes[n]; prizeTips.splice(prizeTips.indexOf(e), 1), cb.chatNotice("Congratulations, " + t + ", you have won " + i + "!", "", "", bcp.green, "bold"), 0 == prizeTips.length && numbers.length > 0 && ("Yes" == cb.settings.clear ? cb.chatNotice("All hidden prizes have been found.\nClear the remaining numbers to reach the Goal!", "", "", "", "bold") : cb.chatNotice("All hidden prizes have been found.\nFind the LUCKY NUMBER for the Grand Prize!", "", "", "", "bold")) } 0 == numbers.length && "Yes" == cb.settings.clear && (cb.chatNotice("Thanks to everyone for playing! All numbers have been cleared.\n" + cb.settings.celebrationGIF, "", "", bcp.green, "bold"), cb.changeRoomSubject(cb.settings.topic + " " + cb.settings.hashtags), endGame(), cb.drawPanel()) } function endGame() { gameOver = !0, cb.chatNotice("Total tokens: " + net + ". Average Tokens per round: " + Math.ceil(net / resets) + ". Total dollars: $" + parseFloat(.05 * net).toFixed(2), cb.room_slug, "", "", "bold"), tempNumbers = [], hints = [], givenHints = [], "Yes" == cb.settings.allowReset && cb.setTimeout(showResetRules, 1e3) } function showNumbers() { numbers.length > 51 && (cb.chatNotice("\nThe Remaining Numbers are:\n" + range, "", "", bcp.purple, "bold", "", "", bcp.blue, "bold"), cb.setTimeout(showNumbers, 42e4)) } function showPrize() { prizeTips.length > 0 && 0 == gameOver && ("No" == cb.settings.clear ? cb.chatNotice("\nThere are " + prizeTips.length + " prizes hidden along with the LUCKY number.", "", "", bcp.maroon, "bold") : cb.chatNotice("\nThere are " + prizeTips.length + " prizes hidden among all the numbers.", "", "", bcp.maroon, "bold"), cb.setTimeout(showPrize, 36e4)) } function showPrizes(e) { var t = prizes.join(" " + heart + " ").toString(); "Yes" == cb.settings.prize && prizeTips.length > 0 ? cb.chatNotice("The possible prizes are: " + heart + " " + t + " " + heart, e, "", bcp.maroon, "bold") : "Yes" == cb.settings.prize && 0 == prizeTips.length ? cb.chatNotice("All of the prizes have been found this round.", e, "", bcp.maroon, "bold") : "No" == cb.settings.prize && cb.chatNotice("There are no extra prizes to find this round.", e, "", bcp.maroon, "bold") } function showHint() { hints.length > 0 && "Yes" == cb.settings.giveHint && 0 == gameOver && "No" == cb.settings.clear && (cb.chatNotice("\nTip " + cb.settings.hintTip + " tokens for a HINT just for YOU to find the LUCKY number.", "", "", bcp.maroon, "bold"), cb.setTimeout(showHint, 39e4)) } function resetRules(e) { "Yes" == cb.settings.allowReset && cb.chatNotice("\nThe reset feature allows models or mods to reset the game once finished. This will reset the LUCKY number, Prize tip values, and the goal. The model will receive a message in the chat containing the new numbers and goal. Simply type '/reset x xxxx' where x is the new lucky number and xxxx is the new goal in the chat to reset the game. If you want to change the number of prizes, prizes won, or upper and lower limits you will need to deactivate the game and start again.", e, "", bcp.red, "bold") } function showResetRules() { for (i = 0; i < mods.length; i++) cb.chatNotice("The reset feature is on. Type '/reset x xxxx' where x is the new number and xxxx is the new goal in the chat to reset the game", mods[i], "", bcp.red, "bold") } function ShowIntro() { 0 == gameOver && ("No" == cb.settings.clear ? cb.chatNotice("\nGuess the LUCKY number from " + cb.settings.low + " to " + cb.settings.high + ". Grand Prize: " + grandPrize + "\nType /numbers to see the remaining numbers, /prizes for available prizes,\nor /rules for complete details.", "", "", bcp.blue, "bold") : cb.chatNotice("Clear all the numbers from " + cb.settings.low + " to " + cb.settings.high + " to reach the goal!\nGrand Prize for clearing all numbers: " + grandPrize + "\nType /numbers to see the remaining numbers, /prizes for available prizes,\nor /rules for complete details.", "", "", bcp.blue, "bold"), cb.setTimeout(ShowIntro, 6e5)) } function ShowRules(e) { var t = "Your job is to FIND the LUCKY number. Make your GUESS by TIPPING!\nIf you GUESS the LUCKY number your prize is: " + grandPrize, n = "The Object is to CLEAR ALL numbers by tipping to reach the GRAND PRIZE!\nThe Prize is: " + cb.settings.luckyPrize, i = "\nNumbers that have NOT been tipped are shown in the panel below the video feed\nor by typing /numbers in the chat if there are too many to display.\nType /prizes to see available prizes. Good Luck and Enjoy the Show!\n"; "No" == cb.settings.clear ? cb.chatNotice("The Your Lucky Guess Game:\n" + t + i, e, "", bcp.blue, "bold") : cb.chatNotice("The Your Lucky Guess Game:\n" + n + i, e, "", bcp.blue, "bold") } function newGrndPrz(e) { var t = e.toString(); t = t.split(" "), t = t.splice(2, t.length), grandPrize = "" == t ? cb.settings.luckyPrize : t.join(" ") } function init() { gameOver = !1, getNumbers(), 1 == resets && (lucky = cb.settings.luckyNumber, grandPrize = cb.settings.luckyPrize, mods.push(cb.room_slug)), "No" == cb.settings.clear ? cb.changeRoomSubject("Guess the LUCKY number! Guess between " + cb.settings.low + " and " + cb.settings.high + " to " + grandPrize + ". " + cb.settings.hashtags) : "Yes" == cb.settings.clear && cb.changeRoomSubject("Clear all the numbers from " + cb.settings.low + " to " + cb.settings.high + ". Goal: " + grandPrize + ". " + cb.settings.hashtags), "Yes" == cb.settings.prize && (getPrizeValues(), cb.chatNotice("The prize(s) lucky numbers are: " + prizeTips + ".", cb.room_slug, "", "", "bold")), cb.drawPanel(), cb.setTimeout(ShowIntro, 1e3), cb.setTimeout(showPrize, 2e3), cb.setTimeout(showHint, 3e3), cb.setTimeout(showNumbers, 4e3) } var lucky, winner, hint, mod, grandPrize, range, gameOver = !1, noHint = !1, net = 0, resets = 1, numbers = [], tempNumbers = [], hints = [], givenHints = [], prizeTips = [], prizes = [], mods = [], heart = "♥", kiss = ":kiss", bcp = { aqua: "#00FFFF", black: "#000000", blue: "#0000FF", fuchsia: "#FF00FF", gray: "#808080", grey: "#808080", green: "#008000", lime: "#00FF00", maroon: "#800000", navy: "#000080", olive: "#808000", orange: "#FFA500", purple: "#800080", red: "#FF0000", silver: "#C0C0C0", teal: "#008080", white: "#FFFFFF", yellow: "#FFFF00" }; cb.settings_choices = [{ name: "low", type: "int", minValue: 5, maxValue: 499, defaultValue: 11, label: "Lower Limit" }, { name: "high", type: "int", minValue: 10, maxValue: 500, defaultValue: 45, label: "Upper Limit" }, { name: "luckyNumber", type: "int", minValue: 5, maxValue: 500, label: "Lucky Number", defaultValue: 22 }, { name: "luckyPrize", type: "str", minLength: 1, maxLength: 255, defaultValue: "Dress Off", label: "Grand Prize/Goal" }, { name: "clear", label: "Clear all numbers for Grand Prize?", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No" }, { name: "giveHint", label: "Give Hints? (Only the person tipping for the hint will see and ONLY works if 'Clear all Numbers' is 'No')", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No" }, { name: "hintTip", type: "int", required: !1, defaultValue: 501, label: "Tip amount for hint" }, { name: "topic", type: "str", minLength: 1, maxLength: 255, required: !1, label: "Room Topic", defaultValue: "Let's copulate over and over ❤" }, { name: "hashtags", type: "str", minLength: 1, maxLength: 255, required: !1, label: "Hashtags for your topic", defaultValue: "#lovense #ohmibod #sexy #fun" }, { name: "celebrationGIF", type: "str", minLength: 1, maxLength: 255, required: !1, label: "GIF For Winner/Cleared Numbers", defaultValue: ":congratulationslove" }, { name: "prize", label: "Play with extra prizes?", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No" }, { name: "prizeCount", type: "int", minValue: 0, maxValue: 20, required: !1, label: "How many prizes not including Grand Prize? (Max of 20)", defaultValue: 0 }, { name: "prizeList", type: "str", minLength: 0, maxLength: 255, required: !1, label: "Prizes to be found? (Seperate each with a ',' and no spaces. Can be as many as you desire)", defaultValue: "a kiss,boob flash,a smile,my finger" }, { name: "allowReset", label: "Allow Game to be Reset (use '/reset' in chat)?", type: "choice", choice1: "Yes", choice2: "No", defaultValue: "No" }], cb.onDrawPanel(function(e) { if (1 == gameOver) { if ("Yes" == cb.settings.clear) return { template: "3_rows_11_21_31", row1_value: "All Numbers have been CLEARED!", row2_value: "Your prize is: " + grandPrize, row3_value: heart + " Thank you all for playing! " + heart }; if ("No" == cb.settings.clear) return { template: "3_rows_11_21_31", row1_value: winner + " has guessed the LUCKY number!", row2_value: "Your Grand Prize is: " + grandPrize, row3_value: heart + " Thank you all for playing! " + heart } } else if (0 == gameOver) { if ("No" == cb.settings.clear) var t = "GUESS The LUCKY Number From Below:"; else if ("Yes" == cb.settings.clear) var t = "CLEAR all the numbers Below:"; return numbers.length <= 51 ? { template: "3_rows_11_21_31", row1_value: t, row2_value: range, row3_value: "" } : { template: "3_rows_11_21_31", row1_value: t, row2_value: "Numbers Remaining: " + numbers.length, row3_value: "Type /numbers to see the remaining numbers." } } }), cb.onTip(function(e) { var t = parseInt(e.amount), n = e.from_user; net += t, 0 == gameOver && n != mod && (t == lucky && numbers.includes(lucky) ? "No" == cb.settings.clear ? (cb.changeRoomSubject(cb.settings.topic + " " + cb.settings.hashtags), winner = n, cb.chatNotice("Congratulations, " + winner + ", you have found the LUCKY number!\nYour Grand Prize is " + grandPrize + ".\n" + cb.settings.celebrationGIF, "", "", bcp.green, "bold"), endGame(), numbers = [], cb.drawPanel()) : "Yes" == cb.settings.clear && prizeWin(t, n) : numbers.includes(t) && numbers.length >= 1 && ("Yes" == cb.settings.prize && prizeTips.includes(t) ? prizeWin(t, n) : ("No" == cb.settings.prize ? "No" == cb.settings.clear && cb.chatNotice("That's not the LUCKY number. Guess Again!", "", "", bcp.red, "bold") : "Yes" == cb.settings.prize && (prizeTips.length > 0 ? cb.chatNotice("That's not a LUCKY number. Guess Again!", "", "", bcp.red, "bold") : numbers.length - 1 > 1 ? cb.chatNotice("Only " + (numbers.length - 1) + " more numbers left to clear!", "", "", "", "bold") : numbers.length - 1 == 1 && cb.chatNotice("Only " + (numbers.length - 1) + " more number left to clear!", "", "", "", "bold")), prizeWin(t, n))), t == cb.settings.hintTip && "Yes" == cb.settings.giveHint && "No" == cb.settings.clear && (0 == noHint ? (getHint(), givenHints.push(hint), cb.chatNotice(n + " has tipped for a HINT to find the LUCKY number!"), hint > lucky ? cb.chatNotice("Your PERSONAL hint is: The Lucky Number is LESS than " + hint, n, "", bcp.black, "bold") : cb.chatNotice("Your PERSONAL hint is: The Lucky Number is GREATER than " + hint, n, "", bcp.black, "bold")) : cb.chatNotice("Thank you for your tip, but there are no hints remaining. " + kiss, n, "", bcp.black, "bold"))) }), cb.onMessage(function(e) { var t = e.user; if (("/numbers" == e.m || "/number" == e.m || "/n" == e.m) && (e["X-Spam"] = !0, t == cb.room_slug || e.is_mod ? (e.m = e.m + " (Remainging numbers sent to everyone.)", cb.chatNotice("The Remaining Numbers are:\n" + range, "", "", bcp.purple, "bold")) : cb.chatNotice("The Remaining Numbers are:\n" + range, t, "", bcp.purple, "bold")), "/prizes" == e.m && (e["X-Spam"] = !0, showPrizes(t)), "/rules" == e.m && (e["X-Spam"] = !0, ShowRules(t)), "/resethelp" == e.m && (t == cb.room_slug || e.is_mod) && (e["X-Spam"] = !0, resetRules(t)), "/reset " == e.m.substring(0, 7) && (e["X-Spam"] = !0, "Yes" == cb.settings.allowReset && 1 == gameOver)) { var n = e.m.split(" "); for ((cb.settings.low > n[1] || cb.settings.high < n[1]) && cb.chatNotice("You must pick a new Lucky Number that is between " + cb.settings.low + " and " + cb.settings.high + ".\nPlease try again using the '/reset x xxxx' command where x is the new Lucky Number and xxxx is the new goal", t, "", bcp.red, "bold"), s = cb.settings.low; s <= cb.settings.high; s++) n[1] == s && ("No" == cb.settings.clear ? (t == cb.room_slug ? (newGrndPrz(e.m), cb.chatNotice("You have reset the game. The new lucky number is " + s + " and the new goal is " + grandPrize, cb.room_slug, "", "", "bold"), lucky = s, resets++, init()) : e.is_mod && (newGrndPrz(e.m), cb.chatNotice(t + "has reset the game. The new lucky number is " + s + " and the new goal is " + grandPrize, cb.room_slug, "", "", "bold"), lucky = s, resets++, init()), mod = t) : "Yes" == cb.settings.clear && (t == cb.room_slug || e.is_mod) && (cb.chatNotice("The game has been reset.", cb.room_slug, "", bcp.red, "bold"), lucky = s, resets++, mod = t, init())) } return e }), cb.onEnter(function(e) { (e.is_mod || e.user == cb.room_slug) && (mods.push(e.user), "Yes" == cb.settings.allowReset && cb.chatNotice("The reset feature is active. Type /resethelp for instructions.", e.user, "", bcp.red, "bold")) }), cb.onLeave(function(e) { (e.is_mod || e.user == cb.room_slug) && mods.includes(e.user) && mods.splice(mods.indexOf(e.user), 1) }), init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.