Bots Home
|
Create an App
testytester test
Author:
testytester
Description
Source Code
Launch Bot
Current Users
Created by:
Testytester
cb.settings_choices = [ {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 kitten1)', defaultValue:'cum'}, ]; var board = {}; var dimX = 4; var dimY = 3; var tiles = [ ':mm_kitten1', ':mm_kitten2', ':mm_kitten3', ':mm_kitten4', ':mm_kitten5', ':mm_kitten6' ]; var board = null; var hiddenTile = "X"; var tileSpacer = " "; cb.onTip(function (tip) { }); cb.onMessage (function (msg) { //if (msg ['m'].match(/^\/mp showboard/i)) { if (msg ['m'].match(/^\/a/i)) { msg ['X-Spam'] = true; showBoard (msg ['user']); } else if (msg ['m'].match(/^\/b/i)) { } return msg; }); function showBoard (username) { var notices = "Current board:"; notices += "\n----------------"; notices += "\nColumn"; for (var x = 0; x < dimX; ++x) { notices += (tileSpacer + String (x + 1)); } for (var y = 0; y < dimY; ++y) { var row = "\n Row " + String.fromCharCode (y + 65) + ":"; for (var x = 0; x < dimX; ++x) { if (board [x][y].revealed) { row += (tileSpacer + board [x][y].tile); } else { row += (tileSpacer + hiddenTile); } } notices += row; } cb.sendNotice(notices, username, '#EBFFEB', '', 'bold'); }; function newBoard () { board = []; var allTiles = []; for (var i = 0; i < tiles.length; ++i) { allTiles.push (i); allTiles.push (i); } shuffle (allTiles); var idx = 0; for (var x = 0; x < dimX; ++x) { var column = []; board.push (column); for (var y = 0; y < dimY; ++y) { column.push ({revealed: false, tile: allTiles [idx]}); ++idx; } } }; function shuffle(array) { var currentIndex = array.length; var tempValue; var randomIndex; // While there remain elements to shuffle... while (0 !== currentIndex) { randomIndex = Math.floor (Math.random () * currentIndex); currentIndex -= 1; tempValue = array [currentIndex]; array [currentIndex] = array [randomIndex]; array [randomIndex] = tempValue; } return array; } newBoard ();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.