Bots Home
|
Create an App
SlotMachine clone
Author:
lady_margot
Description
Source Code
Launch Bot
Current Users
Created by:
Lady_Margot
/** * App: Modifided Slot Machine from zingnaat * Version: beta * Author: Marilynkennedy4u * Date: 07.09.14 * Date: 19.06.16 custom mod f0r lady_margot */ cb.settings_choices = [ {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: 'tokens', type: 'int', label: 'Slot1 Cost per spin (in tokens)', defaultValue: 45}, {name: 'jackpot_minimum', type:'int', label:'Minimum number tokens before Slot1 jackpot', defaultValue:1000}, {name: 'prize_1', type: 'str', label: 'Slot1 Jackpot prize', defaultValue:'FETISH PASSWORD SHOW 20MN'}, {name: 'prize_2', type: 'str', label: 'Slot1 2nd prize'}, {name: 'prize_3', type: 'str', label: 'Slot1 3rd prize'}, {name: 'prize_4', type: 'str', label: 'Slot1 4th prize'}, {name: 'prize_5', type: 'str', label: 'Slot1 5th prize'}, /* {name: 'prize_6', type: 'str', label: 'Slot1 6th place prize'}, {name: 'prize_7', type: 'str', label: 'Slot1 7th place prize'}, */ {name: 's2tokens', type: 'int', label: 'Slot2 Cost per spin (in tokens)', defaultValue: 15}, {name: 's2jackpot_minimum', type:'int', label:'Minimum number tokens before Slot2 jackpot', defaultValue:300}, {name: 's2prize_1', type: 'str', label: 'Slot2 Jackpot prize', defaultValue:'SENSUAL PASSWORD SHOW 20MN'}, {name: 's2prize_2', type: 'str', label: 'Slot2 2nd prize'}, {name: 's2prize_3', type: 'str', label: 'Slot2 3rd prize'}, {name: 's2prize_4', type: 'str', label: 'Slot2 4th prize'}, {name: 's2prize_5', type: 'str', label: 'Slot2 5th prize'}, /* {name: 's2prize_6', type: 'str', label: 'Slot2 6th place prize'}, {name: 's2prize_7', type: 'str', label: 'Slot2 7th place prize'}*/ ]; var langTokens = (cb.settings.tokens > 1) ? 'tokens' : 'token'; var lastPlayer = '--'; var lastPrizeWon = '--'; var spinCounter = 0; var s2spinCounter = 0; var flagspintype = 0; var tipCounter = 0; var s2tipCounter = 0; var prizesWon = Array(); var panties = ':pantieshine'; var heart = ':heartshine'; var seven = ':sm_seven'; var lips = ':lipshine'; var cherry = ':sm_cherry'; var spank = ':spankassred'; var slotPieces = Array(panties, heart, seven, lips, cherry, spank); cb.onTip(function (tip) { flagspintype = 0; if (parseInt(tip['amount']) == cb.settings.tokens) { flagspintype = 1; tipCounter += parseInt(tip['amount']); cb.setTimeout(function() {spin(tip['from_user']);}, 2000*1); } if (parseInt(tip['amount']) == cb.settings.s2tokens) { flagspintype = 2; s2tipCounter += parseInt(tip['amount']); cb.setTimeout(function() {s2spin(tip['from_user']);}, 2000*1); } }); cb.onEnter(function (user) { var notices =''; notices +='>>> LADY MARGOT DOUBLE LUCKY MACHINE <<<\n'; notices += 'Are you Lucky ' + user['user'] + ' ? JACKPOT is a PASSWORD SHOW !\n'; notices += 'FOR FETISH PRIZES : TIP ' + cb.settings.tokens + ' ' + langTokens + ' per spin.\n'; notices += 'FOR SENSUAL PRIZES : TIP ' + cb.settings.s2tokens + ' ' + langTokens + ' per spin.\n'; notices += 'Type "/p" to SEE PRIZES.\n'; notices +='****************\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(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() { var piece = slotPieces[Math.floor(Math.random() * slotPieces.length)]; /* if((piece == panties) && (spinCounter%2 != 0)) { return cherry; }*/ return piece; } function getRow() { var row = getSlotPiece() + ' ' + getSlotPiece() + ' ' + getSlotPiece(); var heartMatches = row.match(/heart/g); if(heartMatches != null) { var numberOfhearts = heartMatches.length; if(numberOfhearts == 3) { if(flagspintype == 1){ if (parseInt(tipCounter) > parseInt(cb.settings.jackpot_minimum)) { return row; } else { getRow(); } } if(flagspintype == 2){ if (parseInt(s2tipCounter) > parseInt(cb.settings.s2jackpot_minimum)) { return row; } else { getRow(); } } } } return row; } function spin(username) { spinCounter++; var prize = '--'; var row1 = getRow(); var row2 = getRow(); var row3 = getRow(); var pantiesMatches = row2.match(/panties/g); if(pantiesMatches != null) { var numberOfpanties = pantiesMatches.length; } var heartMatches = row2.match(/heart/g); if(heartMatches != null) { var numberOfhearts = heartMatches.length; } var lipsMatches = row2.match(/lips/g); if (lipsMatches != null) { var numberOflips = lipsMatches.length; } var spankMatches = row2.match(/spank/g); if (spankMatches != null) { var numberOfspanks = spankMatches.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 = "FETISH SPIN\n"; notices += row2 + " <-- check if there is a prize \n"; notices +="***Thank you for playing***"; cb.sendNotice(notices); /* notices += 'JACKPOT: 3 hearts = ' + cb.settings.prize_1 + '\n'; notices += '2) Any combination of spank/panties = ' + cb.settings.prize_2 + '\n'; notices += '3) Any combination of heart/lips = ' + cb.settings.prize_3 + '\n'; notices += '4) Any combination + 2 or more sevens = ' + cb.settings.prize_4 + '\n'; notices += '5) Any combination + 1 or more cherries = ' + cb.settings.prize_5 + "\n"; */ if ( numberOfhearts == 3) { prize = cb.settings.s2prize_1; } else if ((numberOfspanks == 1 && numberOfpanties == 2) || (numberOfspanks == 2 && numberOfpanties == 1)) { prize = cb.settings.s2prize_2; } else if ((numberOflips == 1 && numberOfhearts == 2) || (numberOflips == 2 && numberOfhearts == 1)) { prize = cb.settings.s2prize_3; } else if (numberOfSevens == 2) { prize = cb.settings.s2prize_4; } else if ((numberOfCherries == 1) || (numberOfCherries == 2) || (numberOfCherries == 3)) { prize = cb.settings.s2prize_5; } lastPlayer = username; if(prize != '--') { lastPlayer = username; lastPrizeWon = prize; prizesWon.push(prize + ' - ' + username); cb.sendNotice( "SLOT 1 :" + username + ' WON! -->> PRIZE : ' + prize, '', '#99FF99', '', 'bold'); } else { cb.sendNotice("Slot 1:" + username + ' did not win anything. sorry, try again :) ', '', '', '#996633', 'bold'); } return prize; } function s2spin(username) { s2spinCounter++; var prize = '--'; var row1 = getRow(); var row2 = getRow(); var row3 = getRow(); var pantiesMatches = row2.match(/panties/g); if(pantiesMatches != null) { var numberOfpanties = pantiesMatches.length; } var heartMatches = row2.match(/heart/g); if(heartMatches != null) { var numberOfhearts = heartMatches.length; } var lipsMatches = row2.match(/lips/g); if (lipsMatches != null) { var numberOflips = lipsMatches.length; } var spankMatches = row2.match(/spank/g); if (spankMatches != null) { var numberOfspanks = spankMatches.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 = "SENSUAL SPIN\n"; notices += row2 + " <-- Check for prize \n"; notices +="***Thank you for playing***"; cb.sendNotice(notices); if ( numberOfhearts == 3) { prize = cb.settings.prize_1; } else if ((numberOfspanks == 1 && numberOfpanties == 2) || (numberOfspanks == 2 && numberOfpanties == 1)) { prize = cb.settings.prize_2; } else if ((numberOflips == 1 && numberOfhearts == 2) || (numberOflips == 2 && numberOfhearts == 1)) { prize = cb.settings.prize_3; } else if (numberOfSevens == 2 || (numberOfSevens == 3)) { prize = cb.settings.prize_4; } else if ((numberOfCherries == 1) || (numberOfCherries == 2) || (numberOfCherries == 3)) { prize = cb.settings.prize_5; } lastPlayer = username; if(prize != '--') { lastPlayer = username; lastPrizeWon = prize; prizesWon.push(prize + ' - ' + username); cb.sendNotice( "Slot 2:" + username + ' WON! PRIZE: ' + prize, '', '#99FF99', '', 'bold'); } else { cb.sendNotice( "Slot 2:" + username + ' did not win, sorry. :cry Try Again :)', '', '', '#996633', 'bold'); } return prize; } function showPrizes(username) { var notices = '**** FETISH PRIZES Slot 1 (TIP '+cb.settings.tokens+' tok) ****\n'; notices += 'JACKPOT: 3 hearts = ' + cb.settings.prize_1 + '\n'; notices += '2) Any combination of spank/panties = ' + cb.settings.prize_2 + '\n'; notices += '3) Any combination of heart/lips = ' + cb.settings.prize_3 + '\n'; notices += '4) Any combination + 2 or more sevens = ' + cb.settings.prize_4 + '\n'; notices += '5) Any combination + 1 or more cherries = ' + cb.settings.prize_5 + '\n\n'; /* notices += '6th) Any combination of spank/panties = ' + cb.settings.prize_6 + '\n'; notices += '7th) Any combination + 1 cherry = ' + cb.settings.prize_7 + "\n";*/ notices += '**** SENSUAL PRIZES Slot 2 (TIP '+cb.settings.s2tokens+' tok) *****\n'; notices += 'JACKPOT: 3 hearts = ' + cb.settings.s2prize_1 + '\n'; notices += '2) Any combination of spank/panties = ' + cb.settings.s2prize_2 + '\n'; notices += '3) Any combination of heart/lips = ' + cb.settings.s2prize_3 + '\n'; notices += '4) Any combination + 2 or more sevens = ' + cb.settings.s2prize_4 + '\n'; notices += '5) Any combination + 1 or more cherries = ' + cb.settings.s2prize_5 + '\n'; /* notices += '6th) Any combination of spank/panties = ' + cb.settings.s2prize_6 + '\n'; notices += '7th) Any combination + 1 cherry = ' + cb.settings.s2prize_7;*/ cb.sendNotice(notices, username, '#D1F0FF', '', 'bold'); } function showPrizesWon(username) { prizesWon.reverse(); if(prizesWon.length == 0) { cb.sendNotice('No one has won anything yet. Play the slot machine to win a prize!', username, '', '#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++; } cb.sendNotice(notices, username, '#EBFFEB', '', 'bold'); } } function advertise() { var notices =''; notices +='>>> LADY MARGOT DOUBLE LUCKY MACHINE <<<\n'; notices += 'Are you Lucky ? JACKPOT is a PASSWORD SHOW !\n'; notices += 'FOR FETISH PRIZES : TIP ' + cb.settings.tokens + ' ' + langTokens + ' per spin.\n'; notices += 'FOR SENSUAL PRIZES : TIP ' + cb.settings.s2tokens + ' ' + langTokens + ' per spin.\n'; notices += 'Type "/p" to SEE PRIZES.\n'; notices +='****************\n'; notices += 'Type "/w" to see a list of the last 20 prizes won.'; cb.sendNotice(notices, '', '', '#FF6600', 'bold'); cb.setTimeout(advertise, cb.settings.notice_wait_time * 60000); } function init() { advertise(); } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.