tok124

myjsscript

Sep 6th, 2021
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Title: "Veronica_Space Bot" bot
  2.     Author: Tok124
  3.     Version: 1.0.0
  4. */
  5.  
  6. var tip_amt = 0;
  7. var menumsg;
  8. var fanmenumsg;
  9. var MAXITEMS=30;
  10. var tipmenuprice = [];
  11. var tipmenuitem = [];
  12. var f = 0;
  13. var preventSpam = [];
  14. var gender = "";
  15. let users =[cb.room_slug];
  16. let pass=Math.floor((Math.random() * 9000) + 1001);
  17. let number =['zero','one','two','three','four','five','six','seven','eight','nine'];
  18. let passp=pass.toString().split("");
  19. let usernotice1="To prevent spambots users without tokens must first enter the following number to be able to chat.\n";
  20. let usernotice2=number[passp[0]]+" "+number[passp[1]]+" "+number[passp[2]]+" "+number[passp[3]]+"  (enter as a number , e.g. 2345)";
  21. let usernotice3=usernotice1+usernotice2;
  22.  
  23. // Start RTD-Improved Variables
  24. var price = cb.settings.tokens;
  25. var langTokens = (price > 1) ? 'tokens' : 'token';
  26. var numberOfSides = (cb.settings.die_type == 'Traditional') ? 6 : 10;
  27. var multiRolls = cb.settings.multirolls;
  28. var lastRoller = '--';
  29. var lastPrizeWon = '--';
  30. var rollCounter = 0;
  31. var tipCounter = 0;
  32. var winners = [];
  33. var prizes = [];
  34. var minimumRollsToGetRareDice = parseInt(cb.settings.minimum_rolls);
  35. var maxOutcome = (cb.settings.die_type == 'Traditional') ? 13 : 21;
  36. var dieImagePrefix = (cb.settings.die_type == 'Traditional') ? ':reddie_' : ':cdie';
  37. var rareChance = parseInt(cb.settings.rarechance);    // percent chance of rolling a RARE (minimum rolls must also be met)
  38. // End TRD-Improved Variables
  39.  
  40. cb.settings_choices = [
  41.   {name:'alignmenu', type:'choice', label:'Align Menu',choice1:'Vertically', choice2:'Horizontally', defaultValue:'Vertically'},
  42.   {name:'item1', type:'str', label:'Item 1 (eg 10--flash tits)',},
  43.   {name:'item2', type:'str', required: false, label:'Item 2',},
  44.   {name:'item3', type:'str', required: false, label:'Item 3',},
  45.   {name:'item4', type:'str', required: false, label:'Item 4',},
  46.   {name:'item5', type:'str', required: false, label:'Item 5',},
  47.   {name:'item6', type:'str', required: false, label:'Item 6',},
  48.   {name:'item7', type:'str', required: false, label:'Item 7',},
  49.   {name:'item8', type:'str', required: false, label:'Item 8',},
  50.   {name:'item9', type:'str', required: false, label:'Item 9',},
  51.   {name:'item10', type:'str', required: false, label:'Item 10',},
  52.   {name:'item11', type:'str', required: false, label:'Item 11)',},
  53.   {name:'item12', type:'str', required: false, label:'Item 12',},
  54.   {name:'item13', type:'str', required: false, label:'Item 13',},
  55.   {name:'item14', type:'str', required: false, label:'Item 14',},
  56.   {name:'item15', type:'str', required: false, label:'Item 15',},
  57.   {name:'item16', type:'str', required: false, label:'Item 16',},
  58.   {name:'item17', type:'str', required: false, label:'Item 17',},
  59.   {name:'item18', type:'str', required: false, label:'Item 18',},
  60.   {name:'item19', type:'str', required: false, label:'Item 19',},
  61.   {name:'item20', type:'str', required: false, label:'Item 20',},
  62.   {name:'item21', type:'str', required: false, label:'Item 21',},
  63.   {name:'item22', type:'str', required: false, label:'Item 22',},
  64.   {name:'item23', type:'str', required: false, label:'Item 23',},
  65.   {name:'item24', type:'str', required: false, label:'Item 24',},
  66.   {name:'item25', type:'str', required: false, label:'Item 25',},
  67.   {name:'item26', type:'str', required: false, label:'Item 26',},
  68.   {name:'item27', type:'str', required: false, label:'Item 27',},
  69.   {name:'item28', type:'str', required: false, label:'Item 28',},
  70.   {name:'item29', type:'str', required: false, label:'Item 29',},
  71.   {name:'item30', type:'str', required: false, label:'Item 30',},
  72.   {name:'noticecolor', type:'str', label:'Notice text color (html code default Dark Pink #ff66cc)', defaultValue: '#ff66cc'},
  73.   {name:'noticebg', type:'str', label:'Notice Background Color (html code default Light Pink #ffccff)', defaultValue: '#ffccff'},
  74.   {name:'discount', type:'int', label:'Discount Percentage for Fan Club Members', defaultValue: '30'},
  75.   {name: 'cmdInterval', type:'int', minValue: 1, maxValue: 999, defaultValue: 1, label: 'Delay in minutes between notice being displayed (minimum 1)'},
  76.   {name:'enabledice', type:'choice', label:'ROLL THE DICE.............................................Enable', choice1:'Yes', choice2:'No', defaultValue:'Yes'},
  77.   {name: 'interval', type: 'int', label: 'delay in mins to send Dice Roll Prizes in chat', minValue:1, defaultValue:5},
  78.   {
  79.       name: 'tokens', type: 'int', minValue: 1,
  80.       label: 'How much do you want to charge per roll?',
  81.       defaultValue: 33
  82.   },
  83.   {
  84.       name: 'remove_winning_prize', type: 'choice', label: 'Remove prize from list after each roll?',
  85.       choice1: 'Yes', choice2: 'No', defaultValue: 'No'
  86.   },
  87.   {
  88.       name: 'die_type',
  89.       type: 'choice',
  90.       label: 'Use Traditional (6-sided) or Chinese (10-sided) dice? (NOTE: If you choose Chinese, please set all prizes. Otherwise, just set 2-13)',
  91.       choice1: 'Traditional',
  92.       choice2: 'Chinese',
  93.       defaultValue: 'Traditional'
  94.   },
  95.   {
  96.       name: 'multirolls', type: 'int', minValue: 1,
  97.       label: 'What is the maximum number of rolls you want a user to be able to make in a single tip? (set to 1 to disable) Example: If you set this to 3 and you charge 33 tokens per roll, a user could tip 66 for 2 rolls or 99 for 3 rolls. Any other tip amounts will be ignored.',
  98.       defaultValue: 3
  99.   },
  100.   {
  101.       name: 'minimum_rolls',
  102.       type: 'choice',
  103.       label: 'Minimum number of rolls before the rare dice can appear?',
  104.       choice1: 10,
  105.       choice2: 15,
  106.       choice3: 20,
  107.       choice4: 25,
  108.       choice5: 30,
  109.       choice6: 35,
  110.       choice7: 40,
  111.       choice8: 45,
  112.       choice9: 50,
  113.       defaultValue: 20
  114.   },
  115. {
  116.       name: 'rarechance', type: 'int', minValue: 1, maxValue: 100,
  117.       label: 'Percent chance for a rare die roll (7 for traditional dice, 11 for Chinese dice) to occur once minimum rolls has been reached. Default: 10%.',
  118.       defaultValue: 10
  119.   },
  120.   {
  121.       name: 'notice_wait_time',
  122.       type: 'choice',
  123.       label: 'In minutes, how often should the app advertise itself?',
  124.       choice1: 5,
  125.       choice2: 10,
  126.       choice3: 15,
  127.       choice4: 20,
  128.       choice5: 25,
  129.       choice6: 30,
  130.       choice7: 45,
  131.       choice8: 60,
  132.       defaultValue: 10
  133.   },
  134.   {
  135.       name: 'change_room_subject', type: 'choice', label: 'Change room subject when using this bot?',
  136.       choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'
  137.   },
  138.   {name: 'prize_2', type: 'str', label: 'Prize for rolling 2', defaultValue: 'dance'},
  139.   {name: 'prize_3', type: 'str', label: 'Prize for rolling 3', defaultValue: 'flash boobs'},
  140.   {name: 'prize_4', type: 'str', label: 'Prize for rolling 4', defaultValue: 'flash pussy'},
  141.   {name: 'prize_5', type: 'str', label: 'Prize for rolling 5', defaultValue: 'flash butt'},
  142.   {name: 'prize_6', type: 'str', label: 'Prize for rolling 6', defaultValue: 'flash (you choose what)'},
  143.   {name: 'prize_7', type: 'str', label: 'Prize for rolling 7', defaultValue: 'suck nipples'},
  144.   {name: 'prize_8', type: 'str', label: 'Prize for rolling 8', defaultValue: 'pussy close up'},
  145.   {name: 'prize_9', type: 'str', label: 'Prize for rolling 9', defaultValue: 'camel toe'},
  146.   {name: 'prize_10', type: 'str', label: 'Prize for rolling 10', defaultValue: 'spank butt'},
  147.   {name: 'prize_11', type: 'str', label: 'Prize for rolling 11', defaultValue: 'spank butt both hands'},
  148.   {name: 'prize_12', type: 'str', label: 'Prize for rolling 12', defaultValue: 'spank pussy'},
  149.   {name: 'prize_13', type: 'str', label: 'Prize for rolling 13 (RARE if using traditional dice)', defaultValue: 'finger pussy 10 mins'},
  150.   {name: 'prize_14', type: 'str', label: 'Prize for rolling 14 (only shown if using Chinese dice)', defaultValue: '.'},
  151.   {name: 'prize_15', type: 'str', label: 'Prize for rolling 15 (only shown if using Chinese dice)', defaultValue: '.'},
  152.   {name: 'prize_16', type: 'str', label: 'Prize for rolling 16 (only shown if using Chinese dice)', defaultValue: '.'},
  153.   {name: 'prize_17', type: 'str', label: 'Prize for rolling 17 (only shown if using Chinese dice)', defaultValue: '.'},
  154.   {name: 'prize_18', type: 'str', label: 'Prize for rolling 18 (only shown if using Chinese dice)', defaultValue: '.'},
  155.   {name: 'prize_19', type: 'str', label: 'Prize for rolling 19 (only shown if using Chinese dice)', defaultValue: '.'},
  156.   {name: 'prize_20', type: 'str', label: 'Prize for rolling 20 (only shown if using Chinese dice)', defaultValue: '.'},
  157.   {name: 'prize_21', type: 'str', label: 'Prize for rolling 21 (RARE if using Chinese dice)', defaultValue: '.'}
  158. ];
  159.  
  160. cb.onTip(function (tip) {
  161.  
  162.     tip_amt=parseInt(tip['amount']);
  163.     for (var i = 1; i <= MAXITEMS; i++) {
  164.       if(tip.from_user_in_fanclub) {
  165.         tipdiscount = discount(tipmenuprice[i], cb.settings.discount);
  166.         if (tip_amt == Math.round(tipdiscount)) {
  167.             cb.sendNotice(tip['from_user'] + ' tipped for ' + tipmenuitem[i],'',cb.settings.noticebg,cb.settings.noticecolor,'bold');
  168.         }
  169.       }else{
  170.         if (tip_amt == tipmenuprice[i]) {
  171.             cb.sendNotice(tip['from_user'] + ' tipped for ' + tipmenuitem[i],'',cb.settings.noticebg,cb.settings.noticecolor,'bold');
  172.         }
  173.       }
  174.     }
  175.  
  176.     if(cb.settings.enabledice == "Yes") {
  177.       var maxTip = multiRolls * price;
  178.       var tipAmount = parseInt(tip['amount']);
  179.  
  180.       // check to see if tip was for a dice roll
  181.       if (tipAmount >= price && (tipAmount <= maxTip) && (tipAmount % price === 0)) {
  182.           var numberOfRolls = Math.floor(tipAmount / price);
  183.           for (var i = 0; i < numberOfRolls; i++) {
  184.             if(tipmenuprice.indexOf(tipAmount) != -1) {}else{
  185.               roll(tip['from_user']);
  186.               lastRoller = tip['from_user'];
  187.             }
  188.           }
  189.       }
  190.       else {
  191.           // Tip was for something else, don't roll the dice
  192.           var textColor = '#000000';
  193.           var bgColor = '#D9FAD7';
  194.           //cb.sendNotice('Tip was not for dice roll.', '', bgColor, textColor, 'bold');
  195.           //tipCounter += parseInt(tip['amount']);
  196.           cb.drawPanel();
  197.       }
  198.     }
  199.  
  200. });
  201.  
  202. cb.onEnter(function(user) {
  203.   if(cb.settings.enabledice == "Yes") {
  204.     showAppAd(user['user']);
  205.   }
  206.   if(user.in_fanclub) {
  207.     cb.sendNotice(fanmenumsg, user.user, cb.settings.noticebg, cb.settings.noticecolor, 'bold');
  208.   }else{
  209.     cb.sendNotice(menumsg, user.user, cb.settings.noticebg, cb.settings.noticecolor, 'bold');
  210.   }
  211. });
  212.  
  213. cb.onMessage(function (msg) {
  214.     if (msg['has_tokens'] == true){
  215.       if(cb.settings.enabledice == "Yes") {
  216.         if (msg['m'].match(/!winners/i)) {
  217.             msg['X-Spam'] = true;
  218.             showPrizesWon(msg['user']);
  219.         } else if (msg['m'].match(/!prizes/i)) {
  220.             msg['X-Spam'] = true;
  221.  
  222.             if (msg['m'].match(/all/i) && ((msg['is_mod'] === true) || (msg['user'] == cb.room_slug))) {
  223.                 showPrizes();
  224.             } else {
  225.                 showPrizes(msg['user']);
  226.             }
  227.         }
  228.       }
  229.  
  230.       if(msg['user'] == cb.room_slug) {
  231.         if (msg['m'].match(/\/newfollows/i)) {
  232.           msg['X-Spam'] = true;
  233.           cb.sendNotice(f+" New Followers",msg['user'],'#000000','#FFFFFF','bold');
  234.         }
  235.       }
  236.  
  237.       if (msg['m'].match(/\/showmenu/i)) {
  238.         msg['X-Spam'] = true;
  239.         if(msg.in_fanclub) {
  240.           cb.sendNotice(fanmenumsg, msg.user, cb.settings.noticebg, cb.settings.noticecolor, 'bold');
  241.         }else{
  242.           cb.sendNotice(menumsg, msg.user, cb.settings.noticebg, cb.settings.noticecolor, 'bold');
  243.         }
  244.       }
  245.       return msg
  246.     }
  247.  
  248.     if (users.indexOf(msg['user']) != -1){
  249.       return msg
  250.     }
  251.  
  252.     if (msg['m'] == pass.toString()){
  253.       users.push(msg['user']);
  254.       msg['X-Spam'] = true;
  255.       msg['m']="Correct number, You may talk now.";
  256.       return msg
  257.     }
  258.  
  259.     setTimeout(function(){
  260.       cb.sendNotice(usernotice3,msg['user']);
  261.     }, 500);
  262.  
  263.     msg['m']="Please read the instructions and enter the correct number to talk.";
  264.     msg['X-Spam'] = true;
  265.  
  266.     return msg;
  267. });
  268.  
  269. cb.onFollow(user => {
  270.     f++;
  271.     if(preventSpam.includes(user['user']) == false) {
  272.         preventSpam.push(user['user']);
  273.     if(cb.settings['showicon'] == "Yes") {
  274.       switch(user['gender']) {
  275.         case"m":
  276.         gender = " :genderM";
  277.         break;
  278.  
  279.         case"s":
  280.         gender = " :genderS";
  281.         break;
  282.  
  283.         case"f":
  284.         gender = " :genderF";
  285.         break;
  286.  
  287.         case"c":
  288.         gender = " :genderC";
  289.         break;
  290.       }
  291.     }
  292.  
  293.         if(cb.settings['greyfollow'] == "Yes") {
  294.             if(user['has_tokens']) {
  295.                 if(user['tipped_recently']){
  296.                     if(user['tipped_alot_recently']) {
  297.                         if(user['tipped_tons_recently']) {
  298.                             // Purple
  299.                             cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#804baa', '#FFFFFF', 'bold');
  300.                         }else{
  301.                             // Pink
  302.                             cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#be6aff', '#FFFFFF', 'bold');
  303.                         }
  304.                     }else{
  305.                         // Dark Blue
  306.                         cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#000099', '#FFFFFF', 'bold');
  307.                     }
  308.                 }else{
  309.                     // Light Blue
  310.                     cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#6699aa', '#FFFFFF', 'bold');
  311.                 }
  312.             }else {
  313.                 // Grey
  314.                 cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#494949', '#FFFFFF', 'bold');
  315.             }
  316.         }else if(cb.settings['greyfollow'] == "No"){
  317.             if(user['has_tokens']) {
  318.                 if(user['tipped_recently']){
  319.                     if(user['tipped_alot_recently']) {
  320.                         if(user['tipped_tons_recently']) {
  321.                             // Purple
  322.                             cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#804baa', '#FFFFFF', 'bold');
  323.                         }else{
  324.                             // Pink
  325.                             cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#be6aff', '#FFFFFF', 'bold');
  326.                         }
  327.                     }else{
  328.                         // Dark Blue
  329.                         cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#000099', '#FFFFFF', 'bold');
  330.                     }
  331.                 }else{
  332.                     // Light Blue
  333.                     cb.chatNotice(user['user'] + ''+gender+' is now following me! Thank you', '', '#6699aa', '#FFFFFF', 'bold');
  334.                 }
  335.             }
  336.         }
  337.  
  338.     }
  339. });
  340.  
  341. function discount(price, discount) {
  342.   return price - (price * discount/100);
  343. }
  344.  
  345. function sendcommand() {
  346.     cb.sendNotice("/showmenu - Show the tipmenu\nFan Club Members have a "+cb.settings.discount+"% discount on the menu.\nDiscount Menu can only be seen by Fan Club Members", '', cb.settings.noticebg, cb.settings.noticecolor, 'bold');
  347.     cb.setTimeout(sendcommand, (cb.settings.cmdInterval * 60000));
  348. }
  349.  
  350. cb.setTimeout(sendcommand, (cb.settings.cmdInterval * 60000));
  351.  
  352.  
  353. if(cb.settings.enabledice == "Yes") {
  354.   function sendnotfication() {
  355.     showPrizes();
  356.     cb.setTimeout(sendnotfication, (cb.settings.interval * 60000));
  357.   }
  358.   cb.setTimeout(sendnotfication, (cb.settings.interval * 60000));
  359.  
  360.   function getRandomInt(min, max) {
  361.       min = Math.ceil(min);
  362.       max = Math.floor(max);
  363.       return Math.floor(Math.random() * (max - min + 1)) + min;
  364.   }
  365.  
  366.   function roll(username) {
  367.     var prize = 'A Thank You!';
  368.       rollCounter++;
  369.  
  370.       var die1 = getRandomInt(1, numberOfSides);
  371.       var die2 = getRandomInt(1, numberOfSides);
  372.  
  373.       // see if there's a chance we can roll a rare die
  374.       if (rollCounter > minimumRollsToGetRareDice) {
  375.           if (getRandomInt(0, 100) <= rareChance) {
  376.               if (Math.random() <= 0.5) die1 = numberOfSides + 1;
  377.             else die2 = numberOfSides + 1;
  378.           }
  379.       }
  380.       var total = die1 + die2;
  381.       var winner = false;
  382.  
  383.       if (total >= 1) {
  384.           winner = true;
  385.           prize = cb.settings['prize_' + total];
  386.       } else {
  387.           winner = false;
  388.       }
  389.  
  390.       var prizeIndex = (total == maxOutcome) ? prizes.indexOf(prize+' (RARE)') : prizes.indexOf(prize);
  391.  
  392.       if (prizeIndex >= 0) {
  393.           if (cb.settings.remove_winning_prize == 'Yes') prizes.splice(prizeIndex, 1);
  394.       } else {
  395.           prize = 'A Thank You!';
  396.       }
  397.     var strPrize = (total == maxOutcome) ? 'RARE PRIZE' : 'Prize';
  398.     var dieImage1 = dieImagePrefix + die1;
  399.     var dieImage2 = dieImagePrefix + die2;
  400.  
  401.     // 7th die image is missing from the :reddie_ emoticon set so use the the old :reddie set
  402.     if (cb.settings.die_type == 'Traditional') {
  403.         if (die1 == 7) dieImage1 = ":reddie7";
  404.         else if (die2 == 7) dieImage2 = ":reddie7";
  405.     }
  406.  
  407.       var msg = dieImage1 + " " + dieImage2 + "\n";
  408.       msg += username + " rolled " + total + "! \n";
  409.       msg += "Roll #" + rollCounter + " | " + strPrize + ": " + prize;
  410.  
  411.       var textColor = '#000000';
  412.       var bgColor = '#D9FAD7';
  413.  
  414.       if (winner) textColor = '#067D00';
  415.       if (total == maxOutcome) {
  416.           bgColor = '#FFDBF3';
  417.           textColor = '#A805A6';
  418.       }
  419.  
  420.       cb.sendNotice(msg, '', bgColor, textColor, 'bold');
  421.       lastPrizeWon = prize;
  422.     prize = (total == maxOutcome) ? "(RARE) " + prize : prize;
  423.       winners.push("Roll #" + rollCounter + " (" + total + "): " + username + " - " + prize);
  424.       cb.drawPanel();
  425.   }
  426.  
  427.   function setPrizes() {
  428.       var rareText = '';
  429.       for (var i = 2; i <= maxOutcome; i++) {
  430.           if (i == maxOutcome) rareText = "(RARE) ";
  431.           prizes.push(cb.settings['prize_' + i] + rareText);
  432.       }
  433.   }
  434.  
  435.   function showPrizes(username) {
  436.     var msg = "SORRY! There are no prizes left in the list, but thank you for the tip. :thumbsup";
  437.  
  438.       if (prizes.length) {
  439.           var rareText = '';
  440.           msg = "\n\u2666\u2666\u2666\u2666\u2666\u2666 ROLL THE DICE - POSSIBLE PRIZES \u2666\u2666\u2666\u2666\u2666\u2666\n\n";
  441.           for (var i = 2; i <= maxOutcome; i++) {
  442.               if (i == maxOutcome) rareText = "(RARE) ";
  443.               if (prizes.indexOf(cb.settings['prize_' + i] + rareText) >= 0)
  444.                   msg += "Roll " + i + " - " + rareText + cb.settings['prize_' + i] + "\n";
  445.           }
  446.       }
  447.  
  448.       cb.sendNotice(msg, username, '#222222', '#50e1f4', 'bold');
  449.   }
  450.  
  451.   function showPrizesWon(username) {
  452.       var msg = "\n\u2666\u2666\u2666\u2666\u2666\u2666 ROLL THE DICE - LAST 20 WINNERS \u2666\u2666\u2666\u2666\u2666\u2666\n\n";
  453.       msg += "List sorted in chronological order\n";
  454.       if (winners.length === 0) {
  455.           cb.sendNotice('No one has won anything yet. Roll the dice to win a prize!', username, '', '', 'bold');
  456.       } else {
  457.           var recentWinners = winners.slice(-20);
  458.           for (var i = 0; i < recentWinners.length; i++) msg += recentWinners[i] + "\n";
  459.  
  460.           cb.sendNotice(msg, username, '#FFF0DE', '#8A4900', 'bold');
  461.       }
  462.   }
  463.  
  464.   function advertise() {
  465.       showAppAd();
  466.       cb.setTimeout(advertise, parseInt(cb.settings.notice_wait_time) * 60000);
  467.   }
  468.  
  469.   function showAppAd(username) {
  470.       var msg = "********************************************\n";
  471.       msg += "We are playing Roll the Dice: Improved v1.1.0\n";
  472.       msg += "by kingchris_ (with contributions from: aety, zingknaat, milo_bloom, tablesalt90)\n";
  473.     msg += "********************************************\n";
  474.       msg += "\u2666 There are " + prizes.length + " possible prizes. ";
  475.  
  476.       if (cb.settings.remove_winning_prize == 'Yes') {
  477.           msg += "Each prize won will be removed from the list.\n";
  478.       } else {
  479.           msg += "Each prize won will stay on the list.\n";
  480.       }
  481.  
  482.       msg += "\n\u2666 Tip " + price + " " + langTokens + " to roll the dice. \n";
  483.       if (multiRolls > 1) msg += "\u2666 You can roll a maximum of " + multiRolls + " times in a single tip (" + (multiRolls*price) + " tokens). \n\n";
  484.       msg += "\u2666 Type \"!prizes\" to see the list of prizes. \n";
  485.       msg += "\u2666 Type \"!prizes all\" to send the list to all viewers if you're a mod or the broadcaster.\n";
  486.       msg += "\u2666 Type \"!winners\" to see a list of the last 20 winners.\n";
  487.     msg += "********************************************";
  488.       cb.sendNotice(msg, username, '#fff799', '#107888', 'bold');
  489.   }
  490. }
  491.  
  492. function init() {
  493.   if(cb.settings.enabledice == "Yes") {
  494.     setPrizes();
  495.     advertise();
  496.   }
  497.  
  498.   menumsg = '~~\u2764\u2764\u2764 VERONICA_SPACE\'S TIP MENU: \u2764\u2764\u2764~~ \n';
  499.   fanmenumsg = '~~\u2764\u2764\u2764 VERONICA_SPACE\'S TIP MENU: \u2764\u2764\u2764~~ \n';
  500.  
  501.   for (i=1;i<=MAXITEMS;i++) {
  502.     var tmp;
  503.     tmp=cb.settings['item' + i];
  504.     if (tmp) {
  505.       var arr= tmp.split('--');
  506.       if (arr[1]===undefined) {
  507.         cb.sendNotice('Error-You need two dashes to separate the tip amount and menu item for item no '+ i,'',cb.settings.noticebg,cb.settings.noticecolor,'bold');
  508.       } else {
  509.         var amt=parseInt(arr[0]);
  510.         if (amt>0) {
  511.           tipmenuprice[i]=amt;
  512.           tipmenuitem[i]=arr[1];
  513.           if(cb.settings.alignmenu == "Vertically") {
  514.             fanmenumsg += '--- ' + Math.round(discount(amt, cb.settings.discount)) + ' - ' + arr[1] + '\n';
  515.             menumsg += '--- ' + amt + ' - ' + arr[1] + '\n';
  516.           }else{
  517.             fanmenumsg += '--- ' + Math.round(discount(amt, cb.settings.discount)) + ' - ' + arr[1] + ' :heart2';
  518.             menumsg += '--- ' + amt + ' - ' + arr[1] + ' :hearts2';
  519.           }
  520.         }
  521.       }
  522.     }
  523.   }
  524.  
  525.   menumsg = menumsg.slice(0, -1);
  526.  
  527.   cb.sendNotice('Veronica_space Bot has started. This bot has been Developed by user Tok124', '','#000000','#FFFFFF','bold');
  528.  
  529. }
  530.  
  531. init();
  532.  
RAW Paste Data Copied