Bots Home
|
Create an App
blkjmp
Author:
lugubal
Description
Source Code
Launch Bot
Current Users
Created by:
Lugubal
cb.settings_choices = [ {name: 'numOfGoal', type:'int', minValue:5,maxValue:99,defaultValue:25,label:"Number Of Goals (5 to 99, recommend 25-30)"}, {name: 'numsOnBoard', type:'int', minValue:25,maxValue:200,defaultValue:50,label:"Numbers On Board (min 25, max 200, recommend 50)"}, {name: 'roomTxt', type:'str', minLength:1,maxLength:500,label:"Room Subject (recommend listing major goals)",defaultValue:"Hi-Lo Game! Guess The Secret Number To Win A Prize!"}, {name: 'notificationsPerMin', type:'int', minValue:2,maxValue:10,defaultValue:4,label:"Notification Delay In Minutes (range 2-10, recomend 4-5)"}, {name: 'numOfMinorPrizes', type:'int', minValue:1,maxValue:15,defaultValue:10,label:"Number Of Minor Prizes (max of 15, recommended 10)"}, {name: 'minorPrize1', type:'str', minLength:1,maxLength:250,label:"Minor Prize 1",defaultValue:'Flash Boobies'}, {name: 'minorPrize2', type:'str', minLength:1,maxLength:250,label:"Minor Prize 2",defaultValue:'Ass Flash',required: false}, {name: 'minorPrize3', type:'str', minLength:1,maxLength:250,label:"Minor Prize 3",defaultValue:'Pussy Flash',required: false}, {name: 'minorPrize4', type:'str', minLength:1,maxLength:250,label:"Minor Prize 4",defaultValue:'Pussy Tease',required: false}, {name: 'minorPrize5', type:'str', minLength:1,maxLength:250,label:"Minor Prize 5",defaultValue:'5 Spanks',required: false}, {name: 'minorPrize6', type:'str', minLength:1,maxLength:250,label:"Minor Prize 6",defaultValue:'Dildo BJ',required: false}, {name: 'minorPrize7', type:'str', minLength:1,maxLength:250,label:"Minor Prize 7",defaultValue:'5 Squats',required: false}, {name: 'minorPrize8', type:'str', minLength:1,maxLength:250,label:"Minor Prize 8",defaultValue:'5 Flogger Spanks',required: false}, {name: 'minorPrize9', type:'str', minLength:1,maxLength:250,label:"Minor Prize 9",defaultValue:'Sexy Dance',required: false}, {name: 'minorPrize10', type:'str', minLength:1,maxLength:250,label:"Minor Prize 10",defaultValue:'You Choose!',required: false}, {name: 'minorPrize11', type:'str', minLength:1,maxLength:250,label:"Minor Prize 11",defaultValue:'You Choose!',required: false}, {name: 'minorPrize12', type:'str', minLength:1,maxLength:250,label:"Minor Prize 12",defaultValue:'You Choose!',required: false}, {name: 'minorPrize13', type:'str', minLength:1,maxLength:250,label:"Minor Prize 13",defaultValue:'You Choose!',required: false}, {name: 'minorPrize14', type:'str', minLength:1,maxLength:250,label:"Minor Prize 14",defaultValue:'You Choose!',required: false}, {name: 'minorPrize15', type:'str', minLength:1,maxLength:250,label:"Minor Prize 15",defaultValue:'You Choose!',required: false}, {name: 'numOfMajorPrizes', type:'int', minValue:1,maxValue:5,defaultValue:5,label:"Number Of Major Prizes (max of 5)"}, {name: 'majorPrize1', type:'str', minLength:1,maxLength:250,label:"Major Prize 1",defaultValue:'Shirt Off'}, {name: 'majorPrize2', type:'str', minLength:1,maxLength:250,label:"Major Prize 2",defaultValue:'Shorts Off',required: false}, {name: 'majorPrize3', type:'str', minLength:1,maxLength:250,label:"Major Prize 3",defaultValue:'Bra Off',required: false}, {name: 'majorPrize4', type:'str', minLength:1,maxLength:250,label:"Major Prize 4",defaultValue:'Panties Off',required: false}, {name: 'majorPrize5', type:'str', minLength:1,maxLength:250,label:"Major Prize 5",defaultValue:'Cumshow!',required: false}, {name: 'autoWinAt', type:'int', minValue:30,maxValue:2000,defaultValue:500,label:"Auto Win Goal At (Must be higher than Numbers On Board, min 30 max 2000)"} ]; var globals = new Object(); function shuffle(array) { var m = array.length, t, i; while (m) { i = Math.floor(Math.random() * m--); t = array[m]; array[m] = array[i]; array[i] = t; } return array; } function initApp() { try { if (cb.settings.numsOnBoard >= cb.settings.autoWinAt) { throw "Incorrect Settings. Auto Win too low. Restart And Correct The Issue.";} globals.numsArray = new Array(); for (x=0;x<cb.settings.numOfGoal;x++) { globals.numsArray[x] = Math.floor((Math.random() * cb.settings.numsOnBoard) + 1); }; globals.minorPrizeList = new Array(); for (y=0;y<cb.settings.numOfMinorPrizes;y++) { var a = y+1; var b = String(eval("cb.settings.minorPrize"+a)); if (b == "") { throw "Incorrect Settings. You need required minor prize(s). Restart And Correct The Issue."; } if ((b.indexOf("[")>-1)||(b.indexOf("]")>-1)||(b.indexOf("{")>-1)||(b.indexOf("}")>-1)||(b.indexOf("+")>-1)) { throw "Incorrect Settings, Malformatted Minor Prize. Remove any spcial characters like [],{},+,etc. Restart And Correct The Issue."; } globals.minorPrizeList[y] = b; }; globals.minorPrizeArray = new Array(); var numOfMinorPrizes = cb.settings.numOfGoal - cb.settings.numOfMajorPrizes var concatnum = Math.floor(numOfMinorPrizes/cb.settings.numOfMinorPrizes); for (x=0;x<concatnum;x++) { globals.minorPrizeArray = globals.minorPrizeArray.concat(globals.minorPrizeList); } var numMinorLeft = numOfMinorPrizes - (concatnum * cb.settings.numOfMinorPrizes); var temparray = globals.minorPrizeList.slice(0); for (x=0;x<numMinorLeft;x++) { //cb.log(temparray.length); var prizenum = Math.floor(Math.random() * temparray.length); globals.minorPrizeArray.push(temparray[prizenum]); temparray.splice(prizenum,1); } //cb.log(globals.minorPrizeArray.length+" should equal "+numOfMinorPrizes); globals.minorPrizeArray = shuffle(globals.minorPrizeArray); var prizestring = globals.minorPrizeArray.toString(); //cb.log(prizestring); globals.majorPrizeArray = new Array(); for (y=0;y<cb.settings.numOfMajorPrizes;y++) { var a = y+1; if (a==cb.settings.numOfMajorPrizes) { var pp = cb.settings.numOfGoal; } else { var pp = a * Math.floor(cb.settings.numOfGoal / cb.settings.numOfMajorPrizes) } var b = String(eval("cb.settings.majorPrize"+a)); if (b == "") { throw "Incorrect Settings. You need required major prize(s). Restart And Correct The Issue."; } if ((b.indexOf("[")>-1)||(b.indexOf("]")>-1)||(b.indexOf("{")>-1)||(b.indexOf("}")>-1)||(b.indexOf("+")>-1)) { throw "Incorrect Settings, Malformatted Major Prize. Remove any spcial characters like [],{},+,etc. Restart And Correct The Issue."; } globals.majorPrizeArray[y] = [pp,b]; }; globals.onGoalNum = 0; globals.onMajorNum = 0; globals.tipsThisGoal = 0; globals.rangeThisGoal = [1,cb.settings.numsOnBoard]; if (globals.majorPrizeArray[0][0] != 1) { globals.nextPrizeTxt = "Minor Prize"; } else { if (globals.onMajorNum == cb.settings.numOfMajorPrizes-1) { globals.nextPrizeTxt = "GRAND PRIZE - " } else { globals.nextPrizeTxt = "MAJOR Prize - " } globals.nextPrizeTxt += globals.majorPrizeArray[0][1]; } globals.rungame = true; cb.drawPanel(); cb.changeRoomSubject("#Hi-Lo "+cb.settings.roomTxt); printnotice(); globals.stats = new Object(); globals.stats.numtips = 0; globals.stats.totaltips = 0; globals.stats.tipspergoal = new Array(); globals.stats.tipspergoal[0] = 0; } catch(err) { cb.sendNotice("ERROR: "+err, cb.room_slug,'#DA4F49','','bold'); global.rungame = false; } } function completegoal() { globals.onGoalNum += 1; globals.rangeThisGoal = [1,cb.settings.numsOnBoard]; globals.tipsThisGoal = 0; globals.stats.tipspergoal[globals.onGoalNum] = 0; if (globals.onGoalNum == cb.settings.numOfGoal) { globals.rungame = false; cb.chatNotice("Thanks For Playing! Kick back and enjoy the GRAND PRIZE of "+globals.majorPrizeArray[cb.settings.numOfMajorPrizes-1][1],'','#003053','#FFFFFF','bolder'); globals.nextPrizeTxt = "Game Over! Thanks For Playing!"; } else { if ((globals.majorPrizeArray[globals.onMajorNum][0]-1) != globals.onGoalNum) { globals.nextPrizeTxt = "Minor Prize"; } else { if (globals.onMajorNum == cb.settings.numOfMajorPrizes-1) { globals.nextPrizeTxt = "GRAND PRIZE - " } else { globals.nextPrizeTxt = "MAJOR Prize - " } globals.nextPrizeTxt += globals.majorPrizeArray[globals.onMajorNum][1]; } } cb.drawPanel(); } function gen_tipmessage(tiptype) { var msgarray = ["Nope... Secret number is "+tiptype+" than that", "Sorry, but you're looking for a number "+tiptype+" than that", "OOoooo sorry but no, try a "+tiptype+" number next time"], msgnum = Math.floor(Math.random() * msgarray.length); return msgarray[msgnum]; } function runtip(tipObj) { if (globals.rungame) { tipamount = parseInt(tipObj['amount']); globals.stats.numtips += 1; globals.stats.totaltips += tipamount; globals.stats.tipspergoal[globals.onGoalNum] += tipamount globals.tipsThisGoal += 1; if (tipamount == globals.numsArray[globals.onGoalNum]) { var msgnum = Math.floor((Math.random() * 3) + 1); var msgtxt = ""; if ((tipObj['from_user']=="wesman1111")&(tipamount==11)&(cb.room_slug=="sexkitteh")) { msgtxt = "OMG WES..... THE NUMBER IS 11!! OMG OMG OMG!!!\n :dance2"; } else { switch (msgnum) { case 1: if (cb.room_slug=="sexkitteh") { msgtxt = "Winner Winner TOFU Chicken Dinner!"} else { msgtxt = "Winner Winner Chicken Dinner!"}; break; case 2: msgtxt = "DING DING DING We have a winner!"; break; case 3: msgtxt = "Give a round of applause for OUR WINNER!"; break; }; } msgtxt += "\n"+tipObj['from_user']+" found the secret number of "+tipamount+"!"; if (globals.onGoalNum == (globals.majorPrizeArray[globals.onMajorNum][0]-1)) { msgtxt += "\nand won a MAJOR PRIZE of: "+globals.majorPrizeArray[globals.onMajorNum][1]; globals.onMajorNum += 1; } else { var mprize = globals.minorPrizeArray[globals.onGoalNum-globals.onMajorNum]; if (mprize == null) { //cb.log("found null, getting new prize"); var prizenum = Math.floor(Math.random() * cb.settings.numOfMinorPrizes); mprize = globals.minorPrizeList[prizenum]; } msgtxt += "\nand won a minor prize of: "+mprize; } cb.chatNotice(msgtxt,'','#003053','#FFFFFF','bolder'); completegoal(); } else if (tipamount >= cb.settings.autoWinAt) { if ((tipObj['from_user']=="wesman1111")&(tipamount>=1000)&(cb.room_slug=="sexkitteh")) { var msgtxt = "There goes Wes again... showing off his high tips :phashi-lo-westip \nWell, Wes automatically wins the goal," } else { var msgtxt = "HOLY MOTHER OF.... Well, We Have a Winner!\n"+tipObj['from_user']+" automatically wins the goal," } if (globals.onGoalNum == (globals.majorPrizeArray[globals.onMajorNum][0]-1)) { msgtxt += "\nand won a MAJOR PRIZE of: "+globals.majorPrizeArray[globals.onMajorNum][1]; globals.onMajorNum += 1; } else { var mprize = globals.minorPrizeArray[globals.onGoalNum-globals.onMajorNum]; if (mprize == null) { //cb.log("found null, getting new prize"); var prizenum = Math.floor(Math.random() * cb.settings.numOfMinorPrizes); mprize = globals.minorPrizeList[prizenum]; } msgtxt += "\nand won a minor prize of: "+mprize; } cb.chatNotice(msgtxt,'','#003053','#FFFFFF','bolder'); completegoal(); } else if (tipamount > cb.settings.numsOnBoard) { cb.chatNotice("Woah!?!? You really think the secret number is THAT high?",'','#FAA732','','bolder'); } else if (tipamount < globals.numsArray[globals.onGoalNum]) { var msgtext = ""; if ((tipObj['from_user']=="wesman1111")&(tipamount==11)&(cb.room_slug=="sexkitteh")) { msgtext +="No Wes, the secret number IS NOT 11...."; } msgtext += gen_tipmessage("HIGHER"); if (tipamount >= globals.rangeThisGoal[0]) { globals.rangeThisGoal[0] = tipamount+1; } msgtext += "\nThe range the secret number for this goal lies in is "+globals.rangeThisGoal[0]+" to "+globals.rangeThisGoal[1]; cb.chatNotice(msgtext,'','#FAA732','','bolder'); } else if (tipamount > globals.numsArray[globals.onGoalNum]) { var msgtext = ""; if ((tipObj['from_user']=="wesman1111")&(tipamount==11)&(cb.room_slug=="sexkitteh")) { msgtext +="No Wes, the secret number IS NOT 11...."; } msgtext += gen_tipmessage("LOWER"); if (tipamount <= globals.rangeThisGoal[1]) { globals.rangeThisGoal[1] = tipamount-1; } msgtext += "\nThe range the secret number for this goal lies in is "+globals.rangeThisGoal[0]+" to "+globals.rangeThisGoal[1]; cb.chatNotice(msgtext,'','#FAA732','','bolder'); } } } cb.onTip(function(tip){ runtip(tip); }); cb.onDrawPanel(function() { if (globals.rungame) {var row3txt = globals.majorPrizeArray[globals.onMajorNum][1]+' at '+globals.majorPrizeArray[globals.onMajorNum][0]+' goals!'; } else { var row3txt = "";} return { 'template': '3_rows_of_labels', 'row1_label': 'Hi-Lo Goals Won', 'row1_value': globals.onGoalNum, 'row2_label': 'Next Prize', 'row2_value': globals.nextPrizeTxt, 'row3_label': '', 'row3_value': row3txt }; }); function printnotice() { if (globals.rungame) { manual_printnotice(''); cb.setTimeout(printnotice, cb.settings.notificationsPerMin*60000); } } function manual_printnotice(touser) { if (globals.rungame) { cb.chatNotice(cb.room_slug+"\'s Hi-Lo Game!\nFind The Secret Number By Tipping Your Guess!\nNumbers range from 1 to "+cb.settings.numsOnBoard+"\nCurrent Goal is for "+globals.nextPrizeTxt+"\nTip "+cb.settings.autoWinAt+" in a single tip to automatically win the goal!\nType /showrange to see the range of numbers left for the curent goal. Type /p to see a full prize list.",touser,'#84CA84','','bolder'); } } function gen_prizelist() { var msgtext = "**Hi-Lo Prize List**\nMinor Prizes: "; for (i=0;i<globals.minorPrizeList.length;i++) { if (i>0) { msgtext += ", "; }; msgtext += globals.minorPrizeList[i]; }; msgtext += "\nMajor Prizes:" for (p=0;p<globals.majorPrizeArray.length;p++) { if (globals.onMajorNum < globals.majorPrizeArray[p][0]) { msgtext += "\nAt Goal "+globals.majorPrizeArray[p][0]+" - "+globals.majorPrizeArray[p][1]; } }; return msgtext; } function gen_stats() { var statsmsg = "Hi-Lo Stats\n Total Tips This Session: "+globals.stats.numtips+"\nTotal Tokens Collected This Session: "+globals.stats.totaltips+"\nTips Made Per Goal:"; for (z=0;z<globals.stats.tipspergoal.length;z++) { zz = z+1 statsmsg += "\nGoal "+zz+" - "+globals.stats.tipspergoal[z]+""; } return statsmsg; } cb.onEnter(function(user) { var entryuser = user['user']; if (entryuser != cb.room_slug) { manual_printnotice(entryuser); } }); cb.onMessage(function(msg) { var message = msg['m'].split(" "); //remove emotes.... if (message.length >= 2) { while ((message[0].substring(0,1) == ":")|(message[0].substring(0,1) == "|")) { message.shift(); if (message.length == 1) {break;} } } switch (message[0]) { case '/p': case '!p': if (globals.rungame) { var mymessage = gen_prizelist(); if ((msg['user'] == cb.room_slug)|(msg['is_mod'])) { msg['m'] += " (Prize List Sent To All)"; cb.sendNotice(mymessage,'','','','bold'); } else { msg['m'] += " (Prize List Sent To "+msg['user']+")"; cb.sendNotice(mymessage,msg['user'],'','','bold'); }; } break; case '/shownotice': case '!shownotice': if (globals.rungame) { if ((msg['user'] == cb.room_slug)|(msg['is_mod'])) { msg['X-Spam'] = true; cb.setTimeout(function() { manual_printnotice(''); }, 1000); } } break; case '/showrange': case '!showrange': if (globals.rungame) { var mymessage = "The range the secret number for this goal lies in is "+globals.rangeThisGoal[0]+" to "+globals.rangeThisGoal[1]; if ((msg['user'] == cb.room_slug)|(msg['is_mod'])) { msg['m'] += " (Range Sent To All)"; cb.sendNotice(mymessage,'','#FAA732','','bolder'); } else { msg['m'] += " (Range Sent To "+msg['user']+")"; cb.sendNotice(mymessage,msg['user'],'#FAA732','','bolder'); }; } break; case '/stats': case '!stats': if (msg['user'] == cb.room_slug) { msg['X-Spam'] = true; var statsmsg = gen_stats(); cb.sendNotice(statsmsg, cb.room_slug); } break; case '/hurrygoal': case '!hurrygoal': case '/skipgoal': case '!skipgoal': case '/nextgoal': case '!nextgoal': if (globals.rungame) { if (msg['user'] == cb.room_slug) { msg['X-Spam'] = true; cb.sendNotice("Advnacing to next goal...", cb.room_slug); completegoal(); } } break; case '/phasdebug': if (msg['user'] == 'phasmaex') { msg['X-Spam'] = true; cb.sendNotice("curnum "+globals.numsArray[globals.onGoalNum], 'phasmaex','#DA4F49','','bold'); var statsmsg = gen_stats(); cb.sendNotice(statsmsg, 'phasmaex'); } break; } return msg; }); cb.setTimeout(initApp, 1000);
© Copyright Chaturbate 2011- 2024. All Rights Reserved.