Bots Home
|
Create an App
whie board
Author:
deejam33
Description
Source Code
Launch Bot
Current Users
Created by:
Deejam33
cb.settings_choices = [ {name: 'value1', type: 'str', label: 'Content for row 1'}, {name: 'speed1', type: 'int', label: 'Rotation speed for row 1 (seconds)', defaultValue:0}, {name: 'value2', type: 'str', label: 'Content for row 2', required: false}, {name: 'speed2', type: 'int', label: 'Rotation speed for row 2 (seconds)',defaultValue:0}, {name: 'value3', type: 'str', label: 'Content for row 3', required: false}, {name: 'speed3', type: 'int', label: 'Rotation speed for row 3 (seconds)',defaultValue:0}, {name: 'value4', type: 'str', label: 'Content for description', required: false}, {name: 'speed4', type: 'int', label: 'Rotation speed for description (seconds)',defaultValue:0}, {name: 'goal', type: 'int', label: 'Tip Goal', required: false} ]; shortcuts={'tip_goal': cb.settings.goal, 'tip_total': 0, 'tips_til_goal': cb.settings.goal, 'last_tip': 0, 'last_tipper': 0}; var area=[]; var split_token='||'; area[0]={}, area[1]={}, area[2]={}, area[3]={}; area[0]['array']=String(cb.settings.value1).split(split_token); area[1]['array']=String(cb.settings.value2).split(split_token); area[2]['array']=String(cb.settings.value3).split(split_token); area[3]['array']=String(cb.settings.value4).split(split_token); for (i in area) { area[i]['time_counter']=0; area[i]['array_counter']=0; area[i]['showing']=area[i]['array'][0] } area[0]['speed']=cb.settings.speed1; area[1]['speed']=cb.settings.speed2; area[2]['speed']=cb.settings.speed3; area[3]['speed']=cb.settings.speed4; cb.drawPanel(); cb.setTimeout(tick,1000); cb.onTip(function(tip) { shortcuts['last_tip']=tip['amount']; shortcuts['tip_total']+=tip['amount']; shortcuts['last_tipper']=tip['from_user']; shortcuts['tips_til_goal']=shortcuts['tip_goal']-shortcuts['tip_total']; cb.drawPanel(); }); cb.onDrawPanel(function(user) { return { 'template': '3_rows_11_21_31', 'row1_value': replaceShortcuts(area[0]['showing']), 'row2_value': replaceShortcuts(area[1]['showing']), 'row3_value': replaceShortcuts(area[2]['showing']) }; }); function tick() { cb.drawPanel(); for (i in area) { if (area[i]['time_counter']==area[i]['speed']) { if (area[i]['array_counter']==area[i]['array'].length-1) area[i]['array_counter']=0; else area[i]['array_counter']++; area[i]['time_counter']=0; area[i]['showing']=area[i]['array'][ area[i]['array_counter'] ]; } else area[i]['time_counter']++; } cb.setTimeout(tick,1000); } function replaceShortcuts(str) { for (shortcut in shortcuts) { index=str.indexOf('('+shortcut+')'); if (index>=0) str=str.substring(0,index)+shortcuts[shortcut]+str.substring(index+shortcut.length+2); } return str; }
© Copyright Chaturbate 2011- 2026. All Rights Reserved.