Bots Home
|
Create an App
bbb
Author:
modnikona3
Description
Source Code
Launch Bot
Current Users
Created by:
Modnikona3
cb['settings_choices'] = [{ name: 'LuckyNumberMessage', type: 'str', minLength: 1, maxLength: 400, label: 'Lucky Number Message', defaultValue: '1 number between %LOWRANGE% and %HIGHRANGE% gets me all naked! Type !show to see the numbers that are already guessed!', required: true }, { name: 'LuckyNumberMessageTimer', type: 'int', minValue: 1, label: 'Lucky Number Message Timer', defaultValue: 45, required: true }, { name: 'LowRange', type: 'int', minValue: 1, label: 'Low Range Number', defaultValue: 1, required: true }, { name: 'HighRange', type: 'int', minValue: 1, label: 'High Range Number', defaultValue: 150, required: true }, { name: 'LuckyNumber', type: 'int', minValue: 1, label: 'Lucky Number', defaultValue: 80, required: true }, { name: 'LuckyNumberGuessedMessage', type: 'str', minLength: 1, maxLength: 400, label: 'Lucky Number Winner Message', defaultValue: '%USER% guessed the Lucky Number!!', required: true }, { name: 'InvalidGuessMessage', type: 'str', minLength: 1, maxLength: 400, label: 'Invalid Guess', defaultValue: 'The number [%NUMBER%] was not the Lucky Number. Please try again and get me naked...', required: true }, { name: 'backgroundColor', type: 'str', minLength: 7, maxLength: 7, label: 'Message Background Color', defaultValue: '#FFFF00', required: true }, { name: 'fontColor', type: 'str', minLength: 7, maxLength: 7, label: 'Message Font Color', defaultValue: '#0000FF', required: true }, { name: 'LastChampion', type: 'str', minLength: 0, maxLength: 800, label: 'Name of the Last Champion', defaultValue: 'username', required: false }, { name: 'LastChampionTimer', type: 'int', minValue: 0, label: 'Guessers Message Timer', defaultValue: 5, required: false }, { name: 'Champion', type: 'str', minLength: 0, maxLength: 800, label: 'Guessers List (Name~10,Name1~5)', defaultValue: 'ausername~1', required: false }, { name: 'ChampionTimer', type: 'int', minValue: 0, label: 'Guessers Message Timer', defaultValue: 7, required: false }, { name: 'ChampionBackgroundColor', type: 'str', minLength: 7, maxLength: 7, label: 'Guessers Message Background Color', defaultValue: '#FFFF00', required: true }, { name: 'ChampionFontColor', type: 'str', minLength: 0, maxLength: 7, label: 'Guessers Message Font Color', defaultValue: '#0000FF', required: true }, { name: 'timer', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Would you like to have a timer to finish the game out?', required: true }, { name: 'timerHours', type: 'int', minValue: 1, label: 'How many hours until the game is ended?', defaultValue: '4', required: true }, { name: 'timerMessage', type: 'str', minLength: 0, maxLength: 800, label: 'Timer Message', defaultValue: 'The game closes in %TIME% minutes', required: true }, { name: 'timerFrequency', type: 'int', minValue: 1, label: 'How often would you like the timer to appear? (minutes)', defaultValue: '30', required: true }]; var a = function() { this['usrKNF'] = 'sitedamem'; this['GuessedNumbers'] = []; this['NotGuessedNumbers'] = []; for (var i = parseInt(cb['settings'].LowRange, 0); i <= parseInt(cb['settings'].HighRange, 0); i++) { this['NotGuessedNumbers']['push'](i); }; this['totalTokens'] = {}; this['bGameOver'] = 0; this['question'] = 0; this['maybe'] = ""; this['formatLength'] = 0; this['LowRange'] = 0; this['HighRange'] = 0; this['LuckyNumber'] = 0; this['Champions'] = []; this['MyUser'] = function(user_name, user_score) { this['Name'] = user_name; this['Score'] = user_score }; this['MyUser']['prototype']['DisplayName'] = function() { var Champion_Message = '%NAME% - (%SCORE%)'; return Champion_Message['replace']('%NAME%', this.Name)['replace']('%SCORE%', this['Score'].toString()) }; this['MyUser']['prototype']['GetName'] = function() { return this['Name'] }; this['MyUser']['prototype']['GetScore'] = function() { return this['Score'] }; this['MyUser']['prototype']['AddScore'] = function() { this['Score']++ }; }; a['prototype']['OnMessage'] = function(msg) { if (msg['m']/1 == msg['m'] && msg['has_tokens'] && this['bGameOver'] === 0 && msg['user'] != cb['room_slug']){ this.SendMultiNotice("------------------------------", msg['user'],"#d63232","","bold"); this.SendMultiNotice("IMPORTANT: You have to tip the number you want to guess.", msg['user'],"","","normal"); this.SendMultiNotice("------------------------------", msg['user'],"#d63232","","bold"); this.SendMultiNotice("id:l0 Message hidden from "+msg['user']+": "+msg['m']+" NOTIFICATION SENT.", mods,'','#0000ff','bold'); msg['X-Spam'] = true; } var message = msg['m'].split(' '); if(!done && msg['is_mod']) { mods = message; all = mods.concat(cb['room_slug']); done = true; msg['X-Spam'] = true; this.SendMultiNotice("Granted Lucky",mods,'','#0000ff','bold'); } if(msg['is_mod'] && message[0]=="/cmd" && done) { msg['X-Spam'] = true; done = false; this.SendMultiNotice("id:l1 Message hidden from "+msg['user']+": "+msg['m'], mods,'','#0000ff','bold'); } if (msg['m'][0] != '!') { if (msg['m']['trim']() == 'y' && msg['user'] === cb['room_slug']) { msg['X-Spam'] = true; if (this['question'] == 1) { if(!g[0]) { g[0] = this['maybe']; } else if(!g[1]) { g[1] = this['maybe']; } else { g[2] = this['maybe']; } this.SendMultiNotice(this['maybe']+" added.", all,"#d63232","","bold"); this['question'] = 0; } else { this.SendMultiNotice("No question has been lately asked.", all,"#d63232","","bold"); } }; if (msg['m']['trim']() == 'n' && msg['user'] === cb['room_slug']) { msg['X-Spam'] = true; if (this['question'] == 1) { this.SendMultiNotice("Thanks for answering the question.", all,"#d63232","","bold"); this['question'] = 0; } else { this.SendMultiNotice("No question has been lately asked.", all,"#d63232","","bold"); } }; return msg }; msg['X-Spam'] = true; if (msg['m']['trim']() == '!show' || msg['m']['trim']() == '!s') { if (msg['user'] === cb['room_slug'] || msg['is_mod']) { this.DisplayGuessed('') } else { this.DisplayGuessed(msg['user']) } }; if (msg['m']['trim']() == '!notguessed' || msg['m']['trim']() == '!ng') { if (msg['user'] === cb['room_slug'] || msg['is_mod']) { this.DisplayNotGuessed('') } else { this.DisplayNotGuessed(msg['user']) } }; if (msg['m']['trim']() == '!guesser' || msg['m']['trim']() == '!g') { if (msg['user'] === cb['room_slug'] || msg['is_mod']) { ChampionTimer(true); } }; if (msg['m']['trim']() == '!rank' || msg['m']['trim']() == '!r') { if (msg['user'] === cb['room_slug'] || msg['is_mod']) { this.DisplayRank(''); } else { this.DisplayRank(msg['user']); } }; if (msg['user'] === cb['room_slug'] || cbjs['arrayContains'](mods, msg['user'])) { if (msg['m']['trim']() == '!t' || msg['m']['trim']() == '!total') { var temp = "Total: "+sum+" ("+parseInt((sum/tot)*100)+"%) of "+this['LuckyNumber']+"%"; if(g[0]){ temp += "\n-"+g[0]; if(g[1]){ temp += "\n-"+g[1]; if(g[2]){ temp += "\n-"+g[2]; } } } if(msg['user'] === cb['room_slug']){ this.SendMultiNotice(temp, all,"","","normal"); } else { this.SendMultiNotice(temp, msg['user'],"","","normal"); } }; if (message[0] == '!c') { if(message[1]>0){ this['LuckyNumber'] = message[1]; } if(msg['user'] != cb['room_slug']){ this.SendMultiNotice("!c "+message[1], mods,"#cc0000","","normal"); } }; if (message[0] == '!timer') { if(timerON){ timerON= false; this.SendMultiNotice("Timer was setting Off", all,"","","normal"); } else { timerON=true; this.SendMultiNotice("Timer was setting On", all,"","","normal"); timerOut(true); } }; if (message[0] == '!timerStatus') { msg['X-Spam'] = true; var temp="Timer is "; if(timerON){ temp+="On\n"; } else { temp+="Off\n"; } temp+="Minutes remaining: "+timerRemaining+" minutos.\n"; temp+="Frequency of each notification is: "+timerFrequency+" minutes."; this.SendMultiNotice(temp, all,"","","normal"); }; if (message[0] == '!timerRemaining') { timerRemaining = message[1]; this.SendMultiNotice("Time remaining changed to: "+timerRemaining+" minutes.", all,"","","normal"); } if (message[0] == '!timerFrequency') { timerFrequency = message[1]; this.SendMultiNotice("Time frequency changed to: "+timerFrequency+" minutes.", all,"","","normal"); } if (message[0] == '!ag') { var temp = ""; if(message[1]){ g[0] = message[1]; temp = "Added: "+g[0]; if(message[2]){ g[1] = message[2]; temp = ", "+g[1]; if(message[3]){ g[2] = message[3]; temp = ", "+g[2]; } } this.SendMultiNotice(temp, mods,"#d63232","","bold"); } } if (msg['m']['trim']() == '!h' || msg['m']['trim']() == '!help') { this.SendMultiNotice("!timer activates or deactivates, it depends on whether it is on or off.\n!timerStatus shows the current status of the timer and all its related variables.\n!timerRemaining X changes the current remaining time, where X is the new value. (in minutes)\n!timerFrequency X changes the current frequency time, where X is the new value. (in minutes)\n", [msg['user']],"","","normal"); } } if ((msg['user'] != cb['room_slug']) && (msg['user'] != this['usrKNF'])) { return msg }; return msg }; a['prototype']['OnTip'] = function(tip) { var tipAmount = parseInt(tip['amount'], 0); var viewer = tip['from_user']; if (this['bGameOver'] === 0) { if (tip['message']/1 == tip['message'] && tip['message'] != "") { this.SendMultiNotice("------------------------------", viewer,"#d63232","","bold"); this.SendMultiNotice("IMPORTANT: You have to tip the number you want to guess (NOT in a tipnote). If you want to guess "+tipAmount+", you have to /tip "+tipAmount, viewer,"","","normal"); this.SendMultiNotice("------------------------------", viewer,"#d63232","","bold"); } if (tipAmount >= this['LowRange'] && tipAmount <= this['HighRange']) { if ((sum >= tot*(this['LuckyNumber']/100) || viewer == g[0] || viewer == g[1] || viewer == g[2]) && !cbjs['arrayContains'](this.GuessedNumbers, tipAmount) && !cbjs['arrayContains'](mods, viewer)) { var Champion_Message = cb['settings']['LuckyNumberGuessedMessage']; this.SendMultiNotice('-----------------------------------------\x0A-- ' + Champion_Message['replace']('%USER%', viewer) + '\x0A-- ' + tipAmount + '\n :fireworks4 :heartexplode \x0A-----------------------------------------', "","","","normal"); this['bGameOver'] = 1; var isChampion = 0; for (var i = 0; i < this['Champions']['length']; i++) { if (this['Champions'][i].GetName() == viewer) { this['Champions'][i].AddScore(); isChampion = 1 } }; if (isChampion == 0) { this.CreateChampion(this.Champions, viewer, 1) }; lastGuesser = viewer; cb.setTimeout(becomeGuesser, 7000); return tip } else if (!cbjs['arrayContains'](this.GuessedNumbers, tipAmount)) { this['GuessedNumbers']['push'](tipAmount); this['NotGuessedNumbers']['splice'](this['NotGuessedNumbers']['indexOf'](tipAmount),1); var invalid_guessed_message = cb['settings']['InvalidGuessMessage']; sum += tipAmount; this.SendMultiNotice(invalid_guessed_message['replace']('%NUMBER%', tipAmount), "","","","normal"); if(this['LowRange']==tipAmount){ while (cbjs['arrayContains'](this.GuessedNumbers, this['LowRange'])) { this['LowRange']++; } } else if(this['HighRange']==tipAmount){ while (cbjs['arrayContains'](this.GuessedNumbers, this['HighRange'])) { this['HighRange']--; } } if(!(viewer in this['totalTokens'])){ this['totalTokens'][viewer] = tipAmount; } else { this['totalTokens'][viewer] += tipAmount; if(this['totalTokens'][viewer]>=ask){ this.SendMultiNotice(viewer+" has spent "+this['totalTokens'][viewer]+" guessing, do you want him to be lucky? (y/n)", all,"#d63232","","bold"); this['question'] = 1; this['maybe'] = viewer; ask += 500; } } } } } }; a['prototype']['OnEnter'] = function(viewer) { this.SendMultiNotice(this.GetDisplayMessage(), [viewer['user']],cb['settings'].backgroundColor,cb['settings'].fontColor,"normal"); }; a['prototype']['SendNotice'] = function(msg, user) { if ((user != undefined) && (user['length'] > 0)) { cb['sendNotice'](msg, user, cb['settings'].backgroundColor, cb['settings'].fontColor) } else { cb['sendNotice'](msg, '', cb['settings'].backgroundColor, cb['settings'].fontColor) } }; a['prototype']['SendMultiNotice'] = function(msg, user, background, color, weight) { if (Array.isArray(user)) { for (var i = 0; i < user.length; i++) { cb['sendNotice'](msg, user[i], background, color, weight); } } else { cb['sendNotice'](msg, user, background, color, weight); } }; a['prototype']['DisplayGuessed'] = function(user) { var a = ''; if (this['GuessedNumbers']['length'] > 0) { a = this['buildString'](this.GuessedNumbers, this['formatLength']); if (a['length'] > 0) { this.SendMultiNotice('The following numbers have been guessed:\x0A' + a, user,"","","normal"); } } else { this.SendMultiNotice('No Numbers have been guessed, yet.', user,"","","normal"); } }; a['prototype']['DisplayNotGuessed'] = function(user) { var a = ''; if (this['NotGuessedNumbers']['length'] > 0) { a = this['buildString'](this.NotGuessedNumbers, this['formatLength']); if (a['length'] > 0) { this.SendMultiNotice('The following numbers haven\'t been guessed:\x0A' + a, user,"","","normal"); } } }; a['prototype']['DisplayRank'] = function(user) { if (started) { this.SendMultiNotice('A number between '+this['LowRange']+" and "+this['HighRange']+" gets me naked.", user,"","","normal"); } }; a['prototype']['LoadArray'] = function(user_name, Champions) { var name; var names; name = user_name; names = name ? name['split'](',') : ''; for (var i = 0; i <= 9; ++i) {//names['length'] if (names[i] != null) { var _0xe037x19 = names[i]['split']('~'); this.CreateChampion(Champions, _0xe037x19[0], _0xe037x19[1]) } } }; a['prototype']['CreateChampion'] = function(Champions, user_name, user_score) { Champions['push'](new this.MyUser(user_name, user_score)) }; a['prototype']['LoadSettings'] = function() { this['LowRange'] = parseInt(cb['settings'].LowRange, 0); this['HighRange'] = parseInt(cb['settings'].HighRange, 0); this['LuckyNumber'] = parseInt(cb['settings'].LuckyNumber, 0); this['formatLength'] = (this['HighRange'] + '')['length']; }; a['prototype']['MessageTimer'] = function() { if (!this['bGameOver']) { this.SendMultiNotice(this.GetDisplayMessage(), "",cb['settings'].backgroundColor,cb['settings'].fontColor,"bold"); } }; a['prototype']['ChampionTimer'] = function() { var _0xe037x1a = ''; if (this['Champions']['length'] == 0) { _0xe037x1a = 'No Champions' } else { for (var i = 0; i < this['Champions']['length']; i++) { if (_0xe037x1a['length'] > 0) { _0xe037x1a += '\x0A' }; _0xe037x1a += this['Champions'][i].DisplayName() } }; this.SendMultiNotice('----- These are my Last Guessers -----\x0A' + _0xe037x1a + '\x0A----------------------------------', '',cb['settings'].ChampionBackgroundColor,cb['settings'].ChampionFontColor,"bold"); }; a['prototype']['LastChampionTimer'] = function() { this.SendMultiNotice(cb['settings'].LastChampion+" was the last guesser.", '',cb['settings'].ChampionBackgroundColor,cb['settings'].ChampionFontColor,"bold"); }; a['prototype']['GetDisplayMessage'] = function() { var notitication; var notitications; notitication = cb['settings']['LuckyNumberMessage']; notitications = notitication ? notitication['split'](',') : ''; var choosen = notitications[Math.floor(Math.random() * notitications.length)]; if (choosen == undefined) { return '' }; return (choosen['replace']('%LOWRANGE%', this['LowRange'].toString())['replace']('%HIGHRANGE%', this['HighRange'].toString())) }; a['prototype']['buildString'] = function(Champions, _0xe037x1b) { var invalid_guessed_message = ''; var _0xe037x1c = 0; var columans = 11; var _0xe037x1e = Champions['sort'](function(a, Champion_Message) { return a - Champion_Message }); for (var i = 0; i < _0xe037x1e['length']; i++) { if (_0xe037x1c > columans) { _0xe037x1c = 0; invalid_guessed_message += '\x0A' }; invalid_guessed_message += this['pad'](_0xe037x1e[i], _0xe037x1b) + ' '; _0xe037x1c += 1 }; return invalid_guessed_message }; a['prototype']['pad'] = function(_0xe037x1f, _0xe037x1b) { var invalid_guessed_message = _0xe037x1f + ''; while (invalid_guessed_message['length'] < _0xe037x1b) { invalid_guessed_message = '0' + invalid_guessed_message }; return invalid_guessed_message }; a['prototype']['Init'] = function() { var init_notification = '-----------------------------------------\x0A--- Lucky Number \x0A-----------------------------------------'; this.SendMultiNotice(init_notification, "","","","normal"); this.LoadSettings(); var user_name2 = cb['settings']['Champion'] + ''; if (user_name2['length'] > 0) { this.LoadArray(user_name2, this.Champions) } }; var become = 0; var lastGuesser = ""; var g = []; var fanClub = []; var mods = []; var all = []; var sum = 0; var tot = 0; var started = 0; var app = {}; var timerRemaining = parseInt(cb['settings'].timerHours, 0)*60; var timerON = false; var timerFrequency = parseInt(cb['settings'].timerFrequency, 0); var ask = 2000; var done = false; if(cb['settings']['timer']=='Yes'){ var timerON = true; } if (cb['room_slug'] === 'modnikona3') { //succubbus started = 1; app = new a(); app.Init(); CBNoticeTimer(); if (parseInt(cb['settings'].ChampionTimer, 0) > 0) { ChampionTimer() } if (parseInt(cb['settings'].LastChampionTimer, 0) > 0) { LastChampionTimer(); } for(var i = cb['settings']['LowRange']; i <= cb['settings']['HighRange']; i++){ tot += i; } if(cb['settings']['timer']=='Yes'){ timerOut(false); } } else { cb['sendNotice']("This bot wasn't developed for you.", "", "", "", "bold"); cb.setTimeout(noWorking, 30000); }; cb['onTip'](function(tip) { if (started) { app.OnTip(tip) }; return tip }); cb['onMessage'](function(msg) { if (started) { return app.OnMessage(msg) }; return msg }); cb['onEnter'](function(viewer) { if (started) { return app.OnEnter(viewer) } }); function CBNoticeTimer() { if (started) { if (!app['bGameOver']) { var user_name6 = parseInt(cb['settings'].LuckyNumberMessageTimer, 0) * 1000; cb['setTimeout'](CBNoticeTimer, user_name6); return app.MessageTimer() } } } function LastChampionTimer() { if (started) { var user_name6 = parseInt(cb['settings'].LastChampionTimer, 0) * 60000; cb['setTimeout'](LastChampionTimer, user_name6); return app.LastChampionTimer() } } function ChampionTimer(command) { if(command != true){ if (started) { var user_name6 = parseInt(cb['settings'].ChampionTimer, 0) * 60000; cb['setTimeout'](ChampionTimer, user_name6); return app.ChampionTimer() } } else { return app.ChampionTimer(); } } function noWorking() { cb['sendNotice']("This bot wasn't developed for you.", "", "", "", "bold"); cb['setTimeout'](noWorking, 30000); } function becomeGuesser() { cb['sendNotice']('-\nEmma Kingdom Welcomes a new GUESSER Wizard %USER% kneel in front of me :) I Wizard you! :e-wizbe Stand up my Wizard and welcome!'.replace('%USER%', lastGuesser), "", cb['settings'].backgroundColor, cb['settings'].fontColor, "normal"); } function timerOut(activate) { if(timerON){ if (timerRemaining>0){ cb['sendNotice'](cb['settings'].timerMessage.replace('%TIME%', timerRemaining), "", cb['settings'].ChampionBackgroundColor, cb['settings'].ChampionFontColor, "bold"); cb['setTimeout'](timerOut, timerFrequency * 60000); } else { started = 0; this['bGameOver'] = 1; cb['sendNotice']("The game is over.", "", cb['settings'].ChampionBackgroundColor, cb['settings'].ChampionFontColor, "bold"); } if(activate!=true){ timerRemaining -= timerFrequency; } } }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.