Apps Home
|
Create an App
TCKY31 TEST slots
Author:
atthem
Description
Source Code
Launch App
Current Users
Created by:
Atthem
//Summary /* Modification of zingknaat's Slot Machine app */ //Description /* Modifed by atthem for TCKY31. Credit goes to zingknaat for the original app. This bot is modified from the original specifically for tcky31. Your results may vary */ /* Update Log ---------------------------------------------------------------- 2017-04-12 Added subject line setting. Added commands for Model and Mods to broadcast prize list to room. Fan Club Members have a % chance (app setting) of getting their prize upgraded to the next level (onyl if some prize won). Changed up odds of symbols coming up to be more like a real slot machine. Now, the random function is changed to choose a number from 1 to 20 and select the symbol based on the result as follows: 1-6: Cherry 7-11: Lube 12-15: Fleshlight 16-18: Seven 19-20: Dildo The prize chart is now: Jackpot: 3 Dildos (no change) 2nd prize: 3 Sevens (no change) 3rd prize: 3 Fleshlights (no change) 4th prize: 3 Lubes (no change) 5th prize: 3 cherries (was 2 cherries) 6th prize: 2 cherries (was and combo of condoms and dildos) 7th prize: 1 cherry (no change) The odds chart is now: Jackpot: 1 in 1000 (was 2 in 1000 - slight decrease) 2nd prize: 3.4 in 1000 (was 4.6 in 1000 - slight decrease) 3rd prize: 8 in 1000 (was 4.6 in 1000 - slight increase) 4th prize: 15.6 in 1000 (was 4.6 in 1000 - increased) 5th prize: 27 in 1000 (was 21 in 1000 - increased) 6th prize: 189 in 1000 (was 146 in 1000 - increased) 7th prize: 441 in 1000 (was 395 in 1000 - increased) Overall chance to win: 685 in 1000 (was 578 in 1000 - increased) As you can see, the old system had the same chance to win 2nd, 3rd, or 4th place prizes. This made no sense to me. I also removed the condom image from the game to simplify the prizes. ------------------------------------------------------------------------------*/ // change notice color? // upload custom images for reels? cb.settings_choices = [ {name: 'subject', type: 'str', label: 'Room Subject', defaultValue: 'Let\'s play the slot machine!'}, {name: 'fanOdds', type: 'int', label: 'Percent chance to upgrade prize won for Fan Club Members', defaultValue: 10}, {name: 'tokens', type: 'int', label: 'Cost per spin (in tokens)', defaultValue: 25}, {name: 'notice_wait_time', type: 'choice', label: 'Notification Time (in minutes)', choice1: 1, choice2: 2, choice3: 3, choice4: 4, choice5: 5, choice6: 10, choice7: 15, choice8: 20, choice9: 25, choice10: 30, choice11: 45, choice12: 60, defaultValue: 10}, {name: 'jackpot_minimum', type:'int', label:'Minimum number tokens before jackpot', defaultValue:1000}, {name: 'prize_1', type: 'str', label: 'Jackpot prize (3 dildos)', defaultValue:'cum'}, {name: 'prize_2', type: 'str', label: '2nd place prize (3 sevens)'}, {name: 'prize_3', type: 'str', label: '3rd place prize (3 fleshlights)'}, {name: 'prize_4', type: 'str', label: '4th place prize (3 bottles of lube)'}, {name: 'prize_5', type: 'str', label: '5th place prize (3 cherries)'}, {name: 'prize_6', type: 'str', label: '6th place prize (any 2 cherries)'}, {name: 'prize_7', type: 'str', label: '7th place prize (any 1 cherry)'} ]; var langTokens = (cb.settings.tokens > 1) ? 'tokens' : 'token'; var lastPlayer = '--'; var lastPrizeWon = '--'; var spinCounter = 0; var tipCounter = 0; var prizesWon = Array(); var dildo = ':sm_dildo'; var lube = ':sm_lube'; var seven = ':sm_seven'; var fleshlight = ':sm_fleshlight'; var cherry = ':sm_cherry'; cb.onTip(function (tip) { tipCounter += parseInt(tip['amount']); if (parseInt(tip['amount']) >= cb.settings.tokens) { var numberOfSpins = Math.floor(parseInt(tip['amount'])/cb.settings.tokens); for(var i=1;i<=numberOfSpins;i++) { cb.setTimeout(function() { // is tipper a fan club member? if (tip['from_user_in_fanclub']) { spin(tip['from_user'],'fanClub'); } else { spin(tip['from_user']); } }, 2000*i); } } }); cb.onDrawPanel(function (user) { return { 'template': '3_rows_12_22_31', 'row1_label': 'Last prize won:', 'row1_value': lastPrizeWon, 'row2_label': 'Last player:', 'row2_value': lastPlayer, 'row3_value': tipCounter + ' ' + langTokens + ' received / spun ' + spinCounter + ' time(s)' }; }); cb.onEnter(function (user) { var notices = "Welcome, " + user['user'] + ". We are playing the slot machine.\n"; notices += 'Tip ' + cb.settings.tokens + ' ' + langTokens + ' to spin the reels.\n'; notices += 'Type "/p" to see the 7 possible prizes.\n'; notices += 'Type "/w" to see a list of the last 20 prizes won.'; cb.sendNotice(notices, user['user'], '', '#FF6600', 'bold'); }); cb.onMessage(function(msg) { // if model or mod, broadcast to room if ((msg['user'] == cb.room_slug) || (msg['is_mod'])) { if(msg['m'].match(/\/w/i)) { msg['X-Spam'] = true; showPrizesWon(); } else if(msg['m'].match(/\/p/i)) { msg['X-Spam'] = true; showPrizes(); } } else { if(msg['m'].match(/\/w/i)) { msg['X-Spam'] = true; showPrizesWon(msg['user']); } else if(msg['m'].match(/\/p/i)) { msg['X-Spam'] = true; showPrizes(msg['user']); } } return msg; }); function getSlotPiece() { // get random number from 1 to 20 var pieceNum = Math.floor(Math.random() * 20) + 1; // return piece based on random number if (pieceNum <= 6) { return cherry; } else if (pieceNum <= 11) { return lube; } else if (pieceNum <= 15) { return fleshlight; } else if (pieceNum <= 18) { return seven; } else { return dildo; } } function getRow() { var row = getSlotPiece() + ' ' + getSlotPiece() + ' ' + getSlotPiece(); // if minimum tip for jackpot not met, reroll any jackpots var dildoMatches = row.match(/dildo/g); if(dildoMatches != null) { var numberOfDildos = dildoMatches.length; if((numberOfDildos == 3) && (parseInt(tipCounter) >= parseInt(cb.settings.jackpot_minimum))) { return row; } else { getRow(); } } return row; } function spin(username,fanClub) { spinCounter++; var prize = '--'; var fanUpgrade = false; var row1 = getRow(); var row2 = getRow(); var row3 = getRow(); var dildoMatches = row2.match(/dildo/g); if(dildoMatches != null) { var numberOfDildos = dildoMatches.length; } var lubeMatches = row2.match(/lube/g); if(lubeMatches != null) { var numberOfLubes = lubeMatches.length; } var fleshlightMatches = row2.match(/fleshlight/g); if (fleshlightMatches != null) { var numberOfFleshlights = fleshlightMatches.length; } var sevenMatches = row2.match(/seven/g); if (sevenMatches != null) { var numberOfSevens = sevenMatches.length; } var cherryMatches = row2.match(/cherry/g); if (cherryMatches != null) { var numberOfCherries = cherryMatches.length; } var notices = row1 + "\n"; notices += row2 + " <-- pay line \n"; notices += row3; cb.sendNotice(notices); if (numberOfDildos == 3) { prize = cb.settings.prize_1; } else if (numberOfSevens == 3) { prize = cb.settings.prize_2; } else if (numberOfFleshlights == 3) { prize = cb.settings.prize_3; } else if (numberOfLubes == 3) { prize = cb.settings.prize_4; } else if (numberOfCherries == 3) { prize = cb.settings.prize_5; } else if (numberOfCherries == 2) { prize = cb.settings.prize_6; } else if (numberOfCherries == 1) { prize = cb.settings.prize_7; } lastPlayer = username; if(prize != '--') { // chance to upgrade prize if fan club if (fanClub) { // random number 1-100 var rndNum = Math.floor(Math.random() * 100) + 1; // if random number is less than or equal to chance setting if (rndNum <= cb.settings.fanOdds) { fanUpgrade = true; // upgrade prize if (prize == cb.settings.prize_1) { prize = cb.settings.prize_2; } else if (prize == cb.settings.prize_2) { prize = cb.settings.prize_3; } else if (prize == cb.settings.prize_3) { prize = cb.settings.prize_3; } else if (prize == cb.settings.prize_4) { prize = cb.settings.prize_4; } else if (prize == cb.settings.prize_5) { prize = cb.settings.prize_5; } else if (prize == cb.settings.prize_6) { prize = cb.settings.prize_6; } // notify room of good luck cb.sendNotice(username + ' got a random prize upgrade for being a Fan Club Member!!! Nice!', '', '', '#00b300', 'bold'); } } lastPlayer = username; lastPrizeWon = prize; prizesWon.push(prize + ' - ' + username); cb.sendNotice(username + ' won a prize! Prize: ' + prize, '', '#99FF99', '', 'bold'); } else { cb.sendNotice(username + ' did not win anything. :cry', '', '', '#996633', 'bold'); } cb.drawPanel(); } function showPrizes(username) { var notices = '**** Possible Prizes ****\n'; notices += '1st) 3 dildos (jackpot) = ' + cb.settings.prize_1 + '\n'; notices += '2nd) 3 sevens = ' + cb.settings.prize_2 + '\n'; notices += '3rd) 3 fleshlights = ' + cb.settings.prize_3 + '\n'; notices += '4th) 3 bottles of Lube = ' + cb.settings.prize_4 + '\n'; notices += '5th) 3 cherries = ' + cb.settings.prize_5 + '\n'; notices += '6th) Any 2 cherries = ' + cb.settings.prize_6 + '\n'; notices += '7th) Any 1 cherry = ' + cb.settings.prize_7; if (username) { cb.sendNotice(notices, username, '#D1F0FF', '', 'bold'); } else { cb.sendNotice(notices, '', '#D1F0FF', '', 'bold'); } } function showPrizesWon(username) { prizesWon.reverse(); if(prizesWon.length == 0) { if (username) { cb.sendNotice('No one has won anything yet. Play the slot machine to win a prize!', username, '', '#CC0000', 'bold'); } else { cb.sendNotice('No one has won anything yet. Play the slot machine to win a prize!', '', '', '#CC0000', 'bold'); } } else { prizesWon.slice(0,20); var notices = "**** Last 20 Winners ****"; var prizeNum = 1; var totalWon = prizesWon.length; if(prizesWon.length >= 20) totalWon = 20; for(var i=0; i<totalWon;i++) { notices += "\n" + prizeNum + ") " + prizesWon[i]; prizeNum++; } if (username) { cb.sendNotice(notices, username, '#EBFFEB', '', 'bold'); } else { cb.sendNotice(notices, '', '#EBFFEB', '', 'bold'); } } } function advertise() { var notices = "Slot Machine by atthem\n"; notices += 'Tip ' + cb.settings.tokens + ' ' + langTokens + ' to spin the reels.\n'; notices += 'Type "/p" to see the 7 possible prizes.\n'; notices += 'Type "/w" to see a list of the last 20 winners.'; cb.sendNotice(notices, '', '', '#FF6600', 'bold'); cb.setTimeout(advertise, cb.settings.notice_wait_time * 60000); } function init() { advertise(); cb.changeRoomSubject(cb.settings.subject); } init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.