Apps Home
|
Create an App
Guess the number mod
Author:
grey_hardy
Description
Source Code
Launch App
Current Users
Created by:
Grey_Hardy
/** Super HiLo Exposer Created By: MabelNude General Pubic License This is free software: you can redistribute it, masturbate to it or cause others to masturbate to you with it. Any modifications require a thorough genital examination by the author before they can be approved. **/ // vars var round = 1; var maxnum=50; var mode=0; var rnum=0; var modetimeout=1; var winner=0; var anyguess=0; var tid=0; var userlist = []; var 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: 'roomsubject', type: 'str', minLength: 1, maxLength: 255, defaultValue: 'FREE Game - Make me #wet and #strip me #naked! Guess the number #cum #exhibitionist', label: "Room Subject: "}, {name: 'maxrandom', type: 'int', minValue: 2, maxValue: 500, defaultValue: 20, label: "Largest Lucky Number: "}, {name: 'rounddelay', type: 'int', minValue: 1, maxValue: 500, defaultValue: 5, label: "Delay Between Rounds (seconds): "}, {name: 'windelay', type: 'int', minValue: 1, maxValue: 500, defaultValue: 45, label: "Delay After Winning Rounds (seconds): "}, {name: 'roundtimer', type: 'int', minValue: 10, maxValue: 500, defaultValue: 30, label: "Round Timer (seconds): "}, {name: 'numberofguesses', type: 'int', minValue: 5, maxValue: 500, defaultValue: 5, label: "Number of Guesses allowed per Player for each round: "}, {name: 'reward', type: 'str', minLength: 1, maxLength: 255, defaultValue: 'Remove 1 cloth', label: "Price (if the number is correct): "}, {name: 'punishment', type: 'str', minLength: 1, maxLength: 255, defaultValue: 'Pour water over head', label: "Punishment (if the number can't be guessed): "} ]; function doReward(){ cb.chatNotice("You're CORRECT!","","#111111",bcp.green,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.green,"bold"); cb.chatNotice("- Performer must now: " + cb.settings.reward + " " ,"","",bcp.green,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.green,"bold"); cb.cancelTimeout(tid); tid=cb.setTimeout(StartRound,cb.settings.windelay*1000); } cb.onMessage( function (msg) { // if ( String.toUpper(msg['m']) == '/RULES') { No toUpper on CB? var msgArray = msg['m'].split(" "); //Split each word into an array if(msgArray[0] == "/max" & msg['user']==cb.room_slug) { cb.settings.maxrandom=msgArray[1]; } if(msgArray[0] == "/delay" & msg['user']==cb.room_slug) { cb.settings.windelay=msgArray[1]; } if ( msg['m'] == '/rules') { msg['X-Spam'] = true; // ShowRules(msg['user']); } if(isANumber(msg['m']) & mode) { testNumber(msg); } return msg; }); function testNumber(msg) { anyguess=1; if(!userlist[msg['user']] ) userlist[msg['user']]=0; var user=msg['user']; if(userlist[user]++ >= cb.settings.numberofguesses) { cb.chatNotice("You've exceeded the maximum number of guesses for this round.\n",msg['user'],"",bcp.grey,"bold"); return; } if(+msg['m'] > rnum) cb.chatNotice("-- " + +msg['m'] + " is too HIGH ","",bcp.gray,"#ffcccc","bold"); if(+msg['m'] < rnum) cb.chatNotice("-- " + +msg['m'] + " is too LOW ","",bcp.gray,bcp.lime,"bold"); if(+msg['m'] == rnum) { cb.chatNotice("-- " + +msg['m'] + " is the LUCKY NUMBER! FUCK! --","","#777777","#eeeeee","bold"); winner=1; mode=0; doReward(); } } var getParam = function(str, cmd) { var params = str.trim().replace('!'+cmd+' ', ''); params = params.replace(/\s+/g, ',').replace(/,+/g, ','); cb.log('param::' + params); return params; }; // Helpers function getRandomNumber(min, max) { return (Math.floor(((Math.random() * (max - min + 1)) + min) )) ; } cb.onLeave(function(user) { cb.chatNotice('Bye ' + user['user'] + '!',cb.room_slug,"#222222","#eeeeee","bold"); }); cb.onEnter(function(user) { cb.chatNotice('Welcome ' + user['user'] + '!'); cb.chatNotice("Welcome " + user['user'] + " to Super #HiLo Exposer!\n" + "GUESS the right number to WIN\n"+ "Just type in a number in chat to play",user['user'],"",bcp.blue,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.blue,"bold"); cb.chatNotice("If you can guess correctly: "+ cb.settings.reward + " " ,"","",bcp.blue,"bold"); cb.chatNotice("If you can't guess under given time: "+cb.settings.punishment + " " ,"","",bcp.blue,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.blue,"bold"); cb.chatNotice("User: " + user['user'] + " | Fan: " + user['in_fanclub'] + " | Sex: " + user['gender'],cb.room_slug,"#222222","#eeeeee","bold"); }); function ShowIntro() { cb.chatNotice("Welcome to Super #HiLo Exposer!\n" + "GUESS the right number to WIN\n"+ "Just type in a number in chat to play","","",bcp.blue,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.blue,"bold"); cb.chatNotice("If you can guess correctly: "+ cb.settings.reward + " " ,"","",bcp.blue,"bold"); cb.chatNotice("If you can't guess under given time: "+cb.settings.punishment + " " ,"","",bcp.blue,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.blue,"bold"); cb.setTimeout(ShowIntro, 900000); } function isANumber(str){ return !/\D/.test(str); } function StartRound() { if(mode==1) { if(!anyguess) { cb.setTimeout(StartRound,cb.settings.roundtimer*1000); return; } //mode=0; round++; if(!winner) { cb.chatNotice("-- ROUND ENDED -- Nobody guessed the number. :( It was " + rnum ,"","",bcp.red,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.red,"bold"); cb.chatNotice("- Performer must now: " + cb.settings.punishment + " " ,"","",bcp.red,"bold"); cb.chatNotice("-------------------------------------------------------------","","",bcp.red,"bold"); mode=0; rnum=0; tid=cb.setTimeout(StartRound,cb.settings.rounddelay*1000); return; } } if(mode==0) { if(winner==1) { winner=0; mode=0; tid=cb.setTimeout(StartRound,cb.settings.windelay*1000); return; } rnum=getRandomNumber(1,cb.settings.maxrandom); anyguess=0; mode=1; userlist = []; cb.chatNotice("--- ROUND #" + round + " --- Guess a number between 1 and " + cb.settings.maxrandom ,"","",bcp.green,"bold"); cb.chatNotice("Each Player has " + cb.settings.numberofguesses + " attempts to guess the lucky number","","",bcp.gray,"bold"); cb.chatNotice("Start typing in your guesses.","","",bcp.gray,"bold"); cb.chatNotice("Lucky Number is: " + rnum ,cb.room_slug,"#000000","#eeeeee","bold"); tid=cb.setTimeout(StartRound, cb.settings.roundtimer*1000); } } function Init() { cb.changeRoomSubject(cb.settings.roomsubject); ShowIntro(); StartRound(0); } Init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.