// ==UserScript==
// @name CosmosisT's TinyChat Script (CTS V1.6.60)
// @version 1.6.60
// @description Modified TinyChat - Best Scripts; prepare to be amazed.
// @author CosmosisT
// @url https://gist.github.com/CosmosisT
// @license Copyright (C) 2019-2020 CosmosisT
// @icon https://tinychat.com/webrtc/2.0.0-81/images/favicon.png
// @match https://tinychat.com/room/*
// @match https://tinychat.com/*
// @exclude https://tinychat.com/settings/*
// @exclude https://tinychat.com/subscription/*
// @exclude https://tinychat.com/promote/*
// @exclude https://tinychat.com/coins/*
// @exclude https://tinychat.com/gifts*
// @grant none
// @run-at document-start
// jshint esversion: 6
// @namespace https://greasyfork.org/users/395685
// ==/UserScript==
(function() {
"use strict";
//DEBUGGER
window.DebugClear = true; // TRUE = CLEARS || FALSE = SHOWS
window.CTSVersion = {Major: 1, Minor: 6, Patch: 60};
var MainElement, ChatLogElement, VideoListElement, SideMenuElement, TitleElement, UserListElement,ModerationListElement, ChatListElement, UserContextElement, MicrophoneElement,
FeaturedCSS, VideoCSS, SideMenuCSS, MainCSS, RoomCSS, TitleCSS, ContextMenuCSS,ModeratorCSS, UserListCSS, ChatListCSS, NotificationCSS, ChatboxCSS,
//CTS MAIN VARIABLES
CTS = {
Project: {Name: "CTS",Storage: "CTS_", isTouchScreen: false},
Chuck: {XHR: new XMLHttpRequest(),bot: false,activepm: undefined,chat: undefined}, Urb: {XHR: new XMLHttpRequest(),bot: false,activepm: undefined,chat: undefined}, Dad: {XHR: new XMLHttpRequest(),bot: false,activepm: undefined,chat: undefined}, Advice: {XHR: new XMLHttpRequest(),bot: false,activepm: undefined,chat: undefined},
//API_KEY FOR YOUTUBE CAN BE INSERTED BELOW (NO WHERE ELSE)
//TC KEY AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs
YouTube: {API_KEY: "AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs",XHR: new XMLHttpRequest(),Playing: false,MessageQueueList: [],NotPlayable: ["Private video", "Deleted video"],VideoID: undefined,Busy: false,DataReady: false,Clear: false,VideoReturn: false,SearchReturn: false,ListBuilt: true,PlayListCount: undefined,ShowQueue: false,CurrentTrack: {ID: undefined,duration: undefined,title: undefined,thumbnail: undefined}},
Me: [], Room: [],
ScriptInit: false,
MainBackground: undefined,
OGStyle: {HeightCounter: 3,WidthCounter: 1,SavedHeight: undefined,SavedWidth: undefined},NormalStyle: {ChatHide: false},FontSize: 20,ChatStyleCounter: 0,ChatHeight: 30,ChatWidth: 0,ChatDisplay: true,UserListDisplay: true,ChatStyles: undefined,MainBackgroundCounter: 0,
ChatLimit: 650,NotificationLimit: 100,
ChatScroll: true,NotificationScroll: true,NoGreet: false,Featured: true,Bot: true,AutoKick: false,AutoBan: false,GreetMode: false,PerformanceMode: false,CanTTS: false,VoteSystem: false,Popups: true,Avatar: true,Reminder: true,CanSeeGames: true,CanHostGames: false,imgur: true,Notification: true,UserYT: true,ThemeChange: true,TimeStampToggle: true,AutoMicrophone: false,GreenRoomToggle: true,PublicCommandToggle: true,
Game: {NoReset: false,Fish: {HighScore: ["CosmosisT", 13337],StartTimeout: undefined,RestockTimeout: undefined,ReCastTimeout: undefined,NotEnoughTimeout: undefined,Round: 0,Player: [],TypesOfFish: [["frog", 1, true],["sunfish", 2, true],["goldfish", 3, true],["fish swollowed hook", 4, false],["family of sardine", 5, true],["catfish", 6, true],["spotted bass", 7, true],["largemouth bass", 8, true],["family of shrimp", 9, true],["it pays to not drink,\ncrazy night however!", 10, false],["cisco", 11, true],["seaweed, still edible", 12, true],["snagged a tire and lost rod", 13, false],["snagged a tire and lost hook", 14, false],["lost their rod to a shark", 15, false],["rainbow trout", 16, true],["It's your turn for dinner", 80, false],["parrot fish", 17, true],["snagged a plastic bag,\n their hook is gone", 18, false],["walleye", 19, true],["Round Whitefish", 20, true],["family of clams", 21, true],["family of oyster", 22, true],["Round blackfish", 23, true],["dolphin", 24, true],["seagull,\n not a fish but will do", 25, true],["pufferfish", 26, true],["fined for smuggling\nmore than fish", 27, false],["lobster", 28, true],["tuna", 29, true],["electric eel", 30, true],["Eel electricuted you,\nrod is toast", 31, false],["swordfish", 32, true],["had bills at home to pay", 33, false],["slipped and lost equipment", 34, false],["bike, still good too", 35, true],["great white", 36, true],["octopus", 37, true],["serpeant", 38, true],["sea turtle", 39, true],["cleaned garbage from the lake", 40, true],["fined for capturing,\n a female whale", 41, false],["male whale", 42, true],["barracuda", 43, true],["pike", 44, true],["lochiness monster", 45, true],["anglerfish", 46, true],["small treasure chest", 47, true],["golden tuna", 48, true],["family of beautiful rims", 49, true],["red snapper", 50, true],["jaws", 51, true],["mermaid", 52, true],["holy grail,\nhow'd that get there?", 75, true],["secret formula", 100, true]]}},
TTS: {synth: undefined,voices: undefined},
hasGreetedWC: false,
Host: 0,HostAttempt: 0,HostWaiting: false,
WaitToVoteList: [],UserList: [],MentionList: [],TempIgnoreList: [],IgnoreList: [],BanList: [],KickList: [],BotOPList: [],BotModList: [],TTSList: [],BanKeywordList: [],KickKeywordList: [],HighlightList: [],GreetList: [],ReminderList: [],ReminderServerInList: [],Favorited: [],SafeList: [],GreenRoomList: [],WatchList: [],KBQueue: [],
MessageCallback: [],
Message: [[]],LastMessage: new Date(),ShowedSettings: false,SendQueue: [],MissedMsg: 0,ActiveMessage: 0,
Camera: {List: [],Sweep: false,SweepTimer: 5,clearRandom: undefined},
NotificationTimeOut: [],
};
//API_KEY SAVE (PLEASE ENTER YOUR KEY ABOVE NOT HERE)
if (CTS.YouTube.API_KEY !== "") Save("YouTubeAPI", CTS.YouTube.API_KEY);
//CTS SETTINGS
CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
CTS.PublicCommandToggle = JSON.parse(Load("PublicCommandToggle", JSON.stringify(true)));
CTS.CameraBorderToggle = JSON.parse(Load("CameraBorderToggle", JSON.stringify(true)));
CTS.OGStyle.SavedHeight = JSON.parse(Load("OGStyleHeight", "3"));
CTS.OGStyle.SavedWidth = JSON.parse(Load("OGStyleWidth", "1"));
CTS.NotificationToggle = JSON.parse(Load("NotificationToggle", "0"));
CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", "0"));
CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
CTS.TimeStampToggle = JSON.parse(Load("TimeStampToggle", JSON.stringify(true)));
//API_KEY SAVE (PLEASE ENTER YOUR KEY ABOVE NOT HERE)
CTS.YouTube.API_KEY = Load("YouTubeAPI", "");
CTS.GreenRoomToggle = JSON.parse(Load("GreenRoomToggle", JSON.stringify(true)));
CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
CTS.GreenRoomList = JSON.parse(Load("GreenRoomList", JSON.stringify([])));
CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/RC3bKe7.jpg) rgb(0, 0, 0) no-repeat");
CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
CTS.CanHostGames = JSON.parse(Load("CanHostGames", JSON.stringify(false)));
CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
CTS.ThemeChange = JSON.parse(Load("ThemeChange", JSON.stringify(true)));
CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
CTS.Favorited = JSON.parse(Load("Favorited", JSON.stringify([["stonercircle", "https://avatars.tinychat.com/da/838b96/5f/medium/phpKXAdEn.jpeg"], null, null, null, null])));
CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
CTS.FontSize = JSON.parse(Load("FontSize", 20));
CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
CTS.Featured = JSON.parse(Load("Featured", JSON.stringify(false)));
CTS.KickList = JSON.parse(Load("KickList", JSON.stringify([])));
CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
CTS.BanList = JSON.parse(Load("BanList", JSON.stringify([])));
CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
CTS.imgur = JSON.parse(Load("imgur", JSON.stringify(true)));
CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
//IS USER TOUCHSCREEN
CheckUserTouchScreen();
if (CTS.ThemeChange) {
FeaturedCSS = "#videos.column>.videos-items{background:#0000003b;height:20%}#videos.column>.videos-items+.videos-items{background:none;height:80%}#videos.row>.videos-items{background:#0000003b;width:20%}#videos.row>.videos-items+.videos-items{background:none;width:80%}#videos.row.featured-2>.videos-items{width:20%}#videos.row.featured-2>.videos-items+.videos-items{width:80%}#videos.column.featured-2>.videos-items{height:20%}#videos.column.featured-2>.videos-items+.videos-items{height:80%}#videos.row.featured-3>.videos-items{width:20%}#videos.row.featured-3>.videos-items+.videos-items{width:80%}#videos.column.featured-3>.videos-items{height:20%}#videos.column.featured-3>.videos-items+.videos-items{height:80%}";
ChatListCSS = "#chatlist{background:#00000075;}.list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background:transparent;visibility:hidden;}.list-item>span>span{top:-4px;background:transparent;box-shadow:none;}.list-item>span>span[data-messages]:before{background:#53b6ef;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#chatlist>#header>.list-item>span.active{background:#53b6ef;}#chatlist>#header{height:60px;top:30px}#chatlist>div>span{font-weight: 600;border-radius:unset;color:#FFFFFF;height:22px;line-height:22px;}#chatlist>div{height:22px;line-height:22px;}";
ChatboxCSS = "#chat-download:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}#chat-download{position: absolute;right: 0;height: 22px;width: 22px;background: url(\"https://i.imgur.com/Bb3fr6Q.png\") center;background-size: 22px;}#chatlog-button{display:none!important;}@media screen and (max-width: 1200px){#chat-hide{top: -46px!important;left: -1px!important;width: 100%!important;border-radius: 0!important;}}#chat-hide{top: calc(50% - 18px);position: absolute;display: block;height: 16px;width: 16px;left: -8px;margin-top: -20px;border-radius: 16px;font-size: 0;background:url(https://i.imgur.com/jFSLyDD.png) #000000 center no-repeat;background-size:16px;cursor: pointer;z-index: 1;-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;}#chat-instant.show{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(25, 29, 32)100%)!important;}#chat-wider:before{transition:.3s;margin: -4px 0 0 -4px;border-width: 6px 6px 6px 0;border-color: transparent #ffffff!important;}#chat-wider{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;z-index: 2;background:#000000!important}#chat-wrapper{transition:none;}#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #10131494;}#input-user:checked ~ #user-menu{display:inline-block;}#user-menu > a:hover #user-menu > span > a:hover{color: #FFFFFF}#user-menu > a, #user-menu > span > a {font-weight: 600;position: relative;display: inline-block;width:calc(100% - 30px);padding: 6px;box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;}#user-menu {position: absolute;display: none;bottom: 50px;right: 0;border: 1px solid rgba(0, 0, 0, .06);box-sizing: border-box;border-radius: 3px;color: #FFFFFF;background: #101314;line-height: 1;box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .09);z-index: 1;}#user-menu > span {display: inline-block;width: 100%;padding: 12px;box-sizing: border-box;font-size: 16px;font-weight: 500;white-space: nowrap;text-overflow: ellipsis;cursor: default;overflow: hidden;}#label-user > img {position: absolute;height: 100%;left: -8px;vertical-align: top;}#label-user{position: relative;display: inline-block;height: 48px;width: 48px;border-radius: 100%;overflow: hidden;cursor: pointer;}#header-user{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;position: absolute;top: 10px;right: 0;}#chat-wrapper.full-screen #chat-instant, #chatf-wrapper.full-screen #chat-instant>.avatar>.status-icon,#chat-wrapper.full-screen #chat-content>.message>.avatar>.status-icon {background:unset;}.cts-message-unread{display:block;border-radius:6px;padding:1px 6px 1px 6px;background:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font:bold 16px sans-serif;cursor:pointer}.ctstime{position:absolute;right:3px;top:3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;}#chat-instant>.avatar>div>img,#cts-chat-content>.message>.avatar>div>img{position:relative;height:100%;left:-7px}.message>#system_user{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgba(0, 0, 0, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.message{color:#FFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-family:sans-serif;font-weight:300;font-size:20px;white-space:pre-line;word-wrap:break-word}.message a, .message a:visited, .message a:hover, .message a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.message a:hover{text-decoration:underline;}#chat{will-change: transform;min-height:unset;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:3px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#e24c05;-webkit-box-shadow: inset 0 0 20px #000000;box-shadow: inset 0 0 20px 0 #000000;}#cts-chat-content>.message.common{min-height: 50px;padding:3px 3px 3px 50px;box-sizing:border-box;text-align:left}#chat-instant>.avatar,#cts-chat-content>.message>.avatar{position:absolute;height:40px;width:40px;top:3px;left:3px;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);pointer-events:none;}#chat-instant>.avatar>div,#cts-chat-content>.message>.avatar>div{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden}#notification-content .nickname{border-radius:6px;padding:1px 6px 1px 6px}.notification{padding:1px 0 1px 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black}.time{position:absolute;right:5px}.notifbtn:hover{background:linear-gradient(0deg,rgb(0, 135, 186)0%,rgba(0, 49, 64, 0.94)75%,rgba(0, 172, 255, 0.6)100%);}.notifbtn{cursor: pointer;border-radius: 0 0 12px 12px;outline: none;background:linear-gradient(0deg,rgba(0, 0, 0, 0)0%,rgba(37, 37, 37, 0.32)75%,rgba(255, 255, 255, 0.6)100%);border: none;color: white;width: 100%;}#notification-content.large{height:50%;}#notification-content{will-change: transform;top:0;position:relative;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height:20%;min-height:38px;font:bold 16px sans-serif;color:#FFF;overflow-y:scroll;overflow-wrap:break-word;padding:0 6px 0 6px}#notification-content::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#chat-instant>.avatar>.status-icon,#cts-chat-content>.message>.avatar>.status-icon{left:0!important}#chat-instant>.nickname{color:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-size: 20px;font-weight: 800;} nm#chat-instant::after{background:none;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{border:1px solid black;border-radius:6px;padding:1px 6px 1px 6px;word-wrap:break-word;max-width:calc(100% - 115px);font-weight:600;font-size:16px;color:#FFF;display:inline-block;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#input{padding-top:0}:host,#input>.waiting{background:#20262870}#input:before,#input:after{content:unset}#input>textarea::placeholder{color:#FFF}#input>textarea::-webkit-input-placeholder{color:#fff}#input>textarea:-moz-placeholder{color:#fff}#input>textarea{width: calc(100% - 57px);line-height:unset;min-height:65px;max-height:65px;border-radius:6px;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font-size:" + (CTS.FontSize - 4) + "px;font-family:sans-serif;font-weight:300;}#chat-position{top:22px;left:6px;right:6px;bottom:5px;}.on-white-scroll::webkit-scrollbar{width:0;background:transparent;}";
MainCSS = "#mobile-app.show{display:none;}html{background:rgba(0,0,0,1);}#menu-icon{display:none;}body{background:" + CTS.MainBackground + ";background-position: center!important;background-size:cover!important;overflow:hidden;}#nav-static-wrapper {display:none;}#content{padding:0!important;}";
VideoCSS = "#videolist[data-mode=\"dark\"]{background-color:unset;}@media screen and (max-width: 1200px){#videos-footer{right: unset!important;bottom: -22px!important;top: unset!important;}}#videos-footer-broadcast-wrapper{margin-top:16px;}#youtube.video > div > .overlay, .video > div > .overlay{display:block!important}.tcsettings{display:none}#videos-header{background:#101314;}#videos-footer-broadcast-wrapper.active>#videos-footer-broadcast,#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button,#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button:focus{background-color:#2d373a!important;}.js-video.broken{display:none;}.videos-header-volume {border-color:#202627;}.tcsettings:hover{background:#008cda;}.tcsettings{cursor: pointer;outline: none;background:#101314;border: none;color: white;}.music-radio-info>.description{cursor:default;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.music-radio-info>.volume{bottom: 0;position: absolute;background: #2a6a89;height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.music-radio-info{top: -50px;position: absolute;background: #071c19f0;height: 50px;width: 336px;line-height: 24px;}.ctsdrop{position:fixed;display:inline-block;top:3px;left:4px;z-index:5;min-width: 46px;}.ctsdrop-content{position:absolute;top:28px;right:0;background:#101314;min-width:46px;width: 46px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #10131475;border: none;padding: 5% 0;display: inline-block;}#youtube{padding: unset}#grab{left: 0;background:#2d373a;border-radius: 12px;visibility: hidden;top: -36px;position: absolute;display: flex}#videos-footer #music-radio .music-radio-playpause{position:absolute;top:0;left:30px;height:100%;width:60px;}#videos-footer #music-radio .music-radio-vol{position: absolute;right: 0;top: 0;}#videos-footer #music-radio button{line-height: 14px;background: #101314;border: none;font-size: 18px;color: white;height: 50%;display: block;width: 30px;}#videos-footer #videos-footer-youtube{left: 120px;border-radius: 0;display:none;}#videos-footer #videos-footer-soundcloud{display:none;border-radius: 0;left: 240px}#videos-footer #videos-footer-youtube,#videos-footer #videos-footer-soundcloud,#videos-footer #music-radio{transition: .2s;line-height: 33px;bottom: -64px;visibility: hidden;height: 36px;margin: unset;width: 120px;position: absolute;z-index: 1;}#videos-footer-push-to-talk{border-radius: unset}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{border-radius: unset;}#videos-footer-broadcast-wrapper.moderation>#videos-footer-broadcast{padding: unset}#videos-footer #music-radio button:hover{background: #53b6ef;cursor: pointer;}#videos-footer #music-radio{left: 0;border-radius: 12px;background: #101314;}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer:hover{background:linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgb(83, 182, 239)100%);}#videos-footer{background: linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgba(200, 200, 200, 0.26)100%);cursor:pointer;top:0;display:block;padding: 2px 0 0 11px;text-shadow: -1px 0 black,0 1px black,1px 0 black,0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;left: unset;right: -70px;height: 22px;min-height: 22px;z-index: 2;width: 70px;position: absolute}#videos-footer-broadcast{border-radius:unset;z-index: 1;padding: unset!important;white-space: pre}span[title=\"Settings\"]>svg{padding:4px;height:24px;width:24px}#seek-duration{pointer-events: none;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 600 20px sans-serif}#videos{bottom: 0;left: 0;right: 0;top: 0}:host,#videolist{background:unset!important;}.video:after{content: unset;border:unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header>span{display:block;}#videos-header-sound>svg{padding: 4px}#videos-header-fullscreen > svg {padding: 7px 8px;}";
RoomCSS = "tc-title{display:flex!important;}#room-content{padding-top:0!important;background:unset!important;}";
TitleCSS = "#room-header-avatar{display:none}#room-header-gifts{display:none}#room-header-info-text{display:none}#room-header-info-details{display:none}#room-header-mobile-button{display:none}#room-header{display:none;}";
SideMenuCSS = "#sidemenu{left:0;}@media screen and (max-width: 1000px){#sidemenu{left:-270px;}}#sidemenu.full-screen{left:-270px;}#user-info{display:none;}#top-buttons-wrapper{display:none;}#sidemenu-content{scrollbar-width:none;padding-top:unset;}#sidemenu-wider:before{margin: -4px 0 0 -4px;border-width: 6px 6px 6px 0;border-color: transparent #ffffff;}#sidemenu-wider{-webkit-box-shadow: 0 0 6px #53b6ef;box-shadow: 0 0 6px #53b6ef;z-index: 2;display:block;background-color: #000000;}#sidemenu-content::-webkit-scrollbar{display: none;}#sidemenu.wider {left: -270px;}";
NotificationCSS = "#videos-header > span {background-color: unset!important;line-height: unset;}.PMTime{display:inline-block;padding:0 6px 0 0;margin:0 8px 0 0;border-right:4px groove #797979;}.PMName{display:inline-block;}#popup div{word-break:break-word;user-select: text;-webkit-user-select: text;-moz-user-select: text;color:#FFFFFF;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font-weight: 300;font-size: 18px;font-family: sans-serif;z-index:1;}.PMOverlay{height: calc(100% - 92px);overflow: hidden;pointer-events:none;position:absolute;padding-top:12px;top:0;bottom:0;left:0;right:0;visibility:visible;}.PMPopup{pointer-events:all;margin:5px auto;width:50%;position:relative;color: #FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}.PMPopup a, .PMPopup a:visited, .PMPopup a:hover, .PMPopup a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.PMPopup a:hover{color:#FFFFFF;text-decoration:underline;}.PMPopup h2{border-radius:5px 5px 0 0;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0 0 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
UserListCSS = ".list-item>span>span{padding: 0 8px;top:-2px}.list-item > span:hover > span{background-color:unset;box-shadow:unset;}#userlist{background: #00000075;}.js-user-list-item{background: linear-gradient(0deg,rgb(0, 0, 0) 2px,rgba(0, 0, 0, 0.25) 2px,rgba(0, 0, 0, 0.59) 32%);}.list-item>span>span[data-cam=\"1\"]:after{height:15px;width:15px;background-image:url(https://i.imgur.com/QKSbq8d.png);}.list-item>span>span[data-moderator=\"1\"]:before{margin-right:3px;width:15px;height:15px;background-image:url(https://i.imgur.com/CEA9aro.png);}.list-item>span>span{background:transparent;box-shadow:none;}.list-item>span>span>.send-gift{top:5px;}.list-item>span>img{top:6px;}#button-banlist{border-radius:unset;top:-1px;right:10px;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#userlist>div{height:22px;}#userlist>div>span{font-weight: 600;color:#FFFFFF;height:22px;line-height:22px;}#userlist>#header{height:40px;top:10px;}";
ModeratorCSS = ".video{min-width: 114px;max-width: 114px;}#moderatorlist:after{right:5px;color:#FFFFFF;background:#53b6ef;}#moderatorlist>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist>#header>span>button{top:-2px;background: #20262870;}#moderatorlist.show>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist{max-height:60px;background: #00000075;}#moderatorlist>#header{height:60px;font-size:16px;font-weight:600;font-family:sans-serif;color:#FFFFFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}#moderatorlist.show[data-videos-count=\"1\"], #moderatorlist.show[data-videos-count=\"2\"] {max-height:205px;}#moderatorlist.show[data-videos-count=\"3\"], #moderatorlist.show[data-videos-count=\"4\"] {max-height:290px;}#moderatorlist.show[data-videos-count=\"5\"], #moderatorlist.show[data-videos-count=\"6\"] {max-height:400px;}#moderatorlist.show[data-videos-count=\"7\"], #moderatorlist.show[data-videos-count=\"8\"] {max-height:460px;}#moderatorlist.show[data-videos-count=\"9\"], #moderatorlist.show[data-videos-count=\"10\"] {max-height:545px;}#moderatorlist.show[data-videos-count=\"11\"], #moderatorlist.show[data-videos-count=\"12\"] {max-height:630px;}";
} else {
//OG CTS
FeaturedCSS = "#videos.column>.videos-items{background:#0000003b;height:20%}#videos.column>.videos-items+.videos-items{background:none;height:80%}#videos.row>.videos-items{background:#0000003b;width:20%}#videos.row>.videos-items+.videos-items{background:none;width:80%}#videos.row.featured-2>.videos-items{width:20%}#videos.row.featured-2>.videos-items+.videos-items{width:80%}#videos.column.featured-2>.videos-items{height:20%}#videos.column.featured-2>.videos-items+.videos-items{height:80%}#videos.row.featured-3>.videos-items{width:20%}#videos.row.featured-3>.videos-items+.videos-items{width:80%}#videos.column.featured-3>.videos-items{height:20%}#videos.column.featured-3>.videos-items+.videos-items{height:80%}";
VideoCSS = "#videolist[data-mode=\"dark\"]{background-color:unset;}#youtube.video > div > .overlay, .video > div > .overlay{display:block!important}.js-video.broken{display:none;}#videos-footer-broadcast-wrapper.show-ptt > #videos-footer-submenu{right:0;}#videos-footer-submenu{width: calc(100% - 14px);right:0;bottom:-2px;}.videos-header-volume {border-color:#202627;}.tcsettings:hover{background:#008cda;}.tcsettings{cursor: pointer;outline: none;background:#101314;border: none;color: white;}.music-radio-info>.description{cursor:default;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}.music-radio-info>.volume{bottom: 0;position: absolute;background: #2a6a89;height: 6px;width: 100%;line-height: 24px;overflow-wrap: break-word;white-space: nowrap;overflow: hidden;text-overflow: ellipsis}.music-radio-info{top: -50px;position: absolute;background: #071c19f0;height: 50px;width: 336px;line-height: 24px;}.ctsdrop{position:fixed;display:inline-block;top:3px;right:4px;z-index:5;min-width: 46px;}.ctsdrop-content{position:absolute;top:28px;right:0;background:#101314;min-width:46px;width: 46px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #101314;border: none;padding: 5% 0;display: inline-block;}#youtube{padding: unset}#grab{left: 0;background:#2d373a;border-radius: 12px;visibility: hidden;top: -36px;position: absolute;display: flex}#videos-footer-broadcast-wrapper>.video{position: fixed;display: none;width: 5%;top: 0;left: 0}#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button:hover{background: #1f2223!important}#videos-footer-broadcast-wrapper.active>#videos-footer-submenu-button{background: #2d373a!important}#videos-footer #music-radio .music-radio-playpause{position:absolute;top:0;left:30px;height:100%;width:60px;}#videos-footer #music-radio .music-radio-vol{position: absolute;right: 0;top: 0;}#videos-footer #music-radio button{line-height: 14px;background: #101314;border: none;font-size: 18px;color: white;height: 50%;display: block;width: 30px;}#videos-footer #videos-footer-youtube{left: 120px;border-radius: 0;display:none;}#videos-footer #videos-footer-soundcloud{display:none;border-radius: 0;left: 240px}#videos-footer #videos-footer-youtube,#videos-footer #videos-footer-soundcloud,#videos-footer #music-radio{transition: .2s;line-height: 33px;bottom: 21px;visibility: hidden;height: 36px;margin: unset;width: 120px;position: absolute;z-index: 1;}#videos-footer-push-to-talk{border-radius: unset}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{border-radius: unset;}#videos-footer-broadcast-wrapper.moderation>#videos-footer-broadcast{padding: unset}#videos-footer #music-radio button:hover{background: #53b6ef;cursor: pointer;}#videos-footer #music-radio{left: 0;border-radius: 12px;background: #101314;}#videos-footer:hover #videos-footer-youtube,#videos-footer:hover #videos-footer-soundcloud,#videos-footer:hover #music-radio{visibility: visible}#videos-footer:hover{background:linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgb(83, 182, 239)100%);}#videos-footer{background: linear-gradient(0deg,rgba(255, 255, 255, 0)0%,rgba(24, 60, 62, 0.29)50%,rgba(200, 200, 200, 0.26)100%);cursor:pointer;top: calc(30% + 119px);display:block;padding: 2px 0 0 11px;text-shadow: -1px 0 black,0 1px black,1px 0 black,0 -1px black;font: 800 14px sans-serif;color: #FFFFFF;left: unset;right: -70px;height: 22px;min-height: 22px;z-index: 2;width: 70px;position: absolute}#videos-footer-broadcast{border-radius:unset;z-index: 1;padding: unset!important;white-space: pre}#videos-footer-broadcast-wrapper{z-index: 0;visibility: visible;height: 50px;min-height: 50px;width: 400px;padding: unset;right: 0;left: unset;position: fixed;top: calc(30% + 34px)}span[title=\"Settings\"]>svg{padding:4px;height:24px;width:24px}#seek-duration{pointer-events: none;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font: 600 20px sans-serif}#videos{bottom: 0;left: 0;right: 0;top: 0}:host,#videolist{background:unset!important;}.video:after{content: unset;border:unset;}#videos-header-mic>svg{padding: 2px 10px;}#videos-header{z-index: 3;background:#101314;transition: none;left: unset;right: 0;width: 400px;top: calc(30%);position: fixed;max-height: 34px;min-height: 34px;}#videos-header>span{display:block;line-height: unset;}#videos-header-sound>svg{padding: 4px}#videos-header-fullscreen > svg {padding: 7px 8px;}";
SideMenuCSS = "#close-users{display:none!important;}#user-info{display:none;}#top-buttons-wrapper{display:none;}@media screen and (max-width: 600px) {#sidemenu {top:unset;z-index:2;padding-bottom:0;margin-top:0;}}#sidemenu-wider{display:none;}#sidemenu-content::-webkit-scrollbar{width:0;background:transparent;}#sidemenu{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:300 20px sans-serif;left:unset!important;right:0!important;padding-bottom:0;height:30%!important;min-width:400px;max-width:400px;}#sidemenu-content{scrollbar-width:none;padding-top:unset;}";
MainCSS = "#mobile-app.show{display:none;}html{background:rgba(0,0,0,1);}#users-icon{display:none;}#menu-icon{display:none;}body{background:" + CTS.MainBackground + ";background-position: center!important;background-size:cover!important;overflow:hidden;}#content{width:calc(100% - 400px);padding:0!important;}#nav-static-wrapper, #nav-fixed-wrapper{display:none;}";
RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{padding-top:0!important;background:unset!important;}";
TitleCSS = "#room-header-avatar{display:none}#room-header-gifts{display:none}#room-header-info-text{display:none}#room-header-info-details{display:none}#room-header-mobile-button{display:none}#room-header{border:unset;z-index:1;min-height:36px!important;max-height:36px!important;min-width:400px;max-width:400px;top:calc(30% + 84px);right:0;position:fixed;background: linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(9, 41, 57)100%);}#room-header-info>h1{height:100%;top: unset;left: unset;right: unset;text-transform:uppercase;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:600 20px sans-serif;color:#FFFFFF;}#room-header-info>h1:after{content:unset;}#room-header-info {padding: 7px 0 0 6px!important;box-sizing: border-box;width: 100%!important;top: 0!important;left: 0!important;right: 0!important;}#room-he#room-header-info>span{right: 8px;position: absolute;top:7px;margin-top:0!important;}";
ContextMenuCSS = ".context.show{height:100%;}.context:after{content:unset;}.context>span{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:800 14px sans-serif;color:#FFFFFF;display:inline-block;padding:1px 1%;line-height:17px;height:17px;}.context{background:#101314;position:unset;padding:0;height:0;transition:.25s;}";
ModeratorCSS = ".video{min-width: 114px;max-width: 114px;}#moderatorlist:after{right:5px;color:#FFFFFF;background:#53b6ef;}#moderatorlist>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist>#header>span>button{top:-2px;background: #20262870;}#moderatorlist.show>#header>span>button>svg path{fill:#FFFFFF;}#moderatorlist{max-height:60px;}#moderatorlist>#header{height:60px;font-size:16px;font-weight:600;font-family:sans-serif;color:#FFFFFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}#moderatorlist.show[data-videos-count=\"1\"], #moderatorlist.show[data-videos-count=\"2\"] {max-height:205px;}#moderatorlist.show[data-videos-count=\"3\"], #moderatorlist.show[data-videos-count=\"4\"] {max-height:290px;}#moderatorlist.show[data-videos-count=\"5\"], #moderatorlist.show[data-videos-count=\"6\"] {max-height:400px;}#moderatorlist.show[data-videos-count=\"7\"], #moderatorlist.show[data-videos-count=\"8\"] {max-height:460px;}#moderatorlist.show[data-videos-count=\"9\"], #moderatorlist.show[data-videos-count=\"10\"] {max-height:545px;}#moderatorlist.show[data-videos-count=\"11\"], #moderatorlist.show[data-videos-count=\"12\"] {max-height:630px;}";
UserListCSS = "#userlist{padding-bottom:40px;}.list-item>span>span[data-cam=\"1\"]:after{height:15px;width:15px;background-image:url(https://i.imgur.com/QKSbq8d.png);}.list-item>span>span[data-moderator=\"1\"]:before{margin-right:3px;width:15px;height:15px;background-image:url(https://i.imgur.com/CEA9aro.png);}.list-item>span>span{background:transparent;box-shadow:none;}.list-item>span>span>.send-gift{top:4px;}.list-item>span>img{top:6px;}#button-banlist{color:#53b6ef;transition:none;top:calc(30% + 89px);right:3px;position:fixed;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#userlist>div{height:22px;}#userlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#userlist>#header{height:40px;top:10px;}#contextmenu {top:unset!important;bottom:0!important;right:0!important;left:0!important;}";
ChatListCSS = ".list-item>span>img{top:6px;}.list-item>span.active>span{transition:none;box-shadow:none;background:transparent;visibility:hidden;}.list-item>span>span{top:-4px;background:transparent;box-shadow:none;}.list-item>span>span[data-messages]:before{background:#53b6ef;}.list-item>span[data-status=\"gold\"]:before,.list-item>span[data-status=\"extreme\"]:before,.list-item>span[data-status=\"pro\"]:before{top:5px;}#chatlist>#header>.list-item>span.active{background:#53b6ef;}#chatlist>#header{height:60px;top:30px}#chatlist>div>span{color:#FFFFFF;font:bold 16px sans-serif;height:22px;line-height:22px;}#chatlist>div{height:22px;line-height:22px;}";
NotificationCSS = "#videos-header > span {background-color: unset!important;line-height: unset;}.PMTime{display:inline-block;padding:0 6px 0 0;margin:0 8px 0 0;border-right:4px groove #797979;}.PMName{display:inline-block;}#popup div{word-break:break-word;user-select: text;-webkit-user-select: text;-moz-user-select: text;color:#FFFFFF;text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font-weight: 300;font-size: 18px;font-family: sans-serif;z-index:1;}.PMOverlay{height: calc(100% - 92px);overflow: hidden;pointer-events:none;position:absolute;padding-top:12px;top:0;bottom:0;left:0;right:0;visibility:visible;}.PMPopup{pointer-events:all;margin:5px auto;width:50%;position:relative;color: #FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}.PMPopup a, .PMPopup a:visited, .PMPopup a:hover, .PMPopup a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.PMPopup a:hover{color:#FFFFFF;text-decoration:underline;}.PMPopup h2{border-radius:5px 5px 0 0;background:linear-gradient(0deg,rgb(24, 29, 30) 0%,rgb(24, 29, 30) 52%,rgb(60, 117, 148) 100%);margin:0;padding:5px;font-size:16px;}.PMPopup .PMContent {border-radius: 0 0 5px 5px;padding:5px;max-height:30%;overflow:hidden;word-break:break-all;background:#202628;}";
ChatboxCSS = "#chat-download:hover{cursor: pointer;-webkit-box-shadow: inset 0 0 20px #53b6ef;box-shadow: inset 0 0 20px 0 #53b6ef;}#chat-download{position: absolute;right: 0;height: 22px;width: 22px;background: url(\"https://i.imgur.com/Bb3fr6Q.png\") center;background-size: 22px;}#chatlog-button{display:none!important;}#chat-instant.show{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgb(25, 29, 32)100%)!important;}#chat-wider{display:none;}#fav-opt{display: inline-block;cursor: pointer;padding: 12px;background: #10131494;}#input-user:checked ~ #user-menu{display:inline-block;}#user-menu > a:hover #user-menu > span > a:hover{color: #FFFFFF}#user-menu > a, #user-menu > span > a {font-weight: 600;position: relative;display: inline-block;width:calc(100% - 30px);padding: 6px;box-sizing: border-box;font-size: 18px;color: #53b6ef;cursor: pointer;transition: .2s;}#user-menu {position: absolute;display: none;bottom: 50px;right: 0;border: 1px solid rgba(0, 0, 0, .06);box-sizing: border-box;border-radius: 3px;color: #FFFFFF;background: #101314;line-height: 1;box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .09);z-index: 1;}#user-menu > span {display: inline-block;width: 100%;padding: 12px;box-sizing: border-box;font-size: 16px;font-weight: 500;white-space: nowrap;text-overflow: ellipsis;cursor: default;overflow: hidden;}#label-user > img {position: absolute;height: 100%;left: -8px;vertical-align: top;}#label-user{position: relative;display: inline-block;height: 48px;width: 48px;border-radius: 100%;overflow: hidden;cursor: pointer;}#header-user{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;position: absolute;top: 10px;right: 0;}#chat-wrapper.full-screen #chat-instant, #chatf-wrapper.full-screen #chat-instant>.avatar>.status-icon,#chat-wrapper.full-screen #chat-content>.message>.avatar>.status-icon {background:unset;}.cts-message-unread{display:block;border-radius:6px;padding:1px 6px 1px 6px;background:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font:bold 16px sans-serif;cursor:pointer}.ctstime{position:absolute;right:3px;top:3px;background: #101314;border: 1px solid black;border-radius: 6px;padding: 1px 6px;}#chat-instant>.avatar>div>img,#cts-chat-content>.message>.avatar>div>img{position:relative;height:100%;left:-7px}.message>#system_user{background:linear-gradient(0deg,rgb(0, 19, 29)0%,rgba(0, 0, 0, 0.85)50%,rgba(0, 0, 0, 0.72)100%);border: 1px solid black;border-radius: 6px;padding: 1px 6px 1px 6px;word-wrap: break-word;font-weight: 600;font-size: 16px;color: #FFF;text-decoration: none;overflow: hidden;text-overflow: ellipsis;}.message{color:#FFF;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-family:sans-serif;font-weight:300;font-size:20px;white-space:pre-line;word-wrap:break-word}.message a, .message a:visited, .message a:hover, .message a:active{position:relative;transition:0.5s color ease;text-decoration:none;color:#53b6ef}.message a:hover{text-decoration:underline;}#chat{will-change: transform;min-height:unset;}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#cts-chat-content>.message{padding:3px 3px;background:#101314a8;position:relative;left:0;margin-bottom:3px;border-radius:6px}#cts-chat-content>.message.highlight,.message.common.highlight{background:#e24c05;-webkit-box-shadow:inset 0 0 20px #000000;box-shadow: inset 0 0 20px 0 #000000;}#cts-chat-content>.message.common{min-height: 50px;padding:3px 3px 3px 50px;box-sizing:border-box;text-align:left}#chat-instant>.avatar,#cts-chat-content>.message>.avatar{position:absolute;height:40px;width:40px;top:3px;left:3px;-webkit-transform:scale(1);-moz-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);pointer-events:none;}#chat-instant>.avatar>div,#cts-chat-content>.message>.avatar>div{position:absolute;height:100%;width:100%;top:0;left:0;border-radius:100%;overflow:hidden}#notification-content .nickname{border-radius:6px;padding:1px 6px 1px 6px}.notification{padding:1px 0 1px 0;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black}.time{position:absolute;right:5px}.notifbtn:hover{background:linear-gradient(0deg,rgb(0, 135, 186)0%,rgba(0, 49, 64, 0.94)75%,rgba(0, 172, 255, 0.6)100%);}.notifbtn{cursor: pointer;border-radius: 0 0 12px 12px;outline: none;background:linear-gradient(0deg,rgba(0, 0, 0, 0)0%,rgba(37, 37, 37, 0.32)75%,rgba(255, 255, 255, 0.6)100%);border: none;color: white;width: 100%;}#notification-content.large{height:50%;}#notification-content{will-change: transform;top:0;position:relative;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;height: 15%;min-height:38px;font:bold 16px sans-serif;color:#FFF;overflow-y:scroll;overflow-wrap:break-word;padding:0 6px 0 6px}#notification-content::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content{display:flex;flex-direction:column;justify-content:flex-end;min-height:100%}#chat-instant>.avatar>.status-icon,#cts-chat-content>.message>.avatar>.status-icon{left:0!important}#chat-instant>.nickname{color:#53b6ef;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;font-size: 20px;font-weight: 800;}#chat-instant::after{background:none;}.on-white-scroll{scrollbar-width: none;overflow-wrap: break-word;}.on-white-scroll::-webkit-scrollbar{width:0;background:transparent}#cts-chat-content>.message>.nickname{border:1px solid black;border-radius:6px;padding:1px 6px 1px 6px;word-wrap:break-word;max-width:calc(100% - 115px);font-weight:600;font-size:16px;color:#FFF;display:inline-block;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#input{padding-top:0}:host,#input>.waiting{background:#20262870}#input:before,#input:after{content:unset}#input>textarea::placeholder{color:#FFF}#input>textarea::-webkit-input-placeholder{color:#fff}#input>textarea:-moz-placeholder{color:#fff}#input>textarea{width: calc(100% - 57px);line-height:unset;min-height:65px;max-height:65px;border-radius:6px;scrollbar-width:none;background:#101314;text-shadow:-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color:#FFF;font-size:" + (CTS.FontSize - 4) + "px;font-family:sans-serif;font-weight:300;}#chat-wrapper{border:none;transition:none;bottom:0;right:0!important;max-height:calc(70% - 119px)!important;min-height:calc(70% - 119px)!important;position:fixed!important;min-width:400px;max-width:400px;}#chat-position{top:22px;left:6px;right:6px;bottom:5px;}.on-white-scroll::webkit-scrollbar{width:0;background:transparent;}";
}
//INITIATE
CTSInit();
function CTSInit() {
//INITIATE CTS
var err_out=0;
CTS.ScriptLoading = setInterval(function() {
err_out++;
if (document.querySelector("tinychat-webrtc-app")) {
if (document.querySelector("tinychat-webrtc-app").shadowRoot) CTSRoomInject();
debug("TINYCHAT::LOAD", "ROOM");
} else if (document.querySelector("#welcome-wrapper")) {
CTSHomeInject();
debug("TinyChat::LOAD", "HOME");
} else {
err_out++;
}
if (err_out == 50) {
clearInterval(CTS.ScriptLoading);
clearInterval(CTS.FullLoad);
}
}, 200);
//WEBSOCKET HOOK
if (!document.URL.match(/^https:\/\/tinychat.com(\/$|\/#)/i)) {
new MutationObserver(function() {
this.disconnect();
CTSWebSocket();
}).observe(document, {
subtree: true,
childList: true
});
}
//FULLY LOADED -> RUNALL
CTS.FullLoad = setInterval(function() {
if (CTS.ScriptInit === true && CTS.SocketConnected === true) {
clearInterval(CTS.FullLoad);
if (CTS.Me.mod) {
if (CTS.Bot) CheckHost();
if (CTS.Room.YT_ON) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
if (CTS.Room.YT_ON && CTS.Project.isTouchScreen) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").classList.toggle("hidden");
//VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
}
//PTT AUTO
if (CTS.Room.PTT === true) {
VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
if (e.which == 1) CTS.AutoMicrophone = false;
if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
}, {
passive: true
});
}
//FAVORITE ROOM
var favorited_rooms = "",
len = CTS.Favorited.length,
script = document.createElement("script"),
elem = document.getElementsByTagName("script")[0];
script.text = 'function AddFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'Favorited"));\n val[index]=["' + CTS.Room.Name + '","' + CTS.Room.Avatar + '"];\n localStorage.setItem("' + CTS.Project.Storage + 'Favorited", JSON.stringify(val));\n obj.href ="https://tinychat.com/room/' + CTS.Room.Name + '";\n obj.innerText = "' + CTS.Room.Name + '";\n obj.onclick = null;\n return false;\n}';
elem.parentNode.insertBefore(script, elem);
for (var i = 0; i < len; i++) favorited_rooms += CTS.Favorited[i] !== null ? "#" + (i + 1) + '<a href="https://tinychat.com/room/' + CTS.Favorited[i][0] + '">' + CTS.Favorited[i][0] + "</a>" : "#" + (i + 1) + '<a href="#" onclick="return AddFavorite(this,' + i + ');">ADD ROOM</a>';
ChatLogElement.querySelector("#input").insertAdjacentHTML("afterbegin", '<div id="header-user"><label id="label-user" for="input-user"><img class="switcher" src="' + (CTS.Me.avatar ? CTS.Me.avatar : "https://avatars.tinychat.com/standart/small/eyePink.png") + '"></label><input type="checkbox" id="input-user" hidden=""><div id="user-menu"><span id="nickname">FAVORITED ROOMS</span>' + favorited_rooms + '<span id="nickname">' + CTS.Me.username + '</span><a href="https://tinychat.com/settings/gifts"> My Gifts</a><a href="https://tinychat.com/settings/profile">Profile</a><a href="https://tinychat.com/room/' + CTS.Me.username + '">My Room</a><a href="https://tinychat.com/#">Directory</a></div></div>');
//RECENT GIFTS
var recent_gifts = "\n";
for (var g = 0; g < CTS.Room.Recent_Gifts.length; g++) recent_gifts += "<img src=\""+CTS.Room.Recent_Gifts[g]+"\" />";
//ALERT
Settings("<center><u>" + CTS.Room.Name.toUpperCase() + "</u>" + (CTS.Room.Avatar ? '\n<img src="' + CTS.Room.Avatar + '">' : "") + "\n" + CTS.Room.Bio + '\n<a href="' + CTS.Room.Website + '" target="_blank">' + CTS.Room.Website + "</a>"+((recent_gifts!="")?recent_gifts:"")+"\n\nROOM CONFIGURATION:\nYouTube Mode: " + ((CTS.Room.YT_ON) ? "ON" : "OFF") + "\n\n</center>");
CTS.ShowedSettings = true;
AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
//FEATURE LAUNCH
SoundMeter();
Reminder();
}
}, 500);
}
function CTSHomeInject() {
var HomeCSS = '@media screen and (max-width: 1000px){.nav-menu {background-color: #181e1f;}}.nav-sandwich-menu-button{background-color:unset;}#modalfree-wrapper{display: none;}.tile-header > img {transition:unset;}.tile-favroom-opt{cursor:pointer;position: absolute;right: 0;top: 0;padding: 1px;background:#10131494;}.tile-favroom-opt:hover{background:#ff00008c;}#content{padding-bottom:unset;}.tile-content{height:180px;}.cts-footer-contents .tile-info{height:20px}.cts-footer-contents .tile-header>img{cursor:pointer;height: 220px;}.tile-header>img{height: 230px;width: 100%;max-width: 100%;}.cts-footer:hover .cts-footer-contents .tile{font-size: 18px;font-weight: 800;width:20%;display:inline-block;}.cts-footer-contents .tile {background: #00a2ff;text-align: center;border:unset;height:unset;display:none;margin: unset;}.cts-footer {background:#10131494;width: 100%;position: fixed;bottom: 0;left: 0;}#catalog > div {display: inline-block;padding: 5px;box-sizing: border-box;}.tile[data-status="pro"], .tile[data-status="extreme"], .tile[data-status="gold"] {margin-top: 12px;}.tile-header {border-radius: 12px 12px 0 0;}#promoted .tile-header > img{width:100%;}#navigation > label{border-radius:12px;}#welcome>div{padding-top:0}.tile-statistic{padding-top:0;padding-bottom:4px;background: #000000a6;}.tile-name{padding-top:unset;}#promote-button{border-radius: 12px 12px 0 0;}tile-name{padding-top:unset;}.tile-info{bottom:unset;top:0;height:28px;}.cts-footer > h2, #promoted-wrapper > h2, #trended-wrapper > h2, #header-for-all{text-align: center;font-size: 30px;font-weight: 800;}body{background:' + CTS.MainBackground + ';background-size:cover;background-attachment: fixed;}.tile-content-info-icon > img {display:none;}.tile-content-info{font-size: 14px;font-weight: 600;}#promoted .tile-content-info-text{word-break: break-word;max-height:95px;}.tile{border:2px solid #fff;margin-top: 13px;height:425px;}#loadmore-no-more {background:#101314;}.tile-content > img{display:none;}#welcome-wrapper{background: #10131494;border-bottom:unset;}#loadmore{background: #00a2ff;font-weight: 600;}#user-menu{background: #101314;}#nav-static-wrapper {-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background:#101314;}#up-button:hover > #up-button-content {background: #10131459;}#nav-fixed{border-bottom:unset;}#nav-fixed-wrapper{-webkit-box-shadow: 0 0 20px 17px #53b6ef;box-shadow: 0 0 20px 17px #53b6ef;background: #101314;}#nav-static {border-bottom:unset;}#welcome{padding:12px 30px 24px;}.tile{border-radius: 12px;background: #101314b3;}div, span, a, h1, h2, h3, h4, h5, h6, p {text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;color: #FFFFFF!important;}#promoted-wrapper > div, #trended-wrapper > div {background: #00a2ff;border-radius: 12px;}.tile-content-info-text {word-break: break-word;width:100%;}.tile-content-info.with-icon {display: contents;}#navigation > label:not([for="input-catalog-navigation"]) {font-weight:600;background: #000000;}';
//INSERT HTML/CSS
document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
//INSERT SCRIPT
var script = document.createElement("script"),
elem = document.getElementsByTagName("script")[0];
script.text = 'function RemoveFavorite(obj, index) {\n var val = JSON.parse(localStorage.getItem("' + CTS.Project.Storage + 'Favorited"));\n val[index]=null;\n localStorage.setItem("' + CTS.Project.Storage + 'Favorited", JSON.stringify(val));\n return obj.parentNode.parentNode.remove();\n}';
elem.parentNode.insertBefore(script, elem);
var len = CTS.Favorited.length;
for (var i = 0; i < len; i++) document.body.querySelector(".cts-footer-contents").insertAdjacentHTML("beforeend", CTS.Favorited[i] !== null ? '<div class="tile" data-room-name="' + CTS.Favorited[i][0] + '">Favorite #' + (i + 1) + ' <div class="tile-header"><img id="tile-header-image" src="' + (CTS.Favorited[i][1] ? CTS.Favorited[i][1] : "https://i.imgur.com/VnVFEv7.png") + '" onclick="locationTo(\'/room/' + CTS.Favorited[i][0] + '\');"><div class="tile-info"><div class="tile-favroom-opt" onclick="RemoveFavorite(this,' + i + ')">X</div><div class="tile-name">' + CTS.Favorited[i][0] + '</div></div></div></div>' : '<div class="tile">Favorite #' + (i + 1) + "</div>");
//SCRIPT INIT -> PREPARE()
clearInterval(CTS.ScriptLoading);
CTS.ScriptInit = true;
CTSHomePrepare();
}
function CTSHomePrepare() {
//FUNCTION BYPASS
window.ModalFreeTrialPro = function() {};
//REMOVE
Remove(document, "#footer");
Remove(document, ".nav-logo");
}
function CTSRoomInject() {
// PUBLIC / ADDON GRABBERS
window.CTSImages = [
"https://i.imgur.com/8M0NPCv.png", "https://i.imgur.com/6IAL4aM.png", "https://i.imgur.com/QdOTqIR.jpg", "https://i.imgur.com/qqFsein.jpg", "https://i.imgur.com/vVD5pUb.jpg", "https://i.imgur.com/Sux2Age.jpg", "https://i.imgur.com/cIKznlf.jpg", "https://i.imgur.com/iEMP5I6.jpg", "https://i.imgur.com/rEGy1tK.jpg", "https://i.imgur.com/JR6Ped5.jpg", "https://i.imgur.com/m3dX7yn.jpg", "https://i.imgur.com/2cJqV1K.jpg", "https://i.imgur.com/QL1M4yG.jpg", "https://i.imgur.com/Syy1mUU.jpg", "https://i.imgur.com/sRpDOp3.jpg", "https://i.imgur.com/Im7dWdM.jpg", "https://i.imgur.com/9uCdYyq.png", "https://i.imgur.com/X9Kp6ka.jpg", "https://i.imgur.com/TOZTx1M.jpg", "https://i.imgur.com/wcjxVjk.png", "https://i.imgur.com/UZfmih9.png", "https://i.imgur.com/mkauZUT.jpg", "https://i.imgur.com/GfPqv7d.jpg", "https://i.imgur.com/R7AOtjV.jpg", "https://i.imgur.com/Qso6n8k.jpg", "https://i.imgur.com/vVfj23z.jpg", "https://i.imgur.com/BYPsShX.jpg", "https://i.imgur.com/1EWYBQw.jpg", "https://i.imgur.com/Oaq0eip.jpg", "https://i.imgur.com/HVHaJ1r.jpg", "https://i.imgur.com/SImcSc2.png", "https://i.imgur.com/CgRDCdy.jpg", "https://i.imgur.com/VMtXsES.png", "https://i.imgur.com/oxHz9un.jpg", "https://i.imgur.com/VN6x9QA.jpg", "https://i.imgur.com/9KhjWvW.jpg", "https://i.imgur.com/fu0eiv4.jpg", "https://i.imgur.com/QgcvxZf.jpg", "https://i.imgur.com/2kz8Roz.jpg", "https://i.imgur.com/A2AdQd8.jpg", "https://i.imgur.com/zuNUJ4J.jpg", "https://i.imgur.com/CW4mVWE.jpg", "https://i.imgur.com/0NGecGX.jpg", "https://i.imgur.com/4IEcVlr.jpg", "https://i.imgur.com/JDnQzF4.jpg", "https://i.imgur.com/Ye6iIrw.jpg", "https://i.imgur.com/DVlwQFN.jpg", "https://i.imgur.com/G6Oa9s6.jpg", "https://i.imgur.com/cXpEHvX.jpg", "https://i.imgur.com/ANXRz54.jpg", "https://i.imgur.com/i7KvpAf.jpg", "https://i.imgur.com/kJ44IQQ.jpg", "https://i.imgur.com/5ONal5c.jpg", "https://i.imgur.com/nWuC5FK.jpg", "https://i.imgur.com/ZYNsEN6.jpg", "https://i.imgur.com/C3aVnBq.jpg", "https://i.imgur.com/8Kts9t7.jpg", "https://i.imgur.com/QiaDx3C.jpg", "https://i.imgur.com/wrt6zBN.jpg", "https://i.imgur.com/3YgGoV0.jpg", "https://i.imgur.com/HPsbhiF.jpg", "https://i.imgur.com/X4wSs8f.jpg", "https://i.imgur.com/cqeMox0.jpg", "https://i.imgur.com/apNgmSO.jpg", "https://i.imgur.com/YjYcyCn.jpg", "https://i.imgur.com/2hUFTDv.png", "https://i.imgur.com/7lDQKff.jpg", "https://i.imgur.com/yuQTkOy.png", "https://i.imgur.com/7zvCOpV.jpg", "https://i.imgur.com/L5v6bcs.jpg", "https://i.imgur.com/5h3N2HY.jpg", "https://i.imgur.com/AvhrIcv.jpg", "https://i.imgur.com/DsAMAG1.jpg", "https://i.imgur.com/dDvOwXi.jpg", "https://i.imgur.com/ii00Lnl.jpg",
"https://i.imgur.com/vHDQY7N.jpg", "https://i.imgur.com/czfeyXQ.jpg", "https://i.imgur.com/pHEAee2.jpg", "https://i.imgur.com/txu4z7B.jpg", "https://i.imgur.com/NOapG69.jpg", "https://i.imgur.com/cxA4ist.jpg", "https://i.imgur.com/2keIszu.jpg", "https://i.imgur.com/q2Kpinf.jpg", "https://i.imgur.com/nDiFD2D.jpg", "https://i.imgur.com/Lvk0Lql.jpg", "https://i.imgur.com/QcRIeBr.jpg", "https://i.imgur.com/GlBONNB.jpg", "https://i.imgur.com/jVmJ9Iz.jpg", "https://i.imgur.com/9h2N288.png", "https://i.imgur.com/q0Rm3dS.jpg", "https://i.imgur.com/1tTKfKM.png", "https://i.imgur.com/nEwJBan.jpg", "https://i.imgur.com/NgE4lXY.jpg", "https://i.imgur.com/I4Pv5Zc.jpg", "https://i.imgur.com/QVDBSEm.jpg", "https://i.imgur.com/N9KfkgT.jpg", "https://i.imgur.com/mLIDP8a.jpg", "https://i.imgur.com/C8fAtMn.jpg", "https://i.imgur.com/e2Pubr3.jpg", "https://i.imgur.com/6drF4lG.jpg", "https://i.imgur.com/JcFhmPT.jpg", "https://i.imgur.com/wQQlX06.jpg", "https://i.imgur.com/qPTFnVp.jpg", "https://i.imgur.com/KWto7ab.jpg", "https://i.imgur.com/DHEdXnE.jpg", "https://i.imgur.com/49vqbrB.jpg", "https://i.imgur.com/TK4I9DI.jpg", "https://i.imgur.com/o5QNrcQ.jpg", "https://i.imgur.com/49adw4l.jpg", "https://i.imgur.com/vyYOZkE.jpg", "https://i.imgur.com/sBaXCoY.jpg", "https://i.imgur.com/dH0M8aN.png", "https://i.imgur.com/aqZ4VDh.jpg", "https://i.imgur.com/hMpMR84.jpg", "https://i.imgur.com/5zR2i8W.jpg", "https://i.imgur.com/oUPXbGf.jpg", "https://i.imgur.com/YW5tv1t.jpg", "https://i.imgur.com/JgKwHXs.jpg", "https://i.imgur.com/2k9JihV.jpg", "https://i.imgur.com/V5MUGj4.jpg", "https://i.imgur.com/3dUgoAf.jpg", "https://i.imgur.com/Q6aJgBM.jpg", "https://i.imgur.com/gRSmljE.jpg", "https://i.imgur.com/nkhsbE9.jpg", "https://i.imgur.com/I6LMqZq.jpg", "https://i.imgur.com/7OzdeRk.jpg", "https://i.imgur.com/wW94Pvc.jpg", "https://i.imgur.com/jQrTdv2.jpg", "https://i.imgur.com/UDgQ2Fh.jpg", "https://i.imgur.com/qjdMmPf.jpg", "https://i.imgur.com/yh7QoUN.jpg", "https://i.imgur.com/XchwuKo.jpg", "https://i.imgur.com/fdPaQbz.jpg", "https://i.imgur.com/zNfKy8I.jpg", "https://i.imgur.com/TaOf7dX.jpg", "https://i.imgur.com/bZxfyu8.jpg", "https://i.imgur.com/ccZRfsA.jpg", "https://i.imgur.com/wlbmT74.jpg", "https://i.imgur.com/29ffHeU.jpg", "https://i.imgur.com/30HbBAA.jpg", "https://i.imgur.com/4pO8b0B.jpg", "https://i.imgur.com/kD6BveQ.jpg", "https://i.imgur.com/LrCsiQj.jpg", "https://i.imgur.com/QN5NcXK.jpg", "https://i.imgur.com/MWW5cOv.jpg", "https://i.imgur.com/7LvskAH.jpg", "https://i.imgur.com/S7kLNct.jpg", "https://i.imgur.com/rL0olge.jpg", "https://i.imgur.com/0Apm59C.jpg", "https://i.imgur.com/ZMRBVvO.jpg",
"https://i.imgur.com/xFNZTwS.jpg", "https://i.imgur.com/iqq8ECW.jpg", "https://i.imgur.com/xEth2qp.jpg", "https://i.imgur.com/8ijIZMj.jpg", "https://i.imgur.com/zSB1DOw.jpg", "https://i.imgur.com/6TzjZSd.jpg", "https://i.imgur.com/Gf9yAwP.jpg", "https://i.imgur.com/u5ifVZy.jpg", "https://i.imgur.com/4ibO4FN.jpg", "https://i.imgur.com/bDCygo7.jpg", "https://i.imgur.com/lqktMar.jpg", "https://i.imgur.com/b2jAXiC.jpg", "https://i.imgur.com/oPE32ni.jpg", "https://i.imgur.com/YRjfPjP.jpg", "https://i.imgur.com/1FRwNEb.jpg", "https://i.imgur.com/dzgvlEx.jpg", "https://i.imgur.com/3FCAMiu.jpg", "https://i.imgur.com/wF5k6Ux.jpg", "https://i.imgur.com/mkuNYYa.jpg", "https://i.imgur.com/Y2Yu3yA.jpg", "https://i.imgur.com/Zchlast.jpg", "https://i.imgur.com/2FbH2jq.jpg", "https://i.imgur.com/Bb4iyy0.jpg", "https://i.imgur.com/7rjAtTt.jpg", "https://i.imgur.com/g1rNC8Z.jpg", "https://i.imgur.com/RC3bKe7.jpg", "https://i.imgur.com/qloc683.jpg", "https://i.imgur.com/irmzqz7.jpg", "https://i.imgur.com/pvmhbwL.jpg", "https://i.imgur.com/Xti1aEf.jpg", "https://i.imgur.com/FqFYows.jpg", "https://i.imgur.com/92zz2Zu.jpg", "https://i.imgur.com/jWrqBga.jpg", "https://i.imgur.com/OMSQsDe.jpg", "https://i.imgur.com/bvTtaLQ.jpg", "https://i.imgur.com/vxt6B7Y.jpg", "https://i.imgur.com/siw7Ipn.jpg", "https://i.imgur.com/paQsmXk.jpg", "https://i.imgur.com/VLHs9cT.png", "https://i.imgur.com/6VSxbJY.jpg", "https://i.imgur.com/C3Xn1WD.jpg", "https://i.imgur.com/d6BBFfS.jpg", "https://i.imgur.com/HyK1BFP.jpg", "https://i.imgur.com/2InicOt.jpg", "https://i.imgur.com/IVM4luE.jpg", "https://i.imgur.com/VLE0zNA.jpg", "https://i.imgur.com/rfgwqVI.jpg", "https://i.imgur.com/GsTMYfk.jpg", "https://i.imgur.com/yMEdYBN.jpg", "https://i.imgur.com/LvrO8oB.jpg", "https://i.imgur.com/1VBNkJP.jpg", "https://i.imgur.com/beuJiKd.jpg", "https://i.imgur.com/61h9Twq.jpg", "https://i.imgur.com/mnszrZ3.jpg", "https://i.imgur.com/He8K7kF.jpg", "https://i.imgur.com/id5BSLh.jpg", "https://i.imgur.com/huazhWL.jpg", "https://i.imgur.com/ttc4EYq.jpg", "https://i.imgur.com/HTO5tGy.jpg", "https://i.imgur.com/Pg1NrT1.jpg", "https://i.imgur.com/HEubZeG.jpg", "https://i.imgur.com/yk4XVVu.jpg", "https://i.imgur.com/Q6xqV8U.jpg", "https://i.imgur.com/ROTOMPV.jpg", "https://i.imgur.com/5DBP49J.jpg", "https://i.imgur.com/1pafkRu.jpg", "https://i.imgur.com/ZYJW79s.jpg", "https://i.imgur.com/5hJnezu.jpg", "https://i.imgur.com/LHRwsur.jpg", "https://i.imgur.com/858hMb9.jpg", "https://i.imgur.com/WOtpN81.jpg", "https://i.imgur.com/ITCxNl1.jpg", "https://i.imgur.com/OvXfe6w.jpg", "https://i.imgur.com/EVYKONX.jpg", "https://i.imgur.com/9nP4KwW.jpg",
"https://i.imgur.com/1SaESYp.jpg", "https://i.imgur.com/xBQlQKh.jpg", "https://i.imgur.com/yonFqV5.jpg", "https://i.imgur.com/go0xMSw.png", "https://i.imgur.com/jJhFpGw.jpg", "https://i.imgur.com/fcULcZq.jpg", "https://i.imgur.com/66l2lHM.jpg", "https://i.imgur.com/bujMfoQ.jpg", "https://i.imgur.com/JdbenHz.jpg", "https://i.imgur.com/merXbme.jpg", "https://i.imgur.com/ogrqxoQ.jpg", "https://i.imgur.com/fCstr3I.jpg", "https://i.imgur.com/t4d6ngW.jpg", "https://i.imgur.com/QzTlCSw.png", "https://i.imgur.com/CjrvvRI.jpg", "https://i.imgur.com/Du0abK6.jpg", "https://i.imgur.com/fZxRbtq.jpg", "https://i.imgur.com/zJB8VZc.jpg", "https://i.imgur.com/5lFG1Bf.jpg", "https://i.imgur.com/hvGzGNb.png", "https://i.imgur.com/UHZ8gC6.jpg", "https://i.imgur.com/ZIlJIIZ.png", "https://i.imgur.com/H7SjU1N.jpg", "https://i.imgur.com/yxxQsmf.jpg", "https://i.imgur.com/1TBkVzd.jpg", "https://i.imgur.com/3WffDw4.jpg", "https://i.imgur.com/XQU3W19.png", "https://i.imgur.com/2YxUgbQ.jpg", "https://i.imgur.com/8TVSB7D.jpg", "https://i.imgur.com/lNfEZwF.jpg", "https://i.imgur.com/2CgZewR.jpg", "https://i.imgur.com/ZJMFXGM.jpg", "https://i.imgur.com/9pZLYVF.jpg", "https://i.imgur.com/i9KaWdK.jpg", "https://i.imgur.com/X0hUxMg.jpg", "https://i.imgur.com/cWNLBLC.jpg", "https://i.imgur.com/oVQ1qmK.jpg", "https://i.imgur.com/MFa4WPr.jpg", "https://i.imgur.com/QalYWeA.png", "https://i.imgur.com/bLAlVzX.jpg", "https://i.imgur.com/OEXO2kT.jpg", "https://i.imgur.com/MnK5lmL.jpg", "https://i.imgur.com/dVMdMZh.jpg", "https://i.imgur.com/nNfOFvX.png", "https://i.imgur.com/yzoTLrK.jpg", "https://i.imgur.com/b1mTB58.jpg", "https://i.imgur.com/uWMQpMV.jpg", "https://i.imgur.com/TVGqTdH.jpg", "https://i.imgur.com/GFfZk0L.jpg", "https://i.imgur.com/aS5RCaX.jpg", "https://i.imgur.com/TTWYjDg.png", "https://i.imgur.com/OKUbuLl.jpg", "https://i.imgur.com/FyIJb7S.jpg", "https://i.imgur.com/KVTNHKB.jpg", "https://i.imgur.com/G9cpqNM.jpg", "https://i.imgur.com/cFf5e30.jpg", "https://i.imgur.com/1Nok0ho.jpg", "https://i.imgur.com/ozEWuPz.jpg", "https://i.imgur.com/QhHTLxc.jpg", "https://i.imgur.com/YYto1AX.jpg", "https://i.imgur.com/1THGvEA.jpg", "https://i.imgur.com/Rt3mp6H.jpg", "https://i.imgur.com/M2tiiNS.jpg", "https://i.imgur.com/lRtAxDM.jpg", "https://i.imgur.com/dlqkyFg.jpg", "https://i.imgur.com/lSLHeHM.png", "https://i.imgur.com/wKBOEof.png", "https://i.imgur.com/0aF2Si4.jpg", "https://i.imgur.com/bPDtdqH.jpg", "https://i.imgur.com/wZ08FwN.jpg", "https://i.imgur.com/gEtlvpr.jpg", "https://i.imgur.com/sTrwc9U.jpg", "https://i.imgur.com/nPEjErr.png", "https://i.imgur.com/bRaK26l.jpg", "https://i.imgur.com/vwJe85N.jpg",
"https://i.imgur.com/F8RFA5t.jpg", "https://i.imgur.com/M08DwfB.jpg", "https://i.imgur.com/gvF4hmM.jpg", "https://i.imgur.com/vINAgNJ.jpg", "https://i.imgur.com/ZzIHnk7.png", "https://i.imgur.com/IaYE1SA.png", "https://i.imgur.com/h3uA809.jpg", "https://i.imgur.com/uSxy1TH.jpg", "https://i.imgur.com/ihUpL67.jpg", "https://i.imgur.com/JA5pSwV.jpg", "https://i.imgur.com/S5PaNRb.jpg", "https://i.imgur.com/vPKxrIj.jpg", "https://i.imgur.com/Zb2vtPA.jpg", "https://i.imgur.com/uUkxBYp.jpg", "https://i.imgur.com/fpsAui6.jpg", "https://i.imgur.com/Ns5gM3Y.jpg", "https://i.imgur.com/qUFLtvX.jpg", "https://i.imgur.com/JsVmBaH.jpg", "https://i.imgur.com/DUFEeDG.jpg", "https://i.imgur.com/VkT9WNe.jpg", "https://i.imgur.com/7rHa1t1.jpg", "https://i.imgur.com/6rt4Xsc.jpg", "https://i.imgur.com/1woJRNz.jpg", "https://i.imgur.com/DZizgSe.jpg", "https://i.imgur.com/WcPkq2p.jpg", "https://i.imgur.com/FWgshWM.jpg", "https://i.imgur.com/ce28KTw.jpg", "https://i.imgur.com/Z1kgLE9.jpg", "https://i.imgur.com/qmTDbVf.jpg", "https://i.imgur.com/Glfmlwk.jpg", "https://i.imgur.com/1ZlA3eI.jpg", "https://i.imgur.com/FyY9zQB.jpg", "https://i.imgur.com/5vION1i.jpg", "https://i.imgur.com/GN8VSLo.jpg", "https://i.imgur.com/fMHj9aD.png", "https://i.imgur.com/AZKVqlm.jpg", "https://i.imgur.com/N6yrNAp.jpg", "https://i.imgur.com/mzfGu1K.jpg", "https://i.imgur.com/PbDAvp8.jpg", "https://i.imgur.com/PeKxWNd.png", "https://i.imgur.com/q6HucmK.jpg", "https://i.imgur.com/PcpoEr9.jpg", "https://i.imgur.com/m8MKD34.jpg", "https://i.imgur.com/rEfHYFj.png", "https://i.imgur.com/YOnQC7m.jpg", "https://i.imgur.com/IKZ1dnz.png", "https://i.imgur.com/7dKl6GR.jpg", "https://i.imgur.com/7QTdYyC.jpg", "https://i.imgur.com/VY6CRU9.jpg", "https://i.imgur.com/JbbTXGZ.jpg", "https://i.imgur.com/LiWognc.jpg", "https://i.imgur.com/lAlCmCS.jpg", "https://i.imgur.com/tuoVfDz.jpg", "https://i.imgur.com/jDtr7VV.jpg", "https://i.imgur.com/Fmq1w0x.jpg", "https://i.imgur.com/SW9tEby.jpg", "https://i.imgur.com/OIeGtF1.jpg", "https://i.imgur.com/y28VX6l.jpg", "https://i.imgur.com/SmN01pH.jpg", "https://i.imgur.com/pYIHV3V.jpg", "https://i.imgur.com/4mefbZJ.jpg", "https://i.imgur.com/CrnksCn.jpg", "https://i.imgur.com/DqdQHU5.jpg", "https://i.imgur.com/Kyp7Mrq.jpg", "https://i.imgur.com/5uUI0FK.jpg", "https://i.imgur.com/nYyKnjc.jpg", "https://i.imgur.com/8yngY9r.png", "https://i.imgur.com/LXTztRk.jpg", "https://i.imgur.com/YW9f04H.jpg", "https://i.imgur.com/VEOTdF4.jpg", "https://i.imgur.com/CNcnljn.jpg", "https://i.imgur.com/cVyPQRQ.jpg", "https://i.imgur.com/QVnisWP.jpg", "https://i.imgur.com/xkOmSt2.jpg", "https://i.imgur.com/OWqkrGA.jpg",
"https://i.imgur.com/407ypHE.jpg", "https://i.imgur.com/q7CBMPA.jpg", "https://i.imgur.com/jLgvLEB.jpg", "https://i.imgur.com/ZgRybJZ.jpg", "https://i.imgur.com/BCiqZoY.jpg", "https://i.imgur.com/C4FCE08.jpg", "https://i.imgur.com/mwQMddH.jpg", "https://i.imgur.com/c9Na9m7.jpg", "https://i.imgur.com/rvkOyhW.jpg", "https://i.imgur.com/fXikj5n.jpg", "https://i.imgur.com/B9nwfN2.jpg", "https://i.imgur.com/NitZTxZ.jpg", "https://i.imgur.com/4U7Wc6E.jpg", "https://i.imgur.com/wk2byhf.jpg", "https://i.imgur.com/kmeF9zK.jpg", "https://i.imgur.com/fpOurZh.jpg", "https://i.imgur.com/A6t86N6.jpg", "https://i.imgur.com/CnGthdb.jpg", "https://i.imgur.com/FgCA3uK.jpg", "https://i.imgur.com/sCYYhqf.jpg", "https://i.imgur.com/2NopGqw.jpg", "https://i.imgur.com/fzYZGdC.jpg", "https://i.imgur.com/nZufx8p.jpg", "https://i.imgur.com/IjMMreD.jpg", "https://i.imgur.com/HEpf4Eb.jpg", "https://i.imgur.com/jZeIfAc.jpg", "https://i.imgur.com/ZxaX4j0.jpg", "https://i.imgur.com/DXetwFt.jpg", "https://i.imgur.com/euIXHlP.jpg", "https://i.imgur.com/U4Mo2Hn.jpg", "https://i.imgur.com/w4pR6Hp.jpg", "https://i.imgur.com/79GciEk.jpg", "https://i.imgur.com/WpDbcAA.jpg", "https://i.imgur.com/YODAe6Z.jpg", "https://i.imgur.com/4It1NIe.jpg", "https://i.imgur.com/ALkfNHF.jpg", "https://i.imgur.com/xJOaHZP.jpg", "https://i.imgur.com/nFCIuJo.jpg", "https://i.imgur.com/oXgFh2K.jpg", "https://i.imgur.com/Vcs3jXT.jpg", "https://i.imgur.com/XGtJE58.jpg", "https://i.imgur.com/q4WalQY.jpg", "https://i.imgur.com/WFIyruV.jpg", "https://i.imgur.com/sItJMKv.jpg", "https://i.imgur.com/LAQ3Wpl.jpg", "https://i.imgur.com/C64XPAR.jpg", "https://i.imgur.com/hyehxek.jpg", "https://i.imgur.com/4XYBWKu.jpg", "https://i.imgur.com/KU1adf4.jpg", "https://i.imgur.com/L3sbodb.png", "https://i.imgur.com/JPMfbL9.jpg", "https://i.imgur.com/ieae2zo.jpg", "https://i.imgur.com/VVswQpo.jpg", "https://i.imgur.com/fWUr6ic.jpg", "https://i.imgur.com/juRIj2L.jpg", "https://i.imgur.com/2Mq8ZR8.jpg", "https://i.imgur.com/ibC5gSl.jpg", "https://i.imgur.com/63uHgyR.jpg", "https://i.imgur.com/xs3yEut.jpg", "https://i.imgur.com/0SYzA7u.jpg", "https://i.imgur.com/hRKhVTS.jpg", "https://i.imgur.com/IGv4V1p.jpg", "https://i.imgur.com/hmlxgXG.jpg", "https://i.imgur.com/q97Z7Nc.jpg", "https://i.imgur.com/1A6NPKj.jpg", "https://i.imgur.com/y97L14a.jpg", "https://i.imgur.com/DPohLPu.jpg", "https://i.imgur.com/JvXJ74s.jpg", "https://i.imgur.com/mA5b8Y1.jpg", "https://i.imgur.com/FVNerO1.jpg", "https://i.imgur.com/KNsh665.jpg", "https://i.imgur.com/Z9b0Gme.jpg", "https://i.imgur.com/z90LZmp.jpg", "https://i.imgur.com/tfXYXr7.png", "https://i.imgur.com/atHkjXl.jpg",
"https://i.imgur.com/u1l34Vi.jpg", "https://i.imgur.com/X0yROLr.jpg", "https://i.imgur.com/EpHkJZI.jpg", "https://i.imgur.com/TIKipWb.jpg", "https://i.imgur.com/Lq4qnDF.jpg", "https://i.imgur.com/N1KmzQo.jpg", "https://i.imgur.com/pAReFTB.jpg", "https://i.imgur.com/ZKMQwxk.jpg", "https://i.imgur.com/aSDE7i4.jpg", "https://i.imgur.com/kabITqS.jpg", "https://i.imgur.com/W7oaDNe.jpg", "https://i.imgur.com/VHYmth8.jpg",
];
window.CTSEightBall = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most Likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."];
window.CTSWelcomes = ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "];
window.CTSSound = {
C: new Audio("https://media.vocaroo.com/mp3/e3VIvvFqdHe"),
HIGHLIGHT: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
GREET: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
MENTION: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"),
MSG: new Audio("https://tinychat.com"+window.rootDir+"/sound/pop.mp3"),
GIFT: new Audio("https://tinychat.com"+window.rootDir+"/sound/magic.mp3"),
PVTMSG: new Audio("https://media.vocaroo.com/mp3/1eX3L752VdQ")
};
window.CTSRadioStations = [
["Flex 98.5FM", "https://edge1-b.exa.live365.net/a23768"],
["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],
["HOT899", "https://newcap.leanstream.co/CIHTFM"],
["chillstep.info", "https://chillstep.info/listen.ogg"],
["HOT997", "https://ice5.securenetsystems.net/KHHK"],
["Dance365", "https://edge1-b.exa.live365.net/a93720"],
["kexp.org", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3"],
["Classic Deep Cuts", "https://edge1-b.exa.live365.net/a72496"],
["Divas Hustle Radio", "https://edge1-b.exa.live365.net/a72972"],
["Retro 8089", "https://edge1-b.exa.live365.net/a53202"],
["Teerex Radio Teerex", "https://edge1-b.exa.live365.net/a74387"],
["NGI Radio", "https://edge1-b.exa.live365.net/a24650"],
["Legend Oldies", "https://edge1-b.exa.live365.net/a88135"],
["Music City Roadhouse", "https://edge1-b.exa.live365.net/a73754"],
["Mashrup Reggae Radio", "https://edge1-b.exa.live365.net/a00564"],
["97.5 Dance Hits", "https://edge1-b.exa.live365.net/a50365"]
];
window.CTSNameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
window.CTSChatCSS = [
[ //STYLE #0
["#chat-wrapper{background:linear-gradient(0deg,rgba(32,38,40,0.59)0%,rgba(16,14,14,0.76)calc(100% - 62px),rgba(45,55,58,0.72)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #1
["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(58, 58, 58)8px,rgb(30, 30, 30)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
],
[ //STYLE #2
["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(83, 17, 128)8px,rgb(68, 15, 103)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#7918bc;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#7918bc!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#460b6f!important;}#videos-footer-push-to-talk{background:#7918bc}#videos-footer-push-to-talk:hover{background:#460b6f}#videos-footer-broadcast:hover{background:#460b6f}#videos-footer-broadcast{background:#7918bc;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
],
[ //STYLE #3
["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(121, 3, 3)8px,rgb(176, 2, 2)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#c10101;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#c10101!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#6b0f0f!important;}#videos-footer-push-to-talk{background:#c10101}#videos-footer-push-to-talk:hover{background:#6b0f0f}#videos-footer-broadcast:hover{background:#6b0f0f}#videos-footer-broadcast{background:#c10101;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
],
[ //STYLE #4
["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(26, 59, 75)8px,rgb(59, 130, 170)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
],
[ //STYLE #5
["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
],
[ //STYLE #6
["#chat-wrapper{background:linear-gradient(0deg,rgba(0, 0, 0, 0.69)0%,rgba(0, 0, 0, 0.56)calc(100% - 62px),rgb(13, 179, 0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
],
[ //STYLE #7
["#chat-wrapper{background: linear-gradient(0deg,rgb(255, 255, 255)0%,rgba(255, 255, 255, 0.82)calc(100% - 62px),rgb(255, 255, 255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
],
[ //STYLE #8
["#chat-wrapper{background: linear-gradient(0deg,rgba(255, 255, 0, 1)0%,rgba(255, 255, 0, 0.82)calc(100% - 62px),rgba(255, 255, 0, 1)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(234, 236, 5)8px,rgb(180, 187, 15)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
],
[ //STYLE #9
["#chat-wrapper{background: linear-gradient(0deg,rgb(119, 45, 2) 0%,rgb(24, 29, 30) 52%,rgb(234, 129, 38) 100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(226, 92, 19)8px,rgb(158, 73, 16)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
],
[ //STYLE #10
["#chat-wrapper{background: linear-gradient(0deg,rgb(141, 36, 95)0%,rgba(191, 0, 255, 0.82)calc(100% - 62px),rgb(255, 0, 202)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(150, 0, 175)8px,rgb(176, 0, 226)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)100%);}"]
],
[ //STYLE #11
["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}"]
],
[ //STYLE #12
["#chat-wrapper{background: #fff!important;}.message>#system_user{color:#FFFFFF}#cts-chat-content>.message{background:#00000000}.message{color:#000000;text-shadow: unset;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: #2d373a;}"]
],
[ //STYLE #13
["#chat-wrapper{background: url(https://i.imgur.com/ek4TEsz.jpg)!important;}#cts-chat-content>.message{background:#17951a8c;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(37, 101, 27)8px,rgb(36, 98, 25)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: url(https://i.imgur.com/LCOulGB.png) repeat-x bottom;}"]
],
[ //STYLE #14
["#chat-wrapper{background:linear-gradient(0deg,rgba(32,38,40,0.59)0%,rgba(16,14,14,0.76)calc(100% - 62px),rgba(45,55,58,0.72)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #14
["#chat-wrapper{background:linear-gradient(0deg,rgb(255,255,255)0%,rgba(99,99,99)calc(100% - 62px),rgba(255,255,255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(58, 58, 58)8px,rgb(30, 30, 30)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #15
["#chat-wrapper{background:linear-gradient(0deg,rgb(121,24,188)0%,rgb(36,15,45)calc(100% - 62px),rgb(121,24,188)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(83, 17, 128)8px,rgb(68, 15, 103)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#7918bc;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#7918bc!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#460b6f!important;}#videos-footer-push-to-talk{background:#7918bc}#videos-footer-push-to-talk:hover{background:#460b6f}#videos-footer-broadcast:hover{background:#460b6f}#videos-footer-broadcast{background:#7918bc;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #16
["#chat-wrapper{background:linear-gradient(0deg,rgb(248,5,5)0%,rgb(81,22,22)calc(100% - 62px),rgba(204,0,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(121, 3, 3)8px,rgb(176, 2, 2)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#c10101;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#c10101!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#6b0f0f!important;}#videos-footer-push-to-talk{background:#c10101}#videos-footer-push-to-talk:hover{background:#6b0f0f}#videos-footer-broadcast:hover{background:#6b0f0f}#videos-footer-broadcast{background:#c10101;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #17
["#chat-wrapper{background:linear-gradient(0deg,rgb(65,144,219)0%,rgb(7,69,97)calc(100% - 62px),rgb(37,179,222)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(26, 59, 75)8px,rgb(59, 130, 170)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #18
["#chat-wrapper{background:linear-gradient(0deg,rgb(0,158,5)0%,rgb(5,15,5)calc(100% - 62px),rgb(13,181,0)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13, 96, 7)8px,rgb(8, 48, 6)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#0cae00;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#0cae00!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#054c00!important;}#videos-footer-push-to-talk{background:#0cae00}#videos-footer-push-to-talk:hover{background:#054c00}#videos-footer-broadcast:hover{background:#054c00}#videos-footer-broadcast{background:#0cae00;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #19
["#chat-wrapper{background: linear-gradient(0deg,rgb(255, 255, 255)0%,rgba(255, 255, 255, 0.82)calc(100% - 62px),rgb(255, 255, 255)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background:#2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #20
["#chat-wrapper{background: linear-gradient(0deg,rgba(255, 255, 0, 1)0%,rgba(255, 255, 0, 0.82)calc(100% - 62px),rgba(255, 255, 0, 1)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(234, 236, 5)8px,rgb(180, 187, 15)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #21
["#chat-wrapper{background: linear-gradient(0deg,rgb(119, 45, 2) 0%,rgb(24, 29, 30) 52%,rgb(234, 129, 38) 100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(226, 92, 19)8px,rgb(158, 73, 16)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #22
["#chat-wrapper{background: linear-gradient(0deg,rgb(141, 36, 95)0%,rgba(191, 0, 255, 0.82)calc(100% - 62px),rgb(255, 0, 202)100%)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(150, 0, 175)8px,rgb(176, 0, 226)100%);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
],
[ //STYLE #23
["#cts-chat-content>.message{background:#101314;}#chat-wrapper{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px)!important;}#cts-chat-content>.message{background:#101314a8;}.message{color:#FFF;text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;}"],
[".PMPopup .PMContent{background: #2d373ADB;}.PMPopup h2{background:repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}#videos-footer-broadcast-wrapper>.waiting{background:#53b6ef;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button{background:#53b6ef!important;}#videos-footer-broadcast-wrapper>#videos-footer-submenu-button:hover{background:#3d89b5!important;}#videos-footer-push-to-talk{background:#53b6ef}#videos-footer-push-to-talk:hover{background:#3d89b5}#videos-footer-broadcast:hover{background:#3d89b5}#videos-footer-broadcast{background:#53b6ef;}"],
["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
]
];
//INSERT SCRIPT
var script = document.createElement("script"),
elem = document.getElementsByTagName("script")[0];
script.text = 'var StationSelected = 0,\n StationPlay = false,\n StationVol = 1;\nfunction VolStation(elem, vol){\n var StationElem = elem.parentElement.nextSibling;\n var StationVolElem = elem.parentElement.querySelector(".music-radio-info>.volume");\nStationVol += vol;\n if (StationVol < 0){\n StationVol = 0;\n } else if (StationVol > 1) {\n StationVol = 1.0;\n }\n StationElem.volume = StationVol;\nStationVolElem.style.width=((StationVol * 100)+"%");}\nfunction PlayPauseStation(elem) {\n var StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n var StationElem=elem.parentElement.nextSibling;\nvar StationDescElem=elem.parentElement.querySelector(".music-radio-info>.description");\n StationPlay=!StationPlay;\n if (StationPlay) {\n StationElem.volume = StationVol;\n StationElem.play();\n StationPlayPauseBtn.innerText="❚❚"; StationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n} else {\n StationElem.pause();\nStationPlayPauseBtn.innerText="▶";\n StationDescElem.innerText = ("Paused: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);}\n}\nfunction SeekStation(elem, direction) {\n var StationElem = elem.parentElement.nextSibling;\n var StationDescElem = elem.parentElement.querySelector(".music-radio-info>.description");\nvar StationPlayPauseBtn = elem.parentElement.querySelector(".music-radio-playpause");\n StationPlay = true;\n StationSelected += direction;\n \n if (StationSelected > window.CTSRadioStations.length-1) {\n StationSelected = 0;\n } else if (StationSelected < 0){\n StationSelected = window.CTSRadioStations.length-1;\n }\n StationElem.pause();\n StationElem.setAttribute("src", window.CTSRadioStations[StationSelected][1]);\n StationElem.load();\n StationElem.volume = StationVol;\nStationPlayPauseBtn.innerText="❚❚";\n StationElem.play();\nStationDescElem.innerText = ("Playing: "+window.CTSRadioStations[StationSelected][0]+"\\nURL: "+window.CTSRadioStations[StationSelected][1]);\n}';
elem.parentNode.insertBefore(script, elem);
//LOCALSETTINGS
CTS.enablePMs = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enablePMs : true;
CTS.enableSound = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enableSound : true;
//TTS (TEXT-TO-SPEECH)
if (CTS.enableSound === true && "speechSynthesis" in window) {
CTS.TTS.synth = window.speechSynthesis;
CTS.TTS.voices = CTS.TTS.synth.getVoices();
}
//ELEMENT DEFINE
MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
MicrophoneElement = document.createEvent("MouseEvent");
SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
TitleElement = MainElement.querySelector("tc-title").shadowRoot;
UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
var insert = TitleElement.querySelector('span[title="Settings"]');
VideoListElement.querySelector("#videos-header").appendChild(insert);
//INSERTHTML/CSS
if (!CTS.Project.isTouchScreen) {
VideoListElement.querySelector("#videolist").appendChild(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"));
VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("beforeend", '<div id="music-radio"><div class="music-radio-info"><div class="description">Playing: None<br>URL: None</div><div class="volume"></div></div><button class="music-radio-seek" onclick="SeekStation(this,-1);">←</button><button class="music-radio-seek" onclick="SeekStation(this,1);">→</button><button class="music-radio-playpause" onclick="PlayPauseStation(this);">▶</button><button class="music-radio-vol" onclick="VolStation(this,.05);">+</button><button class="music-radio-vol" style="top:50%" onclick="VolStation(this,-.05);">-</button></div><audio id="music-radio-audio" src="' + window.CTSRadioStations[0][1] + '"></audio>');
TitleCSS +="span[title=\"Follow\"], span[title=\"Share room\"]{display:none!important;}";
} else {
VideoCSS = "#videos-footer-broadcast{border-radius:unset!important;}#videos-footer-broadcast-wrapper > #videos-footer-submenu-button{border-radius:unset;}#videos-footer-push-to-talk{margin-left:0!important;border-radius:unset;}#videos-footer-youtube, #videos-footer-soundcloud{min-width:35px;border-radius:unset;margin-right: 0;}@media screen and (max-width: 600px){#videos-footer-broadcast, #videos-footer-broadcast-wrapper.hide-submenu > #videos-footer-broadcast {height:50px;line-height:50px;}#videos-footer{min-height: 50px;padding:0}}span[title=\"Settings\"]>svg{padding:7px 10px;height:24px;width:24px;}#videolist[data-mode=\"dark\"]{background-color:unset;}#videos-footer-broadcast-wrapper{display:contents;}.video:after{content: unset;border:unset;}#videos-header{padding:0;background:#181d1e;}.ctsdrop{position:fixed;display:inline-block;top:3px;left:4px;z-index:5;min-width: 46px;}.ctsdrop-content{position:absolute;top:28px;right:0;background:#181d1e;min-width:46px;width: 46px;padding:0;z-index:1;display:none;}.ctsdrop:hover .ctsdrop-content{display:block;}.ctsoptions:hover{background:#53b6ef}.ctsoptions{width:46px;height:28px;z-index: 2;cursor: pointer;top: 4px;background: #181d1e75;border: none;padding: 5% 0;display: inline-block;}";
MainCSS += "body{overflow:auto;}";
ContextMenuCSS = ".context.show{height:100%;}.context:after{content:unset;}.context>span{text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;font:800 14px sans-serif;color:#FFFFFF;display:inline-block;padding:1px 1%;line-height:17px;height:17px;}.context{background:#101314;position:unset;padding:0;height:0;transition:.25s;}";
UserListCSS += "#contextmenu{top:unset;bottom:0;left:0;}";
}
ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
StyleSet();
document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin", "<button style=\"display:"+((CTS.Project.isTouchScreen)?"none":"block")+"\" class=\"tcsettings\">⯇</button>");
VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
VideoListElement.querySelector("#videolist").insertAdjacentHTML("afterbegin", '<div class="ctsdrop"><button class="ctsoptions" title="CTS Options"><img src="https://i.imgur.com/nvr9FjM.png" /></button><div class="ctsdrop-content"><div style="height:6px;background:#624482;"></div><button id="BackgroundUpdateRight" class="ctsoptions" title="Background"><img src="https://i.imgur.com/Zn97vqS.png" /></button><button id="BackgroundUpdateLeft" class="ctsoptions" title="Background"><img src="https://i.imgur.com/OAcfZRy.png" /></button><div style="height:6px;background:#624482;"></div><button id="FontSizeUpdate" class="ctsoptions" title="Font Size"><img src="https://i.imgur.com/eVc0N5A.png" /></button><div style="height:6px;background:#624482;"></div><button id="ChatColor" class="ctsoptions" title="Chat Style"><img src="https://i.imgur.com/62jpRbt.png" /></button><button id="CameraBorderToggled" class="ctsoptions" title="Camera Border"><img src="https://i.imgur.com/BXK3MR2.png" /></button><button id="FeaturedToggled" class="ctsoptions" title="YouTube/Featured Resize"><img src="https://i.imgur.com/u8mBZYJ.png" /></button>' + ((!CTS.ThemeChange) ? '<button id="ChatWidthToggled" class="ctsoptions" title="Chat Resize"><img src="https://i.imgur.com/G95jVFI.png" /></button><button id="ChatHeightToggled" class="ctsoptions" title="Chat Resize"><img src="https://i.imgur.com/AGc7mLN.png" /></button><div style="height:6px;background:#624482;"></div><button id="PerformanceModeToggled" class="ctsoptions" title="Performance Mode"><img src="https://i.imgur.com/qoKTU4y.png" /></button>' : '') + ((!CTS.Project.isTouchScreen)?'<div style="height:6px;background:#624482;"></div><button id="ThemeChange" class="ctsoptions" title="Switch CTS Theme Mode"><img src="https://i.imgur.com/NF6U3Us.png" /></button></div></div>':''));
ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div><button class="notifbtn">▼</button>');
ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
//SCRIPT INIT -> PREPARE()
clearInterval(CTS.ScriptLoading);
CTS.ScriptInit = true;
CTSRoomPrepare();
}
function CTSRoomPrepare() {
//FUNCTION BYPASS
window.TinychatApp.BLL.Videolist.prototype.blurOtherVids = function() {};
window.TinychatApp.BLL.SoundPlayer.playMessage = function() {};
window.TinychatApp.BLL.SoundPlayer.playGift = function() {};
window.TinychatApp.BLL.User.isSubscription = function() {return true;};
window.TinychatApp.BLL.User.canUseFilters = function() {return true;};
window.TinychatApp.BLL.MediaConnection.prototype.Close = function() {RTC(this);};
window.TinychatApp.BLL.ChatRoom.prototype.sendPushForUnreadPrivateMessage = function() {};
if (!CTS.Project.isTouchScreen) {
window.TinychatApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
var b = this,
d = this.settings.getSettings();
if (d.video === null) {
return void this.app.MediaSettings(() => {
this.BroadcastStart();
});
}
this.videolist.AddingVideoSelf(this.self_handle);
var e = {};
if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
e.audio = true;
e.video = {width: {min: 320,max: 4096},height: {min: 240,max: 2160},frameRate: {min: 15,ideal: 30,max: 60}};
} else {
navigator.mediaDevices.enumerateDevices().then(g => {
var h = false;
var len = g.length;
for (var c = 0; c < len; c++) {
if (g[c].kind === "videoinput") {
if (e.video === void 0) e.video = {width: {min: 320,max: 4096},height: {min: 240,max: 2160},frameRate: {min: 15,ideal: 30,max: 60}};
if (h) {
d.video = g[c];
h = false;
this.settings.saveSettings(d);
} else if (d.video === null) {
d.video = g[c];
this.settings.saveSettings(d);
} else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
e.video.deviceId = {
exact: d.video.deviceId
};
} else if (d.video.deviceId === a) {
h = true;
}
}
if (g[c].kind === "audioinput") {
if (e.audio === void 0) e.audio = {};
if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) {
e.audio = {
deviceId: {
exact: d.audio.deviceId
},
};
}
}
}
if (e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
let i = navigator.mediaDevices.getSupportedConstraints();
for (let a in i) {
if (i.hasOwnProperty(a) && "echoCancellation" == a && e.audio) e.audio[a] = this.settings.isAcousticEchoCancelation();
}
if (!(e.audio || e.video)) {
b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
} else if ("https:" === location.protocol || this.app.isDebug()) {
debug("BROADCAST", "Initiating Media...");
var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
b.mediaLastConstraints = e;
navigator.mediaDevices.getUserMedia(e).then(m => {
b.onMediaSuccessCallback(m);
});
}
}).catch(er => {
debug("CAMERA::ERROR", er);
});
}
};
}
window.TinychatApp.BLL.Userlist.prototype.ignore = function(a) {
var b = a.isUsername ? a.username : a.nickname;
if (this.isIgnored(a) || this.ignored.push(b)) {
var c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
this.app.showToast(b + " ignored successfully till they leave or you refresh!");
CTS.TempIgnoreList.push(b.toUpperCase());
Cameras();
}
};
window.TinychatApp.BLL.Userlist.prototype.unignore = function(a) {
var b = a.isUsername ? a.username : a.nickname,
len = this.ignored.length;
for (var TI = 0; TI < len; TI++) {
if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
this.ignored.splice(TI, 1);
break;
}
}
len = CTS.TempIgnoreList.length;
for (TI = 0; TI < len; TI++) {
if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
CTS.TempIgnoreList.splice(TI, 1);
break;
}
}
var e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
this.app.showToast(a.username + " unignored");
};
//REMOVE
Remove(ChatLogElement, 'span[id="input-unread"]');
Remove(ChatLogElement, "#chat-content");
//PARAM REMOVE
if (CTS.enablePMs === false) Remove(ChatListElement, "#chatlist");
//LOAD
CTSRoomLoad();
}
function CTSRoomLoad() {
//EVENT LISTENERS
if (!CTS.ThemeChange) {
// BOOT UP OG THEME
var finishoff = false;
while (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter || CTS.OGStyle.SavedWidth !== CTS.OGStyle.WidthCounter) {
if (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter) {
ChatHeightToggled();
} else {
finishoff = true;
}
if (CTS.OGStyle.SaveWidth !== CTS.OGStyle.WidthCounter && finishoff) ChatWidthToggled();
}
VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
ChatHeightToggled();
Save("OGStyleHeight", CTS.OGStyle.HeightCounter);
}, {
passive: true
});
VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
ChatWidthToggled();
Save("OGStyleWidth", JSON.stringify(CTS.OGStyle.WidthCounter));
}, {
passive: true
});
VideoListElement.querySelector("#PerformanceModeToggled").addEventListener("click", function() {
if (CTS.ChatDisplay) {
CTS.PerformanceMode = !CTS.PerformanceMode;
PerformanceModeInit(CTS.PerformanceMode);
}
}, {
passive: true
});
} else {
if (!CTS.Project.isTouchScreen) {
ChatLogElement.querySelector("#chat-wider").insertAdjacentHTML("beforebegin", "<div id=\"chat-hide\"></div>");
ChatLogElement.querySelector("#chat-hide").addEventListener("click", function() {
ChatHide();
}, {
passive: true
});
}
}
if (!CTS.Project.isTouchScreen) {
ChatLogElement.querySelector("#chat-wrapper").insertAdjacentHTML("afterbegin", "<div id=\"chat-download\"></div>");
ChatLogElement.querySelector("#chat-download").addEventListener("click", function() {
var len = CTS.UserList.length,
t = "Users : "+len+"\n",
c;
for (c = 0; c < len; c++) {
if (c){ // 0 = false
t+= ", ";
if (c % 10 === 0) t += "\n";
}
t += CTS.UserList[c].username +" ("+CTS.UserList[c].nick+")";
}
t += "\n\n";
len = CTS.Message[CTS.ActiveMessage].length;
for (c = 0; c < len; c++) t += "["+CTS.Message[CTS.ActiveMessage][c].time+"]["+CTS.Message[CTS.ActiveMessage][c].username+"("+CTS.Message[CTS.ActiveMessage][c].nick+")]: "+(CTS.Message[CTS.ActiveMessage][c].msg.replace(/(\r\n|\n|\r)/gm,"")+"\n");
Download("TinyChat_"+CTS.Room.Name.toUpperCase()+" "+DateTime()+".log", "Room : "+CTS.Room.Name+"\n"+t);
}, {
passive: true
});
VideoListElement.querySelector("#ThemeChange").addEventListener("click", function() {
CTS.ThemeChange = !CTS.ThemeChange;
Save("ThemeChange", JSON.stringify(CTS.ThemeChange));
location.reload();
}, {
passive: true
});
}
VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
CTS.Featured = !CTS.Featured;
Save("Featured", JSON.stringify(CTS.Featured));
FeaturedCameras(CTS.Featured);
Resize();
}, {
passive: true
});
VideoListElement.querySelector("#CameraBorderToggled").addEventListener("click", function() {
CTS.CameraBorderToggle = !CTS.CameraBorderToggle;
Save("CameraBorderToggle", JSON.stringify(CTS.CameraBorderToggle));
Cameras();
Resize();
}, {
passive: true
});
VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
CTS.ChatStyleCounter++;
Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
var len = window.CTSChatCSS.length - 1;
if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
StyleSet();
Save("ChatStyle", CTS.ChatStyleCounter);
}, {
passive: true
});
ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
UpdateScroll(1, true);
CheckUnreadMessage();
}, {
passive: true
});
ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
var element = event.target;
if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage(true);
}, {
passive: true
});
ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
var element = event.target;
if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
}, {
passive: true
});
if (CTS.NotificationToggle === 0) {
ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
passive: true
});
}
VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
var arg;
if (this.innerText === "⯈") {
this.innerText = "⯇";
arg = "block";
} else {
this.innerText = "⯈";
arg = "none";
}
VideoListElement.querySelector("#videos-header-sound").style.display = arg;
if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
//VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
}, {
passive: true
});
VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
if (!Addon.active("BGIMG")) {
CTS.MainBackgroundCounter++;
if (CTS.MainBackgroundCounter === window.CTSImages.length) CTS.MainBackgroundCounter = 0;
var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
document.body.style.background = background;
Save("MainBackground", background);
}
}, {
passive: true
});
VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
if (!Addon.active("BGIMG")) {
CTS.MainBackgroundCounter--;
if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = window.CTSImages.length - 1;
var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
document.body.style.background = background;
Save("MainBackground", background);
}
}, {
passive: true
});
VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
CTS.FontSize += 5;
if (CTS.FontSize >= 40) CTS.FontSize = 15;
Save("FontSize", CTS.FontSize);
ChatLogElement.querySelector("#textarea").style.fontSize = (CTS.FontSize - 4) + "px";
}, {
passive: true
});
//MUTATION OBSERVERS
new MutationObserver(function() {
LoadMessage();
}).observe(ChatLogElement.querySelector("#chat-instant"), {
attributes: true,
attributeFilter: ["class"],
childList: false,
characterData: false
});
new MutationObserver(function() {
Cameras();
}).observe(VideoListElement.querySelector(".videos-items:first-child"), {
childList: true
});
new MutationObserver(function() {
Cameras();
}).observe(VideoListElement.querySelector(".videos-items:last-child"), {
childList: true
});
new MutationObserver(function() {
if (CTS.AutoMicrophone) {
OpenMicrophone();
}
}).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
attributes: true,
attributeFilter: ["class"]
});
//BOOT UP - FIRST START
NotificationDisplay();
FeaturedCameras(CTS.Featured);
Cameras();
}
//YOUTUBE FUNCTIONS
function CheckHost() {
if (CTS.Host === 0) {
Send("msg", "!whoisbot");
CTS.HostAttempt = 0;
CTS.HostWaiting = true;
}
}
function SetBot() {
if (arguments[0]) CTS.Game.NoReset = true;
Send("msg", "!bot");
CTS.HostWaiting = false;
}
function CheckYouTube() {
//CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
if (arguments[3] === undefined) arguments[3] = true;
CTS.YouTube.XHR.type = arguments[1];
var videoid = arguments[0].match(/http(?:s)?(?:\:\/\/)(?:w{1,3}\.)?(?:youtu(?:\.be|be.com))(?:\/v\/|\/)?(?:watch\?|playlist\?|embed\/|user\/|v\/|\/)(list\=[a-z0-9\-\_]{1,34}|(?:v\=)?[a-z0-9\-\_]{1,11})/i);
if (videoid !== null) {
videoid = videoid[1].replace(/v\=/g, "");
//LINK IS PLAYLIST
if (videoid.match(/list\=/i)) {
if (arguments[3]) {
videoid = videoid.replace(/list\=/, "");
debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/playlistItems?playlistId=" + videoid + "&part=snippet&maxResults=25" + ((arguments[2] !== undefined) ? "&pageToken=" + arguments[2] : "") + "&type=video&eventType=completed&key=" + CTS.YouTube.API_KEY);
CTS.YouTube.XHR.playlistid = videoid;
CTS.YouTube.XHR.send();
}
} else {
//LINK IS REGULAR
CTS.YouTube.XHR.videoid = videoid;
CTS.YouTube.VideoReturn = true;
CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.XHR.videoid + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=" + CTS.YouTube.API_KEY);
CTS.YouTube.XHR.send();
debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
}
} else {
//KEYWORD SEARCH
if (CTS.YouTube.MessageQueueList.length <= 0) {
arguments[0] = arguments[0].replace(/^(!yt )/, "");
CTS.YouTube.SearchReturn = true;
CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/search?key=" + CTS.YouTube.API_KEY + "&maxResults=1&q=" + encodeURI(arguments[0]) + "&type=video&part=snippet");
CTS.YouTube.XHR.send();
debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
}
}
}
function YouTubePlayList() {
CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
}
function YouTubeTrackAdd() {
if (CTS.YouTube.MessageQueueList[0] !== undefined) {
if (CTS.YouTube.Busy === false) {
if (CTS.YouTube.MessageQueueList.length > 0) {
debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=" + CTS.YouTube.API_KEY);
CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
CTS.YouTube.XHR.send();
CTS.YouTube.MessageQueueList.shift();
}
}
}
}
function YouTubePlayListItems() {
var len = arguments[0].length;
for (var i = 0; i < len; i++) {
if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
CTS.YouTube.MessageQueueList.push(arguments[0][i]);
}
}
}
function YouTubeTimeConvert() {
//TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
var a = arguments[0].match(/\d+/g);
if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
var len = a.length;
arguments[0] = 0;
if (len == 3) {
arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
arguments[0] = arguments[0] + parseInt(a[1]) * 60;
arguments[0] = arguments[0] + parseInt(a[2]);
}
if (len == 2) {
arguments[0] = arguments[0] + parseInt(a[0]) * 60;
arguments[0] = arguments[0] + parseInt(a[1]);
}
if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
return arguments[0];
}
function BotCommandCheck() {
//USER COMMANDS TO HOST
if (isCommand(arguments[1])) {
if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
if (arguments[1].match(/^!vote\s/i)) Vote(arguments[0], arguments[1]);
// PUBLIC COMMANDS
if (CTS.PublicCommandToggle) {
if (arguments[1].match(/^!8ball\s.*\??/i)) Send("msg", "[8BALL]\n" + window.CTSEightBall[Rand(0, window.CTSEightBall.length - 1)]);
if (arguments[1].match(/^!coin$/i)) Send("msg", "[COIN FLIP]\nThe coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!");
if (arguments[1].match(/^!chuck$/i)) Chuck();
if (arguments[1].match(/^!urb\s/i)) Urb(arguments[1]);
if (arguments[1].match(/^!dad$/i)) Dad();
if (arguments[1].match(/^!advice$/i)) Advice();
}
//MOD/JR.MOD
if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
if (arguments[1].match(/^!kick\s/i)) ModCommand("kick", arguments[1]);
if (arguments[1].match(/^!ban\s/i)) ModCommand("ban", arguments[1]);
if (arguments[1].match(/^!close\s/i)) ModCommand("stream_moder_close", arguments[1]);
}
//ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
if (CTS.Room.YT_ON) {
if (arguments[1].match(/^!play$/i)) YouTubePlayList();
if (arguments[1].match(/^!yt\s/i)) BotCommand(1, arguments[0], arguments[1]);
if (arguments[1].match(/^!ytbypass\s/i)) BotCommand(6, arguments[0], arguments[1]);
if (arguments[1].match(/^!ytclear$/i)) BotCommand(2, arguments[0]);
if (arguments[1].match(/^!ytskip$/i)) BotCommand(3, arguments[0]);
if (arguments[1].match(/^!ytqueue$/i)) BotCommand(4, arguments[0]);
}
}
//USER CAN GAME THEY'VE BEEN VERIFIED
if (CTS.UserList[arguments[0]].canGame) FishCommandCheck(arguments[0], arguments[1]);
}
function BotCheck() {
if (CTS.UserList[arguments[0]].mod) {
//CHECK HOST
if (arguments[1].match(/^!bot$/i)) {
//SET HOST
CTS.Host = arguments[2].handle;
CTS.HostWaiting = false;
//RESET GAMES
if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
if (CTS.Me.handle !== arguments[2].handle) {
CTS.Game.Fish.GameStart = false;
CTS.Game.NoReset = false;
Fish.reset(true);
}
}
//IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
if (CTS.Me.handle == arguments[2].handle && CTS.Room.YT_ON) YouTubePlayList();
//ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
} else if (CTS.HostWaiting === true) {
CTS.HostAttempt++;
//SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
if (CTS.HostAttempt == 1) {
setTimeout(function() {
//CHECK WAITING STATE OR IF HOST HAS CHANGED
if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
}, 10000);
}
//SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
if (CTS.HostAttempt == 10) SetBot(false);
}
}
}
function Chuck() {
//OPEN REQUEST
CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
CTS.Chuck.XHR.send();
}
function Urb() {
//CHECK TERM
var urban = arguments[0].match(/\!urb\s(.*)/i);
if (urban !== null) {
//OPEN REQUEST
CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
CTS.Urb.XHR.send();
}
}
function Dad() {
//OPEN REQUEST
CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
CTS.Dad.XHR.send();
}
function Advice() {
//OPEN REQUEST
CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
CTS.Advice.XHR.send();
}
//MESSAGE FUNCTION
function CreateMessage() {
//SCROLLED UP? MISSED A MESSAGE?
CheckUnreadMessage();
// POST NEW CHAT ITEM AND IF ACTIVECHAT IS OUR CURRENT
if (arguments[7] == GetActiveChat()) ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(arguments[3]) || arguments[6]) ? "highlight" : "") + "\" " + ((arguments[2] === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((arguments[2]=="")?"":((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + arguments[2] + "\"></div></a>" : "")) + "<div class=\"nickname\" style=\"background:" + arguments[1] + ";\">" + arguments[4] + (CTS.TimeStampToggle ? "<div class=\"ctstime\"> " + arguments[0] + " </div>" : "") + "</div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\"style=\"font-size:" + CTS.FontSize + "px;\">" + arguments[5] + "</span></CTS-message-html></div></div>");
//CHAT CLEANUP
var Chat = ChatLogElement.querySelectorAll("#cts-chat-content>.message");
var len = Chat.length;
if (len > CTS.ChatLimit + 50) {
CTS.ChatScroll = true;
//REMOVE 50 MESSAGES (CAN BE DONE CLEANER BUT NO BIG DEAL FOR OUR USE)
len = Chat.length - CTS.ChatLimit;
var ChatIndex = 0;
for (ChatIndex; ChatIndex < len; ChatIndex++) {
Chat[ChatIndex].parentNode.removeChild(Chat[ChatIndex]);
CTS.Message[arguments[7]].shift();
//CLEANING TC ITEMS THAT FILL UP OVERTIME
window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
}
}
UpdateScroll(1, false);
}
function AKB() {
//WATCH OR REMOVE USERS
if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
} else {
if (CTS.Me.mod) {
if (CTS.AutoKick === true) {
CTS.NoGreet = true;
Send("kick", arguments[1]);
} else if (CTS.AutoBan === true) {
CTS.NoGreet = true;
Send("ban", arguments[1]);
}
}
}
}
function AKBS() {
if (arguments[0].username !== "") {
//EXTENDED SAFELIST
var temp = [];
if (Addon.active("AKB")) temp = Addon.get("AKB");
//DEFAULT SAFELIST
if (!isSafeListed(arguments[0].username.toUpperCase())) {
if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
if (CTS.SafeList.length < 2500) {
CTS.SafeList.push(arguments[0].username.toUpperCase());
Save("AKB", JSON.stringify(CTS.SafeList));
debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
}
} else {
if (arguments[0].lurker === false) {
AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
} else {
AKB(false, arguments[0].handle);
}
}
}
} else {
AKB(false, arguments[0].handle);
}
}
function CheckSafeList() {
var target = User(arguments[0]);
if (target !== -1) {
var a = CTS.SafeList.indexOf(CTS.UserList[target].username);
if (a !== -1) {
//REMOVE
if (arguments[1]) {
debug("SAFELIST::", "REMOVE USER " + CTS.UserList[target].username + " FROM SAFELIST");
Alert(GetActiveChat(), "🗹Removing "+CTS.UserList[target].username+" from safelist!");
CommandList.saferemove(a);
} else {
//GETID
return a;
}
}
}
}
function LoadMessage() {
var ChatIndex, index, Chat = ChatLogElement.querySelector("#cts-chat-content");
CTS.ChatScroll = true;
if (!CTS.MessageCallback[CTS.ActiveMessage]) CTS.MessageCallback[CTS.ActiveMessage] = [];
CTS.MessageCallback[CTS.ActiveMessage].html = Chat.innerHTML;
CTS.MessageCallback[CTS.ActiveMessage].len = (Chat.innerHTML === "") ? 0 : CTS.Message[CTS.ActiveMessage].length;
Chat.innerHTML = "";
CheckUnreadMessage();
CTS.ActiveMessage = GetActiveChat();
if (CTS.Message[CTS.ActiveMessage]) {
index = (CTS.MessageCallback[CTS.ActiveMessage]) ? CTS.MessageCallback[CTS.ActiveMessage].len : 0;
if (index > 0) Chat.innerHTML = CTS.MessageCallback[CTS.ActiveMessage].html;
var len = CTS.Message[CTS.ActiveMessage].length;
for (ChatIndex = index; ChatIndex < len; ChatIndex++) ChatLogElement.querySelector("#cts-chat-content").insertAdjacentHTML("beforeend", "<div class=\"message" + ((CTS.Avatar) ? " common " : " ") + ((CTS.HighlightList.includes(CTS.Message[CTS.ActiveMessage][ChatIndex].username) || CTS.Message[CTS.ActiveMessage][ChatIndex].mention) ? "highlight" : "") + "\" " + ((CTS.Message[CTS.ActiveMessage][ChatIndex].avatar === "") ? "style=\"padding-left:3px;\"" : "") + ">" + ((CTS.Avatar) ? "<a href=\"#\" class=\"avatar\"><div><img src=\"" + (CTS.Message[CTS.ActiveMessage][ChatIndex].avatar) + "\"></div></a>" : "") + "<div class=\"nickname\" style=\"-webkit-box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";box-shadow: 0 0 6px " + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";background:" + CTS.Message[CTS.ActiveMessage][ChatIndex].namecolor + ";\">" + CTS.Message[CTS.ActiveMessage][ChatIndex].nick + (CTS.TimeStampToggle ? "<div class=\"ctstime\"> " + CTS.Message[CTS.ActiveMessage][ChatIndex].time + " </div>" : "") + "</div><div class=\"content\"><cts-message-html><span id=\"html\" class=\"message common\" style=\"font-size:" + CTS.FontSize + "px;\">" + CTS.Message[CTS.ActiveMessage][ChatIndex].msg + "</span></CTS-message-html></div></div>");
} else {
CTS.Message[CTS.ActiveMessage] = [];
}
UpdateScroll(1, false);
UpdateScroll(2, false);
}
function CheckUnreadMessage() {
if ((Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) || arguments[0] !== undefined) {
CTS.MissedMsg = 0;
CTS.ChatScroll = true;
ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
} else {
CTS.MissedMsg++;
CTS.ChatScroll = false;
ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
}
}
function GetActiveChat() {
var elem = ChatListElement.querySelector(".active");
if (elem) return elem.getAttribute("data-chat-id");
return 0;
}
function CheckImgur() {
if (CTS.imgur) {
var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpeg|jpg|gif|png|mp4)/);
if (i !== null) {
arguments[0] = (i[1] == "mp4") ? "<center>(Video Below)\n<video onclick=\"if (this.paused) {this.play();}else{this.pause();}\" oncontextmenu=\"return false;\" width=\"288px\" height=\"162px\"><source src=\"" + i[0] + "\" type=\"video/mp4\" /><source src=\"https://i.imgur.com/qLOIgom.mp4\" type=\"video/mp4\" /></video>\n<a href=\"" + i[0] + "\" target=\"_blank\">Direct Link</a></center>" : "<center><img src=\"" + i[0] + "\" width=\"320px\" height=\"240px\" />\n<a href=\"" + i[0] + "\" target=\"_blank\">Direct Link</a></center>";
}
}
return arguments[0];
}
function TTS() {
var utter = new window.SpeechSynthesisUtterance(arguments[0]);
utter.voice = CTS.TTS.voices[0];
utter.rate = 1.0;
utter.pitch = 0.5;
CTS.TTS.synth.speak(utter);
}
function isCommand() {
return arguments[0].match(/^!/);
}
function RoomUsers() {
if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
}
function SpamPrevention() {
var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
if (LineBreaks >= 14 && arguments[1] === false) return true;
return false;
}
function GamePrevention() {
if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(?:FISHING\sBOAT)\]/i)) return false;
return true;
}
function UpdateScroll() {
if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true) && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
}
function DecodeTXT() {
var txt = document.createElement("textarea");
txt.innerHTML = arguments[0];
return txt.value;
}
function HTMLtoTXT() {
var p = document.createElement("p");
p.appendChild(document.createTextNode(arguments[0]));
return p.innerHTML.replace(/(?:(?:(?:https?|ftps?):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?/igm, "<a href=\"$&\" target=\"_blank\">$&</a>").replace(/[\u2680-\u2685]/g, "<span style=\"font-size:275%;\">$&</span>").replace(/\n|\r/g,"<br>");
}
function IgnoreText() {
if (arguments[0] !== "") {
if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
return true;
}
}
function TimeToDate() {
if (arguments[1] === undefined) arguments[1] = new Date();
var match = arguments[0].trim().match(/(\d+):(\d+)\s?((am|AM|aM|Am)|(pm|PM|pM|Pm))/);
var t = {
hours: parseInt(match[1]),
minutes: parseInt(match[2]),
period: match[3].toLowerCase()
};
if (t.hours === 12) {
if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
} else {
if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
}
return arguments[1];
}
function PushPM() {
var list = (arguments[2] !== undefined) ? CTS.UserList[arguments[2]] : CTS.Me;
CTS.Message[arguments[0]].push({
"time": Time(),
"namecolor": list.namecolor,
"avatar": list.avatar,
"username": list.username,
"nick": list.nick,
"msg": CheckImgur(HTMLtoTXT(arguments[1])),
"mention": false
});
if (arguments[0] == GetActiveChat()) {
var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, msg.mention, arguments[0]);
UpdateScroll(1, false);
}
}
function Time() {
return (new Date().toLocaleString("en-US", {
hour: "numeric",
minute: "numeric",
second: "numeric",
hour12: true
}));
}
function DateTime() {
return (new Date().toLocaleString("en-US", {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: "numeric",
minute: "numeric",
second: "numeric",
hour12: true
}));
}
//FEATURES
function Download() {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(arguments[1]));
element.setAttribute('download', arguments[0]);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
function StyleSet() {
var style = document.createElement('style');
style.setAttribute('id', CTS.ChatStyleCounter);
style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][0]+":host, #videolist {background-color:unset;}";
ChatLogElement.appendChild(style);
style = document.createElement('style');
style.setAttribute('id', CTS.ChatStyleCounter);
style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][1]+":host, #videolist {background-color:unset;}";
VideoListElement.appendChild(style);
style = document.createElement('style');
style.setAttribute('id', CTS.ChatStyleCounter);
style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][2]+":host, #videolist {background-color:unset;}";
SideMenuElement.appendChild(style);
}
function ChatHeightToggled() {
CTS.OGStyle.HeightCounter++;
if (!CTS.ChatDisplay) {
CTS.ChatWidth += 5;
CTS.ChatDisplay = true;
}
CTS.ChatHeight -= 5;
CTS.UserListDisplay = true;
if (CTS.ChatHeight == 20) {
CTS.ChatHeight = 45;
CTS.UserListDisplay = false;
CTS.OGStyle.HeightCounter = 0;
}
ChatLogElement.querySelector("#chat-wrapper").style.cssText = "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);" + (CTS.UserListDisplay ? "top:unset;min-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;max-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;" : "bottom:0;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
TitleElement.querySelector("#room-header").style.cssText = "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 84px);" : "84px;");
VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.cssText = "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 34px);" : "unset;top:34px;");
VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
SideMenuElement.querySelector("#sidemenu").style.cssText = !CTS.UserListDisplay ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;height:" + CTS.ChatHeight + "%!important;";
UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
PerformanceModeInit(CTS.PerformanceMode);
UpdateScroll(1, true);
UpdateScroll(2, true);
Resize();
}
function ChatWidthToggled() {
CTS.OGStyle.WidthCounter++;
CTS.ChatWidth += 5;
CTS.ChatDisplay = true;
if (CTS.ChatWidth == 25) {
CTS.ChatWidth = -5;
CTS.ChatDisplay = false;
CTS.OGStyle.WidthCounter = 0;
}
ChatLogElement.querySelector("#chat-wrapper").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);" + ((CTS.UserListDisplay) ? "top:unset;min-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;max-height:calc(100% - " + CTS.ChatHeight + "% - 119px)!important;" : "bottom:0;;min-height:calc(100% - 120px)!important;max-height: calc(100% - 120px)!important;");
TitleElement.querySelector("#room-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 84px);" : "84px;");
VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.cssText = (!CTS.ChatDisplay) ? "bottom:0;top:unset;width:100%;position:relative;" : "bottom:unset;min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%);top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 34px);" : "34px;bottom:unset;");
VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
SideMenuElement.querySelector("#sidemenu").style.cssText = (!CTS.ChatDisplay || !CTS.UserListDisplay) ? "display:none" : "min-width:400px;width:calc(400px + " + CTS.ChatWidth + "%);max-width:calc(400px + " + CTS.ChatWidth + "%)!important;height:" + CTS.ChatHeight + "%!important;";
UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
CTS.PerformanceMode = false;
PerformanceModeInit(CTS.PerformanceMode);
UpdateScroll(1, true);
UpdateScroll(2, true);
Resize();
}
function ChatHide() {
CTS.NormalStyle.ChatHide = !CTS.NormalStyle.ChatHide;
ChatLogElement.querySelector("#chat-wrapper").style.display = (CTS.NormalStyle.ChatHide ? "none" : "block");
UpdateScroll(1, true);
UpdateScroll(2, true);
Resize();
}
function SoundMeter() {
//MICROPHONE INDICATOR
setTimeout(function() {
var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
Featured = VideoListElement.querySelectorAll(".videos-items:first-child tc-video-item"),
TCCameraList = window.TinychatApp.getInstance().defaultChatroom._videolist.items.length,
CameraLen = Camera.length,
users;
if (Featured.length > 0) {
for (var x = 0; x < TCCameraList; x++) {
if (CameraLen < 1) break;
for (users = 0; users < CameraLen; users++) {
if (Camera[users].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id") == window.TinychatApp.getInstance().defaultChatroom._videolist.items[x].userentity.path) {
Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", window.TinychatApp.getInstance().defaultChatroom._videolist.items[x].audiolevel);
Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
break;
}
}
}
} else {
for (users = 0; users < CameraLen; users++) {
Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", window.TinychatApp.getInstance().defaultChatroom._videolist.items[users].audiolevel);
Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
}
}
//REPEAT
SoundMeter();
}, 200);
}
function RTC() {
if (null != arguments[0].rtc) {
let a = arguments[0].rtc;
arguments[0].rtc = null;
MS(arguments[0], a);
}
}
function Vote() {
var ChecksOut = CTS.VoteSystem,
len = CTS.WaitToVoteList.length;
if (len > 0 && ChecksOut) {
for (var i = 0; i < len; i++) {
if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
Send("msg", "Please wait several minutes till you can cast your vote again!");
ChecksOut = false;
break;
}
}
}
if (ChecksOut) {
if (isSafeListed(CTS.UserList[arguments[0]].username.toUpperCase())) {
var targetname = arguments[1].match(/\!vote\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
if (targetname !== null) {
var Target = UsernameToUser(targetname[1].toUpperCase());
if (Target !== -1) {
if (CTS.UserList[Target].broadcasting) {
if (CTS.Me.owner || !CTS.UserList[Target].mod) {
Send("msg", "Your vote has been cast, you may vote again shortly!");
CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
CTS.UserList[Target].vote += 1;
if (CTS.UserList[Target].vote === 3) {
CTS.UserList[Target].vote = 0;
Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
Send("stream_moder_close", CTS.UserList[Target].handle);
}
} else {
Send("msg", "I cannot do that!");
}
}
} else {
Send("msg", "The user is not broadcasting...");
}
} else {
Send("msg", "The nickname or username does not exist!");
}
}
}
}
function MessagePopUp() {
if (CTS.Popups) {
var push = false;
if (arguments[0] != -1) {
if (ChatListElement.querySelector(".list-item .active")) {
if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
if (arguments[2]) push = true;
} else {
push = true;
}
} else if (!arguments[2]) {
push = true;
}
}
if (arguments[3]) push = true;
if (push || !CTS.ChatDisplay) {
if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
clearTimeout(CTS.NotificationTimeOut[0]);
CTS.NotificationTimeOut.shift();
}
VideoListElement.querySelector(".PMOverlay").insertAdjacentHTML("beforeend", "<div class=\"PMPopup\"><h2><div class=\"PMTime\">" + Time() + "</div><div class=\"PMName\">" + ((arguments[3]) ? "YouTube" : (CTS.UserList[arguments[0]].nick + " in " + ((arguments[2]) ? "Main" : "PM"))) + "</div></h2><div class=\"PMContent\"style=\"font-size:" + CTS.FontSize + "px\">" + arguments[1] + "</div></div>");
CTS.NotificationTimeOut.push(setTimeout(function() {
if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
CTS.NotificationTimeOut.shift();
}
}, 11100));
}
}
}
function Reminder() {
var temp,
i,
len = CTS.ReminderServerInList.length;
for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
CTS.ReminderServerInList = [];
if (CTS.Reminder === true) {
var OffsetTime;
len = CTS.ReminderList.length;
for (i = 0; i < len; i++) {
temp = TimeToDate(CTS.ReminderList[i][0]);
CTS.RecentTime = new Date();
if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
OffsetTime = temp - CTS.RecentTime;
CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, CTS.ReminderList[i][1]));
}
if (Addon.active("ReminderList")) {
len = Addon.get("ReminderList").length;
for (i = 0; i < len; i++) {
temp = TimeToDate(Addon.get("ReminderList")[i][0]);
CTS.RecentTime = new Date();
if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
OffsetTime = temp - CTS.RecentTime;
CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, Addon.get("ReminderList")[i][1]));
}
}
}
}
function AddReminder() {
Send("msg", "🕬 " + arguments[0]);
setTimeout(Reminder, 5000);
}
function NotificationDisplay() {
ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
if (CTS.NotificationToggle == 0) {
ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
passive: true
});
} else {
ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
passive: true
});
}
UpdateScroll(1, true);
UpdateScroll(2, true);
}
function NotificationResize() {
ChatLogElement.querySelector("#notification-content").classList.toggle("large");
if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
ChatLogElement.querySelector(".notifbtn").innerText = "▲";
ChatLogElement.querySelector("#chat").style.height = "50%%";
} else {
ChatLogElement.querySelector(".notifbtn").innerText = "▼";
ChatLogElement.querySelector("#chat").style.height = "100%";
}
UpdateScroll(1, false);
UpdateScroll(2, true);
}
function Dice() {
return String.fromCharCode("0x268" + Rand(0, 5));
}
function Rand() {
arguments[0] = Math.ceil(arguments[0]);
arguments[1] = Math.floor(arguments[1]);
return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
}
function OpenMicrophone() {
MicrophoneElement.initMouseEvent("mousedown");
VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
}
function Cameras() {
var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
Len = Camera.length;
for (var user = 0; user < Len; user++) {
var isIgnored = User(Camera[user].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id"));
if (CheckUserIgnore(isIgnored) || CheckUserTempIgnore(isIgnored) && !Camera[user].shadowRoot.querySelector(".not-visible")) Camera[user].shadowRoot.querySelector("button[class=\"icon-visibility\"]").click();
Camera[user].shadowRoot.querySelector(".video").style.padding = (CTS.CameraBorderToggle) ? "5px" : "0";
if (!Camera[user].shadowRoot.querySelector(".video #fixed")) Camera[user].shadowRoot.querySelector(".video").insertAdjacentHTML("afterbegin", "<style id=\"fixed\">@media screen and (max-width: 1827px){.video.large{width:100%!important;}}.video.large{position: absolute;left:0;top: 0;z-index: 2;max-width: 1827px;}.video>div>.overlay[data-mic-level=\"1\"] {-webkit-box-shadow: inset 0 0 2px 3px #53b6ef;box-shadow: inset 0 0 2px 3px #53b6ef;}.video>div>.overlay[data-mic-level=\"2\"] {-webkit-box-shadow: inset 0 0 4px 3px #53b6ef;box-shadow: inset 0 0 4px 3px #53b6ef;}.video>div>.overlay[data-mic-level=\"3\"],.video>div>.overlay[data-mic-level=\"4\"], .video>div>.overlay[data-mic-level=\"5\"], .video>div>.overlay[data-mic-level=\"6\"], .video>div>.overlay[data-mic-level=\"7\"], .video>div>.overlay[data-mic-level=\"8\"], .video>div>.overlay[data-mic-level=\"9\"], .video>div>.overlay[data-mic-level=\"10\"] {-webkit-box-shadow: inset 0 0 6px 3px #53b6ef;box-shadow: inset 0 0 6px 3px #53b6ef;}.video:after{content:unset;}</style>");
}
Resize();
}
function FeaturedCameras() {
if (arguments[0] === true) {
if (VideoListElement.querySelector("#SmallFTYT")) {
Remove(VideoListElement, "#SmallFTYT");
}
} else {
var node = document.createElement("style");
node.appendChild(document.createTextNode(FeaturedCSS));
node.setAttribute("id", "SmallFTYT");
VideoListElement.appendChild(node);
}
}
function Resize() {
window.dispatchEvent(new Event("resize"));
}
function PerformanceModeInit() {
var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
ChatLogElement.querySelector("#chat-wrapper").style.width = value;
TitleElement.querySelector("#room-header").style.minWidth = value;
TitleElement.querySelector("#room-header").style.maxWidth = value;
TitleElement.querySelector("#room-header").style.width = value;
VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
SideMenuElement.querySelector("#sidemenu").style.width = value;
document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
VideoListElement.querySelector("#videos").style.display = ((!arguments[0]) ? "block!important" : "none!important");
UpdateScroll(1, true);
UpdateScroll(2, true);
Resize();
}
function OwnerCommand() {
//MESSAGE FROM OWNER
if (isCommand(arguments[1])) {
if (CTS.UserList[arguments[0]].owner) {
if (!CTS.Me.owner) {
//PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
if (arguments[1].match(/^!raid\s/i)) {
var raid = arguments[1].match(/^(?:\!raid\s)(https?:\/\/tinychat.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?(?:[a-z0-9_]){1,32})/i);
if (raid !== undefined) window.location.replace(raid[1]);
}
if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + Ver(), CTS.UserList[arguments[0]].handle);
} else {
if (arguments[1].match(/^!closeall$/i)) {
for (var a = 0; a < CTS.Camera.List.length; a++) {
if (CTS.Me.handle !== CTS.Camera.List[a]) Send("stream_moder_close", CTS.Camera.List[a]);
}
}
if (arguments[1].match(/^!kickall$/i)) {
for (var b = 0; b < CTS.UserList.length; b++) {
if (CTS.Me.handle !== CTS.UserList[b].handle) Send("kick", CTS.UserList[b].handle);
}
}
}
}
}
}
function Command() {
var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?:\s?)(.*)/i);
if (UserCommand) {
if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
}
}
}
//ALERT FUNCTIONS
function Settings() {
Alert(GetActiveChat(), ((arguments[0] !== undefined) ? arguments[0] : "") + "<center>CTS BOT CONFIGURATION:\nBot Mode: " + ((CTS.Bot) ? "ON" : "OFF") + "\nOperator Mode: " + ((CTS.UserYT) ? "ON" : "OFF") + "\nPublic Command Mode: " + ((CTS.PublicCommandToggle) ? "ON" : "OFF") + "\nGreen Room Mode:\n" + ((CTS.GreenRoomToggle) ? "AUTO ALLOW" : "MANUAL") + "\nReminder Mode: " + ((CTS.Reminder) ? "ON" : "OFF") + "\nGame View: " + ((CTS.CanSeeGames) ? "ON" : "OFF") + "\nGame Host: " + ((CTS.CanHostGames) ? "ON" : "OFF") + "\n\nAvatar Display: " + ((CTS.Avatar) ? "SHOW" : "HIDE") + "\nNotification Display: " + ((CTS.NotificationToggle != 2) ? "SHOW("+CTS.NotificationToggle+")" : "HIDE") + "\nPopup Display: " + ((CTS.Popups) ? "SHOW" : "HIDE") + "\nFont Size: " + CTS.FontSize + "PX\n\nFOR LIST OF COMMANDS:\n!CTS</center>");
}
function Alert() {
CTS.Message[arguments[0]].push({
"time": Time(),
"namecolor": (arguments[2] !== undefined) ? "#000000" : "#3f69c0",
"avatar": (arguments[2] !== undefined) ? ("") : ("https://i.imgur.com/S09irS7.png"),
"username": "",
"nick": (arguments[2] !== undefined) ? (arguments[2]) : ("CTS Version: " + Ver()),
"msg": ((arguments[2] !== undefined) ? ("<div id=\"system_user\">" + arguments[1] + "</div>") : arguments[1]),
"mention": ((arguments[2] !== undefined) ? false : true)
});
var len = CTS.Message[arguments[0]].length - 1;
arguments[1] = CTS.Message[arguments[0]][len];
CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[1].mention, arguments[0]);
}
function Ver() {
return window.CTSVersion.Major + "." + window.CTSVersion.Minor + "." + window.CTSVersion.Patch;
}
function AddUserNotification() {
if (CTS.FullLoad && CTS.ShowedSettings) {
var chat = ChatLogElement.querySelector("#notification-content"),
Notification;
CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
if (arguments[0] == 1) {
Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
} else if (arguments[0] == 2) {
Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left");
} else if (arguments[0] == 3) {
Notification = arguments[2] + "has mentioned you!";
if (CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span style=\"background:" + arguments[1] + "\" class=\"nickname\">" + arguments[2] + "</span>"+((CTS.TimeStampToggle)?"<span class=\"time\"> " + Time() + " </span>":"")+"<br/> has mentioned you.</div></div>");
UpdateScroll(2, true);
} else if (arguments[0] == 4) {
Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
}
if (arguments[0] != 3 && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><div class=\"notification\"><span class=\"nickname\" style=\"background:" + arguments[1] + ";\">" + arguments[2] + "</span>"+((CTS.TimeStampToggle)?"<span class=\"time\"> " + Time() + " </span>":"")+"<br/>" + Notification + "</div></div>");
if (CTS.NotificationToggle == 1) Alert(0, Notification, arguments[2]);
if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(arguments[2].toUpperCase()) || CTS.TTSList.includes(arguments[3]) || CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[2] + ((arguments[0] == 4) ? " " : "as ") + Notification);
UpdateScroll(2, false);
var Notifications = ChatLogElement.querySelectorAll(".notification");
if (Notifications.length > CTS.NotificationLimit + 25) {
for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
}
}
}
function AddSystemNotification() {
if (CTS.FullLoad && CTS.ShowedSettings) {
if (CTS.NotificationToggle == 0) {
ChatLogElement.querySelector("#notification-content").insertAdjacentHTML("beforeend", "<div class=\"list-item\"><span class=\"nickname\"style=\"background:#F00\">SYSTEM</span>"+((CTS.TimeStampToggle)?"<span class=\"time\"> " + Time() + " </span>":"")+"<br/>" + arguments[0] + "</div>");
} else if (CTS.NotificationToggle == 1) {
Alert(0, arguments[0], "SYSTEM");
}
if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
UpdateScroll(2, false);
}
}
//USER FUNCTION
function AddUser() {
CTS.UserList.push({
"handle": arguments[0],
"username": arguments[5],
"nick": arguments[4],
"owner": arguments[7],
"mod": arguments[1],
"namecolor": arguments[2],
"avatar": arguments[3],
"canGame": arguments[6],
"broadcasting": false,
"vote": 0
});
if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
}
function User() {
for (var user = 0; user < CTS.UserList.length; user++) {
if (CTS.UserList[user].handle == arguments[0]) return user;
}
return -1;
}
function UsernameToHandle() {
for (var user = 0; user < CTS.UserList.length; user++) {
if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
}
return -1;
}
function UsernameToUser() {
for (var user = 0; user < CTS.UserList.length; user++) {
if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
}
return -1;
}
function NicknameToAccount() {
for (var user = 0; user < CTS.UserList.length; user++) {
if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
}
return -1;
}
function CheckUserListSafe() {
var len = CTS.UserList.length;
var temp = [];
if (Addon.active("AKB")) temp = Addon.get("AKB");
for (var user = 0; user < len; user++) {
if (!CTS.UserList[user].mod && !isSafeListed(CTS.UserList[user].username)) {
CTS.KBQueue.push(CTS.UserList[user].handle);
}
}
len = CTS.KBQueue.length;
for (var kb = 0; kb < len; kb++) {
Send(arguments[0], CTS.KBQueue[kb]);
}
CTS.KBQueue = [];
}
function isSafeListed() {
var temp = [];
if (Addon.active("AKB")) temp = Addon.get("AKB");
return (CTS.SafeList.includes(arguments[0]) || temp.includes(arguments[0]));
}
function CheckUserTempIgnore() {
if (CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
return false;
}
function CheckUserIgnore() {
if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.IgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
return false;
}
function CheckUserTouchScreen() {
//CHECK TOUCHPOINT
if ("maxTouchPoints" in navigator) {
CTS.Project.isTouchScreen = navigator.maxTouchPoints > 0;
} else if ("msMaxTouchPoints" in navigator) {
CTS.Project.isTouchScreen = navigator.msMaxTouchPoints > 0;
} else {
var mQ = window.matchMedia && matchMedia("(pointer:coarse)");
if (mQ && mQ.media === "(pointer:coarse)") {
CTS.Project.isTouchScreen = !!mQ.matches;
} else if ('orientation' in window) {
CTS.Project.isTouchScreen = true;
} else {
CTS.Project.isTouchScreen = (/\b(Android)\b/i.test(navigator.userAgent));
}
}
if (CTS.Project.isTouchScreen) {
CTS.ThemeChange = true;
CTS.NotificationToggle = 1;
}
}
function CheckUserAbuse() {
var action = false;
if (CTS.Me.mod) {
if ((CTS.KickList.includes(arguments[1]) || CTS.KickList.includes(arguments[2]))) {
CTS.NoGreet = true;
Send("kick", arguments[0]);
action = true;
}
if (!action) {
if ((CTS.BanList.includes(arguments[1]) || CTS.BanList.includes(arguments[2]))) {
CTS.NoGreet = true;
Send("ban", arguments[0]);
}
}
}
}
function CheckUserWordAbuse() {
if (CTS.UserList[arguments[0]].handle != CTS.Me.handle && !CTS.UserList[arguments[0]].mod) {
var action = false; //LETS NOT REPEAT/KICK
var len = CTS.KickKeywordList.length;
for (var i = 0; i < len; i++) {
if (arguments[1].includes(CTS.KickKeywordList[i])) {
Send("kick", CTS.UserList[arguments[0]].handle);
action = true;
break;
}
}
if (!action) {
len = CTS.BanKeywordList.length;
for (i = 0; i < len; i++) {
if (arguments[1].includes(CTS.BanKeywordList[i])) {
Send("ban", CTS.UserList[arguments[0]].handle);
break;
}
}
}
}
}
function RemoveUserCamera() {
var len = CTS.Camera.List.length;
if (len > 0) {
for (var i = 0; i < len; i++) {
if (CTS.Camera.List[i] === arguments[0]) {
CTS.Camera.List.splice(i, 1);
clearTimeout(CTS.Camera.clearRandom);
break;
}
}
}
}
function CheckUserStream() {
if (CTS.Me.mod) {
var user = User(arguments[0]);
if (user != -1) {
if (arguments[1]) {
//PUSH UPDATE
CTS.Camera.List.push(CTS.UserList[user].handle);
CTS.UserList[user].broadcasting = true;
var len = CTS.Camera.List.length;
if (CTS.UserList[user].username !== "GUEST" && !CTS.GreenRoomList.includes(CTS.UserList[user].username)) {
CTS.GreenRoomList.push(CTS.UserList[user].username);
Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
}
//CLEAR TIMERS
clearTimeout(CTS.Camera.clearRandom);
//CAMERA SWEEP FUNCTION
if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
CTS.Camera.clearRandom = setTimeout(function() {
var rand = Rand(0, len - 1);
if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
var target = User(CTS.Camera.List[rand]);
if (CTS.Me.owner || !CTS.UserList[target].mod) {
Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
Send("stream_moder_close", CTS.Camera.List[rand]);
CTS.Camera.List.splice(rand, 1);
}
}
}, CTS.Camera.SweepTimer * 60000);
}
} else {
clearTimeout(CTS.Camera.clearRandom);
RemoveUserCamera(CTS.UserList[user].handle);
CTS.UserList[user].broadcasting = false;
}
CTS.UserList[user].broadcasting = arguments[1];
if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
}
}
}
function CheckUserName() {
return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
}
function CheckUserNameStrict() {
return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
}
function MSR() {
if (arguments[0]) {
arguments[1].videolist.RemoveVideoRemote(arguments[1].handle);
} else {
arguments[1].mediaStream.stop();
arguments[1].mediaStream = null;
}
}
function MS() {
if (arguments[0].mediaStream !== null) {
if (arguments[0].mediaStream.active && arguments[1].signalingState !== "closed" && typeof arguments[1].removeStream === "function" && arguments[1].removeStream(arguments[0].mediaStream)) MSR(false, arguments[0]);
} else {
MSR(true, arguments[0]);
}
if (arguments[1].signalingState !== "closed" && arguments[1].close());
}
//LOAD/SAVE FUNCTION
function Load() {
var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
if (null === val && "undefined" != typeof arguments[1]) {
Save(arguments[0], arguments[1]);
return arguments[1];
}
return val;
}
function Save() {
localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
}
//SOCKET FUNCTION
function CTSWebSocket() {
if (window.Proxy === undefined) return;
var handler = {
set: function(Target, prop, value) {
if (prop == "onmessage") {
var oldMessage = value;
value = function(event) {
var parse = JSON.parse(event.data);
ServerMsg(parse, Target);
oldMessage(event);
};
}
return (Target[prop] = value);
},
get: function(Target, prop) {
var value = Target[prop];
if (prop == "send") {
value = function(event) {
var parse = JSON.parse(event);
ClientMsg(parse, Target);
Target.send(event);
};
}
return value;
}
};
var WebSocketProxy = new window.Proxy(window.WebSocket, {
construct: function(Target, args) {
CTS.SocketTarget = new Target(args[0]);
debug("SOCKET::CONNECTING", args[0]);
return new window.Proxy(CTS.SocketTarget, handler);
}
});
window.WebSocket = WebSocketProxy;
}
function ModCommand() {
var name = arguments[1].match(/\!(?:kick|ban|close)\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
if (name !== null) {
var target = UsernameToUser(name[1].toUpperCase());
if (target != -1) { // USER ONLINE
if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
//IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
if (arguments[0] === "stream_moder_close") {
if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
} else {
Send(arguments[0], CTS.UserList[target].handle);
}
} else {
Send("msg", "This users authorization is similar or above yours!");
}
}
}
}
function BotCommand() {
var len = CTS.YouTube.MessageQueueList.length;
if (len <= 0) {
// Moderator Control
if (CTS.UserList[arguments[1]].mod) {
if (arguments[0] == 2) {
if (CTS.YouTube.CurrentTrack.ID !== undefined) {
CTS.YouTube.Clear = true;
YouTubePlayList();
}
}
if (arguments[0] == 5) SetBot(true);
}
// User and Moderator Control
if ((CTS.UserYT && (CTS.BotOPList.includes(CTS.UserList[arguments[1]].username) || CTS.BotOPList.includes("-ALL"))) || CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
if (arguments[0] == 4) YouTubePlayList(true);
if (arguments[0] == 6) {
if (CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
var videoid = arguments[2].match(/http(?:s)?(?:\:\/\/)(?:w{1,3}\.)?(?:youtu(?:\.be|be.com))(?:\/v\/|\/)?(?:watch\?|embed\/|user\/|v\/|\/)(?:v\=)?([a-z0-9\-\_]{1,11})/i);
if (videoid !== null) {
CTS.SocketTarget.send(JSON.stringify({
"tc": "yut_play",
"item": {
"id": videoid[1],
"duration": 7200,
"offset": 0,
"title": "YOUTUBE IS BYPASSED - MODS ONLY"
}
}));
debug("YOUTUBE::LINK BYPASS", videoid[1]);
}
} else {
Send("msg", "Ask a moderator to play your request.");
}
}
if (arguments[0] == 3) {
if (CTS.YouTube.CurrentTrack.ID !== undefined) {
Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
}
}
}
} else {
if (CTS.YouTube.ListBuilt === false) {
Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
} else {
Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
}
}
}
function ServerMsg() {
if (typeof ServerInList[arguments[0].tc] == "function") {
debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
ServerInList[arguments[0].tc](arguments[0]);
}
}
function ClientMsg() {
if (typeof ServerOutList[arguments[0].tc] == "function") {
debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
ServerOutList[arguments[0].tc](arguments[0]);
}
}
function Send() {
ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
if (arguments[1] === undefined) arguments[1] = "Open Request";
debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
}
//GAME FUNCTION
//FISHING BOAT
function FishUpgradeStatus(playerExist, type) {
var msg = "[FISHING BOAT]\n";
if (type != 7) msg += playerExist.Nickname + ":\n";
if (type == 0 || type == 1) msg += "[NET]Lv. " + playerExist.Upgrades.Net + "\n" + ((playerExist.Upgrades.Net >= 10) ? "[MAXED]" : "[COSTS $" + Fish.pricelist(playerExist, 0) + " to UPGRADE]\n\n");
if (type == 0 || type == 2) msg += "[RADAR]Lv. " + playerExist.Upgrades.Radar + "\n" + ((playerExist.Upgrades.Radar >= 20) ? "[MAXED]" : "[COSTS $" + Fish.pricelist(playerExist, 1) + " to UPGRADE]") + "\n\n";
if (type == 0 || type == 3) msg += "[INSURANCE]\n" + ((playerExist.Upgrades.Insurance) ? "[OWNED]" : "[COSTS $" + Fish.pricelist(playerExist, 3) + " per ROUND]") + "\n\n";
if (type == 0 || type == 4) msg += "[SHOP]Lv. " + playerExist.Upgrades.Store + "\n" + ((playerExist.Upgrades.Store >= 6) ? "[MAXED]" : "[COSTS $" + Fish.pricelist(playerExist, 2) + " to UPGRADE]") + "\n\n";
if (type == 6) msg += "HELP:\n!fish\n!fishbank\n!fishsplit user|nick\n!fishgamble\n[COSTS $" + Fish.pricelist(playerExist, 6) + "]\n!fishrob user|nick\n[COSTS $" + Fish.pricelist(playerExist, 4) + "]\n!fishslap user|nick\n[COSTS $" + Fish.pricelist(playerExist, 5) + "]\n!fishupgrade\n!fishupgrade\n[Net|Radar|Insurance|Shop]\n\n";
Send("msg", msg);
}
function FishTimerCheck(playerExist) {
if (new Date() - playerExist.LastCheck >= 5000) {
playerExist.LastCheck = new Date();
return true;
}
return false;
}
function FishCommandCheck() {
var command,
playerExist = Fish.getPlayer(CTS.UserList[arguments[0]].handle, false, true),
FishCommand = arguments[1].match(/^\!(fish(?:rob|slap|split|help|upgrade)?)\s?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
if (FishCommand) {
if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
if (FishCommand[2] !== undefined) {
if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
}
} else {
command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
}
}
}
function FishTransfer(playerExist, target, cost, deduct, rob) {
if (target !== undefined && target !== -1) {
if (playerExist.Points > cost) {
if (rob) {
playerExist.Points -= cost;
if (target.Points <= deduct) {
deduct = target.Points;
target.Points -= deduct;
playerExist.Points += deduct;
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " destroyed " + target.Nickname + "\nMoney made $" + deduct + "!");
Fish.getPlayer(target.Handle, true);
} else {
target.Points -= deduct;
playerExist.Points += deduct;
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " robbed " + target.Nickname + " for $" + deduct + "!");
}
} else {
playerExist.Points = deduct;
target.Points += deduct;
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " split their money with " + target.Nickname + "!");
}
} else {
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " are you kidding me?\nTalk to me when you have money!");
}
}
}
function FishTransaction(playerExist, cost, status) {
if (playerExist.Points > cost) {
playerExist.Points -= cost;
return true;
} else {
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + ", are you kidding me?\nTalk to me when you have money!");
return false;
}
}
//SERVER/CLIENT LIST FUNCTION
var UnicodeConversionList = {
convert: function() {
return this.numerical(arguments[0]).replace(/[A-Za-z]/g, this.alphabet);
},
alphabet: function() {
return String.fromCodePoint(arguments[0].codePointAt(0) + ((/[A-Z]/.test(arguments[0])) ? "𝗔".codePointAt(0) - "A".codePointAt(0) : "𝗮".codePointAt(0) - "a".codePointAt(0)));
},
numerical: function() {
return arguments[0].replace(/\d/g, function(c) {
return String.fromCodePoint(0x1D79E + c.charCodeAt(0));
});
}
};
var CommandList = {
cts: function() {
Alert(GetActiveChat(), "<b style=\"color:#ee3636;\">Owner Commands:</b>\n!raid <b style=\"color:#ffff00;\">tc link</b>\n!closeall\n!kickall\n!version\n\n<b style=\"color:#ee3636;\">Moderator Commands:</b>\n!whoisbot\n!bot\n!bottoggle\n!greenroomtoggle\n!publiccommandtoggle\n!camsweep\n!votetoggle\n!autokick (be careful!)\n!autoban (be careful!)\n\n!ytbypass <b style=\"color:#ffff00;\">link (no playlists)</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytclear\n\n!banlist\n!banlistclear\n!banadd <b style=\"color:#ffff00;\">user | nick</b>\n!banremove <b style=\"color:#ffff00;\">#</b>\n\n!bankeywordlist\n!bankeywordlistclear\n!bankeywordadd <b style=\"color:#ffff00;\">keyword | phrase</b>\n!bankeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!kicklist\n!kicklistclear\n!kickadd <b style=\"color:#ffff00;\">user | nick</b>\n!kickremove <b style=\"color:#ffff00;\">#</b>\n\n!kickkeywordlist\n!kickkeywordlistclear\n!kickkeywordadd <b style=\"color:#ffff00;\">keyword | phrase</b>\n!kickkeywordremove <b style=\"color:#ffff00;\">#</b>\n\n!oplist\n!oplistclear\n!opadd <b style=\"color:#ffff00;\">user | -all</b>\n!opremove <b style=\"color:#ffff00;\">#</b>\n!optoggle\n\n<b style=\"color:#ee3636;\">Jr. Moderator Commands:</b>\n!ban <b style=\"color:#ffff00;\">user | nick</b>\n!kick <b style=\"color:#ffff00;\">user | nick</b>\n!close <b style=\"color:#ffff00;\">user | nick</b>\n\n<b style=\"color:#ee3636;\">User Commands:</b>\n!yt <b style=\"color:#ffff00;\">link | keyword</b>\n!ytskip\n!ytqueue\n\n!mentionlist\n!mentionlistclear\n!mentionadd <b style=\"color:#ffff00;\">keyword</b>\n!mentionremove <b style=\"color:#ffff00;\">#</b>\n\n!ignorelist\n!ignorelistclear\n!ignoreadd <b style=\"color:#ffff00;\">user | nick</b>\n!ignoreremove <b style=\"color:#ffff00;\">#</b>\n\n!greetlist\n!greetlistclear\n!greetadd <b style=\"color:#ffff00;\">user | nick | -all</b>\n!greetremove <b style=\"color:#ffff00;\">#</b>\n\n!ttslist\n!ttslistclear\n!ttsadd <b style=\"color:#ffff00;\">user | nick | -all | -event</b>\n!ttsremove <b style=\"color:#ffff00;\">#</b>\n\n!highlightlist\n!highlightlistclear\n!highlightadd <b style=\"color:#ffff00;\">user | nick</b>\n!highlightremove <b style=\"color:#ffff00;\">#</b>\n\n!reminderlist\n!reminderlistclear\n!reminderadd <b style=\"color:#ffff00;\">user | nick</b>\n!reminderremove <b style=\"color:#ffff00;\">#</b>\n!remindertoggle\n\n!safelist\n!safelistclear\n!safeadd <b style=\"color:#ffff00;\">user</b>\n!saferemove <b style=\"color:#ffff00;\">#</b>\n\n!greenroomlist\n!greenroomlistclear\n!greenroomadd <b style=\"color:#ffff00;\">user</b>\n!greenroomremove <b style=\"color:#ffff00;\">#</b>\n\n!lists\n!listsclear\n\n!greetmode\n!imgurtoggle\n!avatartoggle\n!notificationtoggle <b style=\"color:#ffff00;\"></b>\n!popuptoggle\n!timestamptoggle\n\n!coin\n!advice\n!8ball <b style=\"color:#ffff00;\">question</b>\n!roll <b style=\"color:#ffff00;\">#</b>\n!chuck\n!dad\n\n!vote <b style=\"color:#ffff00;\">user | nick</b>\n\n!clr\n!settings\n!share\n\n<b style=\"color:#ee3636;\">Game Commands:</b>\n!gamehost\n!gameview\n!fish");
},
help: function() {
this.cts();
},
mentionadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
CTS.MentionList.push(arguments[0].toUpperCase());
Save("MentionList", JSON.stringify(CTS.MentionList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
mentionremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.MentionList[arguments[0]] !== undefined) {
CTS.MentionList.splice(arguments[0], 1);
Save("MentionList", JSON.stringify(CTS.MentionList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
mentionlistclear: function() {
CTS.MentionList = [];
Save("MentionList", JSON.stringify(CTS.MentionList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
mentionlist: function() {
Alert(GetActiveChat(), SettingsList.MentionList());
},
ignoreadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
CTS.IgnoreList.push(arguments[0].toUpperCase());
Cameras();
Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
ignoreremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.IgnoreList[arguments[0]] !== undefined) {
CTS.IgnoreList.splice(arguments[0], 1);
Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
ignorelistclear: function() {
CTS.IgnoreList = [];
Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
ignorelist: function() {
Alert(GetActiveChat(), SettingsList.IgnoreList());
},
banadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
CTS.BanList.push(arguments[0].toUpperCase());
Save("BanList", JSON.stringify(CTS.BanList));
Alert(GetActiveChat(), "🗹Command Accepted!");
var check = UsernameToHandle(arguments[0].toUpperCase());
if (check != -1 && CTS.Me.mod) Send("ban", check);
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
banremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.BanList[arguments[0]] !== undefined) {
CTS.BanList.splice(arguments[0], 1);
Save("BanList", JSON.stringify(CTS.BanList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
banlistclear: function() {
CTS.BanList = [];
Save("BanList", JSON.stringify(CTS.BanList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
banlist: function() {
Alert(GetActiveChat(), SettingsList.BanList());
},
kickadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
CTS.KickList.push(arguments[0].toUpperCase());
Save("KickList", JSON.stringify(CTS.KickList));
Alert(GetActiveChat(), "🗹Command Accepted!");
var check = UsernameToHandle(arguments[0].toUpperCase());
if (check != -1 && CTS.Me.mod) Send("kick", check);
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
kickremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.KickList[arguments[0]] !== undefined) {
CTS.KickList.splice(arguments[0], 1);
Save("KickList", JSON.stringify(CTS.KickList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
kicklistclear: function() {
CTS.KickList = [];
Save("KickList", JSON.stringify(CTS.KickList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
kicklist: function() {
Alert(GetActiveChat(), SettingsList.KickList());
},
bankeywordadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
CTS.BanKeywordList.push(arguments[0]);
Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
Alert(GetActiveChat(), "🗹Command Accepted!");
}
},
bankeywordremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.BanKeywordList[arguments[0]] !== undefined) {
CTS.BanKeywordList.splice(arguments[0], 1);
Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
bankeywordlistclear: function() {
CTS.BanKeywordList = [];
Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
bankeywordlist: function() {
Alert(GetActiveChat(), SettingsList.BanKeywordList());
},
kickkeywordadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
CTS.KickKeywordList.push(arguments[0]);
Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
Alert(GetActiveChat(), "🗹Command Accepted!");
}
},
kickkeywordremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.KickKeywordList[arguments[0]] !== undefined) {
CTS.KickKeywordList.splice(arguments[0], 1);
Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
kickkeywordlistclear: function() {
CTS.KickKeywordList = [];
Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
kickkeywordlist: function() {
Alert(GetActiveChat(), SettingsList.KickKeywordList());
},
greetadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserName(arguments[0])) {
CTS.GreetList.push(arguments[0].toUpperCase());
Save("GreetList", JSON.stringify(CTS.GreetList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
greetremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.GreetList[arguments[0]] !== undefined) {
CTS.GreetList.splice(arguments[0], 1);
Save("GreetList", JSON.stringify(CTS.GreetList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
greetlistclear: function() {
CTS.GreetList = [];
Save("GreetList", JSON.stringify(CTS.GreetList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
greetlist: function() {
Alert(GetActiveChat(), SettingsList.GreetList());
},
highlightadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
CTS.HighlightList.push(arguments[0].toUpperCase());
Save("HighlightList", JSON.stringify(CTS.HighlightList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
highlightremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.HighlightList[arguments[0]] !== undefined) {
CTS.HighlightList.splice(arguments[0], 1);
Save("HighlightList", JSON.stringify(CTS.HighlightList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
highlightlistclear: function() {
CTS.HighlightList = [];
Save("HighlightList", JSON.stringify(CTS.HighlightList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
highlightlist: function() {
Alert(GetActiveChat(), SettingsList.HighlightList());
},
opadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserName(arguments[0])) {
CTS.BotOPList.push(arguments[0].toUpperCase());
Save("BotOPList", JSON.stringify(CTS.BotOPList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
opremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.BotOPList[arguments[0]] !== undefined) {
CTS.BotOPList.splice(arguments[0], 1);
Save("BotOPList", JSON.stringify(CTS.BotOPList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
oplistclear: function() {
CTS.BotOPList = [];
Save("BotOPList", JSON.stringify(CTS.BotOPList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
oplist: function() {
Alert(GetActiveChat(), SettingsList.BotOPList());
},
modadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
CTS.BotModList.push(arguments[0].toUpperCase());
Save("BotModList", JSON.stringify(CTS.BotModList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
modremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.BotModList[arguments[0]] !== undefined) {
CTS.BotModList.splice(arguments[0], 1);
Save("BotModList", JSON.stringify(CTS.BotModList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
modlistclear: function() {
CTS.BotModList = [];
Save("BotModList", JSON.stringify(CTS.BotModList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
modlist: function() {
Alert(GetActiveChat(), SettingsList.BotModList());
},
ttsadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
CTS.TTSList.push(arguments[0].toUpperCase());
Save("TTSList", JSON.stringify(CTS.TTSList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
ttsremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.TTSList[arguments[0]] !== undefined) {
CTS.TTSList.splice(arguments[0], 1);
Save("TTSList", JSON.stringify(CTS.TTSList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
ttslistclear: function() {
CTS.TTSList = [];
Save("TTSList", JSON.stringify(CTS.TTSList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
ttslist: function() {
Alert(GetActiveChat(), SettingsList.TTSList());
},
reminderadd: function() {
if (arguments[0] === "") {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9])\s?(?:[AaPp][Mm]))\s(.*)/);
if (reminder === null) {
Alert(GetActiveChat(), "🗷Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
} else {
CTS.ReminderList.push([reminder[1], reminder[2]]);
Save("ReminderList", JSON.stringify(CTS.ReminderList));
Alert(GetActiveChat(), "🗹Command Accepted!");
Reminder();
}
}
},
reminderremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.ReminderList[arguments[0]] !== undefined) {
CTS.ReminderList.splice(arguments[0], 1);
Save("ReminderList", JSON.stringify(CTS.ReminderList));
Reminder();
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
reminderlistclear: function() {
CTS.ReminderList = [];
Save("ReminderList", JSON.stringify(CTS.ReminderList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
reminderlist: function() {
Alert(GetActiveChat(), SettingsList.ReminderList());
},
remindertoggle: function() {
CTS.Reminder = !CTS.Reminder;
Save("Reminder", JSON.stringify(CTS.Reminder));
Reminder();
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
},
timestamptoggle: function() {
CTS.TimeStampToggle = !CTS.TimeStampToggle;
Save("TimeStampToggle", JSON.stringify(CTS.TimeStampToggle));
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.TimeStampToggle) ? "Timestamps are now on!\n" : "Timestamps are now off\n "));
},
safeadd: function() {
if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
if (!CTS.SafeList.includes(arguments[0].toUpperCase())) {
CTS.SafeList.push(arguments[0].toUpperCase());
Save("AKB", JSON.stringify(CTS.SafeList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Name already exists!");
}
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
saferemove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.SafeList[arguments[0]] !== undefined) {
CTS.SafeList.splice(arguments[0], 1);
Save("AKB", JSON.stringify(CTS.SafeList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
safelistclear: function() {
CTS.SafeList = [];
Save("AKB", JSON.stringify(CTS.SafeList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
safelist: function() {
Alert(GetActiveChat(), SettingsList.SafeList());
},
greenroomadd: function() {
if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CheckUserNameStrict(arguments[0])) {
if (!CTS.GreenRoomList.includes(arguments[0].toUpperCase())) {
CTS.GreenRoomList.push(arguments[0].toUpperCase());
Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Name already exists!");
}
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
}
}
},
greenroomremove: function() {
if (arguments[0] === "" || isNaN(arguments[0])) {
Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
} else {
if (CTS.GreenRoomList[arguments[0]] !== undefined) {
CTS.GreenRoomList.splice(arguments[0], 1);
Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
Alert(GetActiveChat(), "🗹Command Accepted!");
} else {
Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
}
}
},
greenroomlistclear: function() {
CTS.GreenRoomList = [];
Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
Alert(GetActiveChat(), "🗹Command Accepted!");
},
greenroomlist: function() {
Alert(GetActiveChat(), SettingsList.GreenRoomList());
},
optoggle: function() {
CTS.UserYT = !CTS.UserYT;
Save("UserYT", JSON.stringify(CTS.UserYT));
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
},
avatartoggle: function() {
CTS.Avatar = !CTS.Avatar;
Save("Avatar", JSON.stringify(CTS.Avatar));
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
},
popuptoggle: function() {
CTS.Popups = !CTS.Popups;
Save("Popups", JSON.stringify(CTS.Popups));
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
},
notificationtoggle: function() {
if (!CTS.Project.isTouchScreen) {
CTS.NotificationToggle++;
if (CTS.NotificationToggle >= 3) CTS.NotificationToggle = 0;
Save("NotificationToggle", JSON.stringify(CTS.NotificationToggle));
NotificationDisplay();
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\nNotifications " + ((CTS.NotificationToggle==0) ? "above chat enabled" : (CTS.NotificationToggle==1)?"in chat enabled":"disabled")+".");
}
},
greetmode: function() {
CTS.GreetMode = !CTS.GreetMode;
Save("GreetMode", JSON.stringify(CTS.GreetMode));
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
},
imgurtoggle: function() {
CTS.imgur = !CTS.imgur;
Save("imgur", JSON.stringify(CTS.imgur));
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
},
publiccommandtoggle: function() {
CTS.PublicCommandToggle = !CTS.PublicCommandToggle;
Save("PublicCommandToggle", JSON.stringify(CTS.PublicCommandToggle));
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.PublicCommandToggle) ? "Public commands (8Ball, Advice, Chuck, Coin, Dad, Urb) are enabled." : "Public commands (8Ball, Advice, Chuck, Coin, Dad, Urb) are disabled."));
},
greenroomtoggle: function() {
CTS.GreenRoomToggle = !CTS.GreenRoomToggle;
Save("GreenRoomToggle", JSON.stringify(CTS.GreenRoomToggle));
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreenRoomToggle) ? "Green Room Auto Allow ON!" : "Green Room Auto Allow OFF!"));
},
clr: function() {
CTS.MessageCallback = [];
CTS.Message = [];
CTS.Message[0] = [];
window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
},
autokick: function() {
if (arguments[1] === false && CTS.Me.mod) {
CTS.AutoKick = !CTS.AutoKick;
CTS.AutoBan = false;
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
if (CTS.AutoKick === true) CheckUserListSafe("kick");
}
},
autoban: function() {
if (arguments[1] === false && CTS.Me.mod) {
CTS.AutoBan = !CTS.AutoBan;
CTS.AutoKick = false;
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
if (CTS.AutoBan === true) CheckUserListSafe("ban");
}
},
camsweep: function() {
if (CTS.Me.mod && CTS.Host === CTS.Me.handle) {
CTS.Camera.SweepTimer = arguments[0] === "" || isNaN(arguments[0]) ? 5 : (arguments[0] > 30) ? 30 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
CTS.Camera.Sweep = !CTS.Camera.Sweep;
clearTimeout(CTS.Camera.clearRandom);
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Camera.Sweep) ? "Camera sweep is now on!\nTime set: " + CTS.Camera.SweepTimer + "min(s)" : "Camera sweep is now off!"));
}
},
bottoggle: function() {
CTS.Bot = !CTS.Bot;
Save("Bot", JSON.stringify(CTS.Bot));
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
},
votetoggle: function() {
if (CTS.Me.mod) {
CTS.VoteSystem = !CTS.VoteSystem;
CTS.WaitToVoteList = [];
var len = CTS.UserList.length;
if (len > 0) {
for (var i = 0; i < len; i++) CTS.UserList[i].vote = 0;
}
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.VoteSystem) ? "VOTING IS NOW ON!" : "VOTING IS NOW OFF!"));
}
},
bot: function() {
if (arguments[1] === false && CTS.Me.mod) Alert(0, "🗹Command Accepted!\nBot bypass was called!");
},
share: function() {
var msg = "CosmosisT's TinyChat Script:\nInstall...\n1. (Tamper Monkey Link)\nhttps://www.tampermonkey.net/\n2. (CTS Link)\nhttps://greasyfork.org/en/scripts/392086\nCTS Discord:\nhttps://discord.gg/cHEf8z7";
if (GetActiveChat() !== 0) {
Send("pvtmsg", msg, GetActiveChat());
PushPM(GetActiveChat(), msg);
} else {
Send("msg", msg);
}
},
gameview: function() {
CTS.CanSeeGames = !CTS.CanSeeGames;
Save("CanSeeGames", JSON.stringify(CTS.CanSeeGames));
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
},
gamehost: function() {
CTS.CanHostGames = !CTS.CanHostGames;
Save("CanHostGames", JSON.stringify(CTS.CanHostGames));
Fish.reset(true, true);
Settings();
Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanHostGames) ? "GAME HOSTING IS NOW ON!" : "GAME HOSTING IS NOW OFF!"));
},
version: function() {
if (!CTS.Me.owner) {
var msg = "I am using " + CTS.Project.Name + "v" + Ver();
if (GetActiveChat() !== 0) {
Send("pvtmsg", msg, GetActiveChat());
PushPM(GetActiveChat(), msg);
} else {
Send("msg", msg);
}
}
},
roll: function() {
var dice,
msg = "";
dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
for (var i = 0; i < dice; i++) msg += Dice();
if (GetActiveChat() !== 0) {
Send("pvtmsg", msg, GetActiveChat());
PushPM(GetActiveChat(), msg);
} else {
Send("msg", msg);
}
},
coin: function() {
if (CTS.Host == 0 || GetActiveChat() !== 0) {
var msg = "The coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!";
if (GetActiveChat() !== 0) {
Send("pvtmsg", msg, GetActiveChat());
} else {
Send("msg", msg);
}
}
},
settings: function() {
Settings();
},
lists: function() {
Alert(GetActiveChat(), SettingsList.BanList() + SettingsList.BanKeywordList() + SettingsList.KickList() + SettingsList.KickKeywordList() + SettingsList.BotOPList() + SettingsList.BotModList() + SettingsList.MentionList() + SettingsList.IgnoreList() + SettingsList.GreetList() + SettingsList.TTSList() + SettingsList.HighlightList() + SettingsList.ReminderList());
},
listsclear: function() {
CTS.MentionList = [];
CTS.IgnoreList = [];
CTS.BanList = [];
CTS.KickList = [];
CTS.BanKeywordList = [];
CTS.KickKeywordList = [];
CTS.GreetList = [];
CTS.HighlightList = [];
CTS.ReminderList = [];
CTS.TTSList = [];
CTS.BotOPList = [];
CTS.BotModList = [];
Save("MentionList", JSON.stringify(CTS.MentionList));
Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
Save("BanList", JSON.stringify(CTS.BanList));
Save("KickList", JSON.stringify(CTS.KickList));
Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
Save("GreetList", JSON.stringify(CTS.GreetList));
Save("HighlightList", JSON.stringify(CTS.HighlightList));
Save("ReminderList", JSON.stringify(CTS.ReminderList));
Save("TTSList", JSON.stringify(CTS.TTSList));
Save("BotModList", JSON.stringify(CTS.BotModList));
Save("BotOPList", JSON.stringify(CTS.BotOPList));
Alert(GetActiveChat(), "🗹Command Accepted!\nItems Mentionlist, igore");
},
ytqueue: function() {},
ytclear: function() {},
ytskip: function() {},
yt: function() {},
ytbypass: function() {}
};
var SettingsList = {
BanList: function() {
var index,
msg,
len = CTS.BanList.length;
msg = "<b style=\"color:#ee3636;\"><u>Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.BanList[index] + "\n";
return msg;
},
BanKeywordList: function() {
var index,
msg,
len = CTS.BanKeywordList.length;
msg = "<b style=\"color:#ee3636;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
return msg;
},
KickList: function() {
var index,
msg,
len = CTS.KickList.length;
msg = "<b style=\"color:#ee3636;\"><u>Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.KickList[index] + "\n";
return msg;
},
KickKeywordList: function() {
var index,
msg,
len = CTS.KickKeywordList.length;
msg = "<b style=\"color:#ee3636;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
return msg;
},
BotOPList: function() {
var index,
msg,
len = CTS.BotOPList.length;
msg = "<b style=\"color:#ee3636;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
return msg;
},
BotModList: function() {
var index,
msg,
len = CTS.BotModList.length;
msg = "<b style=\"color:#ee3636;\"><u>Bot Mod list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.BotModList[index] + "\n";
return msg;
},
MentionList: function() {
var index,
msg,
len = CTS.MentionList.length;
msg = "<b style=\"color:#ee3636;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
return msg;
},
IgnoreList: function() {
var index,
msg,
len = CTS.IgnoreList.length;
msg = "<b style=\"color:#ee3636;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
return msg;
},
GreetList: function() {
var index,
msg,
len = CTS.GreetList.length;
msg = "<b style=\"color:#ee3636;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
return msg;
},
TTSList: function() {
var index,
msg,
len = CTS.TTSList.length;
msg = "<b style=\"color:#ee3636;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
return msg;
},
HighlightList: function() {
var index,
msg,
len = CTS.HighlightList.length;
msg = "<b style=\"color:#ee3636;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
return msg;
},
ReminderList: function() {
var index,
msg,
len = CTS.ReminderList.length;
msg = "<b style=\"color:#ee3636;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
return msg;
},
SafeList: function() {
var index,
msg,
len = CTS.SafeList.length;
msg = "<b style=\"color:#ee3636;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
return msg;
},
GreenRoomList: function() {
var index,
msg,
len = CTS.GreenRoomList.length;
msg = "<b style=\"color:#ee3636;\"><u>Green Room list:</u></b>\n" + ((!len) ? "empty\n" : "");
for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomList[index] + "\n";
return msg;
}
};
var MessageQueueList = {
add: function() {
CTS.SendQueue.push(arguments[0]);
MessageQueueList.run();
},
run: function() {
if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
setTimeout(function() {
var temp = new Date();
var OffsetTime = temp - CTS.LastMessage;
if (OffsetTime >= 1500) {
CTS.LastMessage = new Date();
CTS.SocketTarget.send(CTS.SendQueue[0]);
CTS.SendQueue.shift();
}
MessageQueueList.run();
}, 1600, CTS.LastMessage);
}
}
};
var ServerSendList = {
msg: function() {
var obj = {
"tc": arguments[0]
};
if (arguments[2] !== undefined) {
obj.handle = arguments[1];
CTS.SocketTarget.send(JSON.stringify(obj));
} else {
if (arguments[1] !== undefined) {
obj.text = arguments[1];
MessageQueueList.add(JSON.stringify(obj));
} else {
CTS.SocketTarget.send(JSON.stringify(obj));
}
}
},
pvtmsg: function() {
var obj = {
"tc": arguments[0],
"text": arguments[1],
"handle": Number(arguments[2])
};
MessageQueueList.add(JSON.stringify(obj));
},
kick: function() {
CheckSafeList(arguments[1], true);
ServerSendList.msg(arguments[0], arguments[1], "kick");
},
ban: function() {
CheckSafeList(arguments[1], true);
ServerSendList.msg(arguments[0], arguments[1], "ban");
},
nick: function() {
var obj = {
"tc": "nick",
"nick": arguments[1]
};
CTS.SocketTarget.send(JSON.stringify(obj));
},
stream_moder_close: function() {
CheckSafeList(arguments[1], true);
ServerSendList.msg(arguments[0], arguments[1], "stream_moder_close");
},
stream_moder_allow: function() {
ServerSendList.msg(arguments[0], arguments[1], "stream_moder_allow");
},
yut_playlist_add: function() {
var obj = {
"tc": arguments[0],
"item": {
"id": arguments[1][0],
"duration": arguments[1][1] + 10,
"title": arguments[1][2],
"image": arguments[1][3]
}
};
if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
CTS.SocketTarget.send(JSON.stringify(obj));
},
yut_playlist_remove: function() {
ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
},
yut_stop: function() {
ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
},
yut_play: function() {
ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
},
yut_playlist: function() {
ServerSendList.msg("yut_playlist");
},
yut_playlist_clear: function() {
ServerSendList.msg("yut_playlist_clear");
}
};
var ServerInList = {
joined: function() {
debug();
CTS.Me = {
"handle": arguments[0].self.handle,
"username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
"nick": arguments[0].self.nick,
"owner": arguments[0].self.owner,
"mod": arguments[0].self.mod,
"namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
"avatar": arguments[0].self.avatar
};
if (CTS.Me.nick.match(/^guest(?:\-[0-9]{1,10})?/i) && CTS.Me.username !== "GUEST") Send("nick", CTS.Me.username); //AUTO CORRECT NAME
CTS.Room = {
"Avatar": arguments[0].room.avatar,
"Bio": arguments[0].room.biography,
"Name": arguments[0].room.name,
"PTT": arguments[0].room.pushtotalk,
"Website": arguments[0].room.website,
"YT_ON": arguments[0].room.youtube_enabled,
"Recent_Gifts": arguments[0].room.recent_gifts
};
CTS.SocketConnected = true;
},
userlist: function() {
var len = arguments[0].users.length;
for (var user = 0; user < len; user++) {
AKBS(arguments[0].users[user]);
var username = (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase();
CheckUserAbuse(arguments[0].users[user].handle, username, arguments[0].users[user].nick.toUpperCase());
CTS.UserList.push({
"handle": arguments[0].users[user].handle,
"username": username,
"nick": arguments[0].users[user].nick,
"owner": arguments[0].users[user].owner,
"mod": arguments[0].users[user].mod,
"namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
"avatar": (arguments[0].users[user].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].users[user].avatar,
"canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
"broadcasting": false,
"vote": 0
});
}
RoomUsers();
},
join: function() {
AKBS(arguments[0]);
var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
CheckUserAbuse(arguments[0].handle, user, arguments[0].nick.toUpperCase());
if (CTS.HighlightList.includes(user) || CTS.HighlightList.includes(arguments[0].nick.toUpperCase())) {
if (CTS.enableSound === true) window.CTSSound.HIGHLIGHT.play();
}
if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
CTS.hasGreetedWC = true;
if (CTS.enableSound === true) window.CTSSound.C.play();
Send("msg", UnicodeConversionList.convert("HI! " + arguments[0].nick.toUpperCase()) + "!");
} else {
if ((CTS.GreetList.includes(user) || CTS.GreetList.includes(arguments[0].nick.toUpperCase()) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
Send("msg", UnicodeConversionList.convert(((window.CTSWelcomes[Rand(0, window.CTSWelcomes.length - 1)] + arguments[0].nick.toUpperCase()) + ((CTS.GreetMode) ? ".\n" + (((user != "GUEST") ? "You are signed in as " + user : "You are not signed in") + ".\nWelcome to the room!") : "!"))));
if (CTS.enableSound === true) window.CTSSound.GREET.play();
}
}
CTS.NoGreet = false;
AddUser(arguments[0].handle, arguments[0].mod, window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)], (arguments[0].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].avatar, arguments[0].nick, user, ((user !== "GUEST") ? true : false), arguments[0].owner);
RoomUsers();
},
sysmsg: function() {
if (CTS.Me.mod) {
var action = arguments[0].text.match(/^([a-z0-9_]{1,32}):?\s(closed|banned|kicked)\s([a-z0-9_]{1,32})$/i);
if (action !== null) {
var user;
if (action[2] == "closed" || action[2] == "banned" || action[2] == "kicked") {
user = NicknameToAccount(action[3].toUpperCase());
if (user != -1) {
var a = CTS.GreenRoomList.indexOf(CTS.UserList[user].username);
if (a !== -1) {
//REMOVE
debug("GREENROOMLIST::", "REMOVE USER " + CTS.UserList[user].username + " FROM GREENROOMLIST");
Alert(GetActiveChat(), "🗹Removing "+CTS.UserList[user].username+" from greenroomlist!");
CommandList.greenroomremove(a);
}
}
}
}
}
AddSystemNotification(HTMLtoTXT(arguments[0].text));
},
nick: function() {
var user = User(arguments[0].handle);
if (user != -1) {
AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
if ((CTS.GreetList.includes(CTS.UserList[user].username) || CTS.GreetList.includes(CTS.UserList[user].nick.toUpperCase()) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
Send("msg", UnicodeConversionList.convert(CTS.UserList[user].nick + "\nwith the account name " + CTS.UserList[user].username + " changed their name to " + arguments[0].nick));
if (CTS.enableSound === true) window.CTSSound.GREET.play();
}
CTS.UserList[user].nick = arguments[0].nick;
if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
}
},
stream_connected: function() {
if (CTS.Host === CTS.Me.handle && CTS.GreenRoomToggle) {
if (arguments[0].publish == false) {
if (CTS.Me.handle !== arguments[0].handle) {
if (!CTS.Camera.List.includes(arguments[0].handle)) {
//USER IS NOT ON CAMERA START AUTO ACCEPT PROCESS
var user = User(arguments[0].handle);
if (user != -1) {
debug("CAMERA::WAITING", "nickname:" + CTS.UserList[user].nick);
if (CTS.GreenRoomList.includes(CTS.UserList[user].username)) Send("stream_moder_allow", CTS.UserList[user].handle);
}
}
}
}
}
debug();
},
stream_closed: function() {
debug();
},
publish: function() { //ADD GLOBAL CAMERA
CheckUserStream(arguments[0].handle, true);
},
unpublish: function() { //REMOVE GLOBAL CAMERA
CheckUserStream(arguments[0].handle, false);
},
ping: function() {
debug();
if (CTS.ScriptInit) {
var verify;
if (CTS.WatchList.length > 0) {
verify = new Date() - CTS.WatchList[0][2];
debug("WATCHLIST::LIST", CTS.WatchList);
debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/600000");
if (CTS.SafeList.indexOf(CTS.WatchList[0][0]) === -1) { //LET'S NOT ADD TWICE
if (verify > 600000) {
debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/600000");
CTS.SafeList.push(CTS.WatchList[0][0]);
CTS.WatchList.shift();
}
} else {
CTS.WatchList.shift();
}
}
if (CTS.WaitToVoteList.length > 0) {
verify = new Date() - CTS.WaitToVoteList[0][1];
debug("VOTE::LIST", CTS.WaitToVoteList);
debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
if (verify > 300000) {
debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
CTS.WaitToVoteList.shift();
}
}
}
//DISPOSE OF ITEMS
window.TinychatApp.getInstance().defaultChatroom.packetWorker.queue = {};
},
quit: function() {
if (CTS.ScriptInit) {
if (CTS.WatchList.length > 0) {
var len = CTS.WatchList.length;
for (var i = 0; i < len; i++) {
if (CTS.WatchList[i][1] == arguments[0].handle) {
CTS.WatchList.splice(i, 1);
break;
}
}
}
if (CTS.Me.mod) RemoveUserCamera(arguments[0].handle);
var user = User(arguments[0].handle);
if (user != -1) {
if (CTS.Me.handle === CTS.Host) {
if (Fish.getPlayer(arguments[0].handle, true, false)) {
Send("msg", CTS.Game.Fish.UserQuitLast + ", has slipped off the boat; I don't think we should look back.");
}
}
//SEND THEM OUT
AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
CTS.UserList.splice(user, 1);
}
RoomUsers();
if (CTS.Host == arguments[0].handle) {
CTS.Host = 0;
CTS.Camera.Sweep = false;
if (CTS.Me.mod && CTS.Bot) {
setTimeout(function(handle) {
if (CTS.Host == 0) SetBot(false);
}, (Rand(10, 30) * 1000), arguments[0].handle);
}
}
}
},
msg: function() {
if (CTS.ScriptInit) {
var user = User(arguments[0].handle);
if (user != -1) {
if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
var text = HTMLtoTXT(arguments[0].text);
//ALL USERS REPORT
OwnerCommand(user, arguments[0].text);
BotCheck(user, text, arguments[0]);
//MODERATORS
if (CTS.Me.mod) {
if (CTS.Host == CTS.Me.handle) BotCommandCheck(user, text);
CheckUserWordAbuse(user, arguments[0].text);
}
if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
//PUSH MESSAGE
CTS.Message[0].push({
"time": Time(),
"namecolor": CTS.UserList[user].namecolor,
"avatar": CTS.UserList[user].avatar,
"username": CTS.UserList[user].username,
"nick": CTS.UserList[user].nick,
"msg": CheckImgur(text),
"mention": false
});
var msg = CTS.Message[0][CTS.Message[0].length - 1];
if (CTS.Me.handle !== arguments[0].handle) {
if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
Alert(GetActiveChat(), "🗹AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
CTS.AutoKick = false;
CTS.AutoBan = false;
}
if (CTS.enableSound === true) {
if (CTS.UserList.length <= 14) window.CTSSound.MSG.play();
if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username) || CTS.TTSList.includes(CTS.UserList[user].nick.toUpperCase()) || CTS.TTSList.includes("-ALL"))) TTS(CTS.UserList[user].nick + ((!text.match(/(?:^\!)|(?:https?|www|\uD83C\uDFB5)/gim)) ? " said, " + text : "is box banging!"));
}
var len = CTS.MentionList.length;
for (var i = 0; i < len; i++) {
if (text.toUpperCase().includes(CTS.MentionList[i])) {
if (CTS.enableSound === true) window.CTSSound.MENTION.play();
msg.mention = true;
AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
}
}
}
if (GetActiveChat() === 0) CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
MessagePopUp(user, text, true, false);
}
}
} else {
if (CTS.Me.mod) Send("kick", arguments[0].handle);
}
}
}
},
pvtmsg: function() {
if (CTS.ScriptInit) {
if (CTS.enablePMs === true) {
if (arguments[0].handle != CTS.Me.handle) {
var user = User(arguments[0].handle);
if (user != -1) {
if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
var text = arguments[0].text;
if (CTS.Me.mod) CheckUserWordAbuse(user, arguments[0].text);
if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
PushPM(arguments[0].handle, text, user);
if (CTS.enableSound === true) {
window.CTSSound.PVTMSG.play();
if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes(CTS.UserList[user].username) || CTS.TTSList.includes(CTS.UserList[user].nick.toUpperCase()) || CTS.TTSList.includes("-ALL"))) TTS(CTS.UserList[user].nick + ((!text.match(/(?:^\!)|(?:https?|www)/gim)) ? " said, " + text : "is box banging!"));
}
MessagePopUp(user, CheckImgur(HTMLtoTXT(text)), false, false);
}
}
} else {
if (CTS.Me.mod) Send("kick", arguments[0].handle);
}
}
}
}
}
},
gift: function(parse) {
window.DebugClear = false;
Alert(GetActiveChat(), "USER HAS SENT A GIFT--CHECK PACKET OUT!!!\n");
//coming soon a handler near you! :D
console.log(parse);
},
yut_playlist_add: function() {
if (CTS.ScriptInit) {
if (!CTS.YouTube.Playing) {
if (CTS.PlayListStart === true) CTS.PlayListStart = false;
if (CTS.Host != CTS.Me.handle) {
Send("msg", "!play");
} else {
YouTubePlayList();
}
}
}
},
yut_playlist: function() {
if (CTS.ScriptInit) {
if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
if (CTS.YouTube.Clear === true) {
if (arguments[0].items !== null) Send("yut_playlist_clear");
CTS.YouTube.MessageQueueList = [];
Send("msg", "🎵YouTube cleared!🎵");
CTS.YouTube.Clear = false;
} else {
if (arguments[0].items === null) {
CTS.PlayListStart = true;
} else {
CTS.YouTube.PlayListCount = arguments[0].items.length;
CTS.PlayListStart = false;
if (CTS.YouTube.ShowQueue === true) {
var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
for (var i = 0; i < 3; i++) {
if (arguments[0].items[i] === undefined) break;
msg = msg + "\n" + (i + 1) + ": " + arguments[0].items[i].title + "\n[" + Math.floor(arguments[0].items[i].duration / 60) + "M" + (arguments[0].items[i].duration % 60) + "S]";
}
Send("msg", msg);
}
}
if (arguments[0].items !== null && CTS.Host == CTS.Me.handle && CTS.YouTube.Playing === false) CheckYouTube("https://www.youtube.com/watch?v=" + arguments[0].items[0].id, false);
}
CTS.YouTube.ShowQueue = false;
}
}
},
yut_play: function() {
if (CTS.ScriptInit) {
if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
}
CTS.YouTube.Playing = true;
YouTubePlayList();
}
},
yut_stop: function() {
if (CTS.ScriptInit) {
CTS.YouTube.CurrentTrack.ID = undefined;
CTS.YouTube.CurrentTrack.duration = undefined;
CTS.YouTube.CurrentTrack.title = undefined;
CTS.YouTube.CurrentTrack.thumbnail = undefined;
CTS.YouTube.Playing = false;
YouTubePlayList();
}
}
};
var ServerOutList = {
pvtmsg: function() {
if (CTS.ScriptInit) {
Command(arguments[0].text, true);
var text = arguments[0].text;
if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
PushPM(arguments[0].handle, text);
}
},
msg: function() {
if (CTS.ScriptInit) {
CTS.LastMessage = new Date();
Command(arguments[0].text, false);
}
},
ban: function() {
CheckSafeList(arguments[0].handle, true);
},
kick: function() {
CheckSafeList(arguments[0].handle, true);
},
stream_moder_close: function() {
CheckSafeList(arguments[0].handle, true);
}
};
//ADDON
var Addon = {
active: function() {
if (window.CTSAddon !== undefined) {
if (window.CTSAddon[arguments[0]] !== undefined) {
return true;
}
}
return false;
},
get: function() {
return window.CTSAddon[arguments[0]];
}
};
//XMLHttpRequest
CTS.YouTube.XHR.onload = function() {
var response = JSON.parse(CTS.YouTube.XHR.responseText);
if (response.error) {
Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
} else {
if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
CTS.YouTube.ListBuilt = true;
Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
CTS.YouTube.DataReady = true;
CTS.YouTube.Busy = false;
YouTubeTrackAdd();
}
CTS.YouTube.DataReady = false;
if (response.items[0]) {
CTS.YouTube.Busy = true;
if (response.items[0].id) {
if (response.kind == "youtube#playlistItemListResponse") {
YouTubePlayListItems(response.items);
} else {
CTS.YouTube.VideoID = response.items[0].id.videoId;
CTS.YouTube.XHR.open("GET", "https://www.googleapis.com/youtube/v3/videos?id=" + CTS.YouTube.VideoID + "&type=video&eventType=completed&part=contentDetails,snippet&fields=items/snippet/title,items/snippet/thumbnails/medium,items/contentDetails/duration&eventType=completed&key=" + CTS.YouTube.API_KEY);
CTS.YouTube.XHR.send();
}
} else if (response.items[0].contentDetails.duration) {
CTS.YouTube.DataReady = true;
}
if (CTS.YouTube.DataReady === false) {
CTS.YouTube.Busy = false;
if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
if (response.kind == "youtube#playlistItemListResponse") {
CTS.YouTube.ListBuilt = true;
Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
CTS.YouTube.Busy = false;
}
} else {
CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
if (CTS.YouTube.Playing === true) {
MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
Send("yut_playlist_add", [CTS.YouTube.VideoID, YouTubeTimeConvert(response.items[0].contentDetails.duration), ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), (response.items[0] === undefined) ? response.items.snippet.thumbnails.medium.url : response.items[0].snippet.thumbnails.medium.url]);
CTS.YouTube.Busy = false;
} else {
if (response.items[0].snippet.title !== undefined) {
Send("yut_play", [CTS.YouTube.VideoID, YouTubeTimeConvert(response.items[0].contentDetails.duration), response.items[0].snippet.title, response.items[0].snippet.thumbnails.medium.url, 0]);
Send("yut_playlist_remove", [CTS.YouTube.XHR.videoid, YouTubeTimeConvert(response.items[0].contentDetails.duration), response.items[0].snippet.title, response.items[0].snippet.thumbnails.medium.url]);
CTS.YouTube.Playing = true;
}
CTS.YouTube.Busy = false;
}
}
}
if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
var title = "";
CTS.YouTube.SearchReturn = false;
CTS.YouTube.VideoReturn = false;
if (response.items[0] !== undefined) {
if (response.items[0].length > 0) title = response.items[0].snippet.title;
}
if (response.items !== undefined) {
if (response.items.length > 0) title = response.items[0].snippet.title;
}
Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
}
if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
}
};
//Chuck Norris Jokes API (https://api.chucknorris.io/)
CTS.Chuck.XHR.onload = function() {
var resp = JSON.parse(CTS.Chuck.XHR.responseText),
msg = "[CHUCK NORRIS]\n" + resp.value;
if (resp !== null) Send("msg", msg.substr(0, 499));
};
//https://api.Urb.com/
CTS.Urb.XHR.onload = function() {
var resp = JSON.parse(CTS.Urb.XHR.responseText),
msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
if (resp !== null) Send("msg", msg.substr(0, 499));
};
//icanhazdadjoke API (https://icanhazdadjoke.com/)
CTS.Dad.XHR.onload = function() {
var resp = JSON.parse(CTS.Dad.XHR.responseText),
msg = "[DAD JOKE]\n" + resp.joke;
if (resp !== null) Send("msg", msg.substr(0, 499));
};
//adviceslip API (https://api.adviceslip.com/advice)
CTS.Advice.XHR.onload = function() {
var resp = JSON.parse(CTS.Advice.XHR.responseText),
msg = "[ADVICE]\n" + resp.slip.advice;
if (resp !== null) Send("msg", msg.substr(0, 499));
};
//GAME LIST FUNCTION
var Fish = {
//INIT
init: function() {
if (CTS.Me.handle == CTS.Host && CTS.CanHostGames === true) {
Send("msg", "[FISH]\n!fish at any time and upgrade your way up!\n\n!gameview to show/hide game.\n\nRemember there's a five second delay for all commands, don't spam!\nFor commands type !fishhelp!");
CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
g.cast();
}, 5000, this);
}
},
//PLAYERS
addPlayer: function(handle, username, nickname) {
if (!this.getPlayer(handle, false, false) && CTS.CanHostGames === true) {
if (isSafeListed(username)) {
CTS.Game.Fish.Player.push({
Handle: handle,
Username: username,
Nickname: nickname,
LastCheck: new Date() - 5000,
Points: 5000,
Upgrades: {
Net: 1,
Store: 1,
Radar: 1,
Insurance: false
},
});
Send("msg", "[FISHING BOAT]\n" + nickname.substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
if (this.getPlayer() == 0) this.init();
}
}
},
getPlayer: function(handle, del, exists) {
var len = CTS.Game.Fish.Player.length;
if (handle !== undefined) {
for (var player = 0; player < len; player++) {
if (CTS.Game.Fish.Player[player].Handle == handle) {
if (exists) return CTS.Game.Fish.Player[player];
if (del) {
CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
CTS.Game.Fish.Player.splice(player, 1);
}
if (!exists) return true;
}
}
if (!exists) {
return false;
} else {
return -1;
}
} else {
return len - 1;
}
},
listPlayers: function() {
var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
place = 0;
for (var u = arguments[0]; u >= 0; u--) {
place++;
if (u < 5) {
msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
}
CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
CTS.Game.Fish.Player[u].Points += 10000;
}
Send("msg", msg);
},
winner: function() {
CTS.Game.Fish.Player.sort(function(a, b) {
return a.Points - b.Points;
});
if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
}
var len = CTS.Game.Fish.Player.length - 1;
Send("msg", "[FISHING BOAT HIGH SCORE]\nHIGH SCORE:\n" + CTS.Game.Fish.HighScore[0] + " : $" + CTS.Game.Fish.HighScore[1] + "\n\nROUND WINNER:\n" + CTS.Game.Fish.Player[len].Nickname + " : $" + CTS.Game.Fish.Player[len].Points + "!\n\nNext round will start in thirty seconds!");
this.listPlayers(len);
CTS.Game.Fish.RestockTimeout = setTimeout(function(g) {
g.reset(false, true);
}, 30000, this);
},
//PRICELIST
pricelist: function(playerExist, item) {
if (item == 0) { // net
return (1000 * playerExist.Upgrades.Net * playerExist.Upgrades.Net * playerExist.Upgrades.Net);
} else if (item == 1) { // radar
return (1000 * playerExist.Upgrades.Radar * 2) + 3500;
} else if (item == 2) { // shop
return (playerExist.Upgrades.Store * playerExist.Upgrades.Store * 25000);
} else if (item == 3) { // insurance
return (20000);
} else if (item == 4) { // rob
return (10000);
} else if (item == 5) { // slap
return (50000);
} else if (item == 6) { // split (min$) / gamble
return (1000);
}
},
//GAMEPLAY
cast: function() {
clearTimeout(CTS.Game.Fish.StartTimeout);
if (CTS.Host === CTS.Me.handle) {
if (this.getPlayer() >= 0) {
if (CTS.Game.Fish.Round < 10) {
CTS.Game.Fish.Round++;
var playerlen,
fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
id,
type,
handle,
eliminate = false,
msgeliminate,
value,
msg = "[FISHING BOAT]\n";
for (var cast = 0; cast <= 2; cast++) {
playerlen = this.getPlayer();
id = Rand(0, playerlen);
type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
if (Rand(0, 100) <= Rand(10, 70)) {
var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
CTS.Game.Fish.Player[id].Points += value;
msg += (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...[$" + CTS.Game.Fish.Player[id].Points + "]:\n🗹" + net + " x " + CTS.Game.Fish.TypesOfFish[type][0] + " +$" + value + "\n");
} else {
if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
CTS.Game.Fish.Player[id].Points -= value;
msg += (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "..." + ((CTS.Game.Fish.Player[id].Points < 0) ? "[broke]" : "[$" + CTS.Game.Fish.Player[id].Points + "]") + ":\n🗷" + CTS.Game.Fish.TypesOfFish[type][0] + " -$" + value + "\n");
} else {
msg += (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...[$" + CTS.Game.Fish.Player[id].Points + "]:\n🗹" + net + " x " + CTS.Game.Fish.TypesOfFish[type][0] + " -$0\n");
}
}
} else {
cast--;
}
if (this.getPlayer() == -1) break;
if (CTS.Game.Fish.Player[id].Points < 0) {
eliminate = true;
handle = CTS.Game.Fish.Player[id].Handle;
msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
CTS.Game.Fish.Player.splice(id, 1);
break;
}
}
if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
if (eliminate) {
eliminate = false;
Send("msg", msgeliminate);
}
CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
g.cast();
}, Rand(90000, 120000), this);
} else {
this.winner();
}
} else {
//RESTART
CTS.Game.Fish.GameStart = false;
Fish.stop();
}
}
},
//STOPPERS
reset: function(stop, bypass) {
var get = this.getPlayer();
if (get !== undefined) {
if (get >= 0 && !CTS.Game.NoReset || bypass !== undefined) {
CTS.Game.Fish.Round = 0;
clearTimeout(CTS.Game.Fish.StartTimeout);
clearTimeout(CTS.Game.Fish.RestockTimeout);
clearTimeout(CTS.Game.Fish.ReCastTimeout);
clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
if (!stop) {
this.init();
} else {
if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
CTS.Game.Fish.Player = [];
}
}
}
},
stop: function() {
CTS.Game.NoReset = false;
this.reset(true, true);
}
};
var FishList = {
fish: function(playerExist, user) {
Fish.addPlayer(user.handle, user.username, user.nick);
},
fishbank: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname.substr(0, 16) + ", you have $" + playerExist.Points + ".");
},
fishrob: function(playerExist, target) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 4), Rand(5000, 20000), true);
}
},
fishgamble: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
if (FishTransaction(playerExist, Fish.pricelist(playerExist, 6))) {
var winnings;
if (Rand(1, 10) === 7) { // 10% chance
winnings = Rand(1000, 25000);
playerExist.Points += winnings;
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
} else {
if (Rand(1, 7) === 4) { // 15%
winnings = Rand(1000, 5000);
playerExist.Points += winnings;
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
} else {
Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " tough luck, you lost $1000!");
}
}
}
}
},
fishslap: function(playerExist, target) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
var user = UsernameToUser(target.toUpperCase());
if (user !== -1) {
if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle) {
if (CTS.Me.owner || !CTS.UserList[user].mod) {
if (FishTransaction(playerExist, Fish.pricelist(playerExist, 5))) {
Send("stream_moder_close", CTS.UserList[user].handle);
Send("msg", playerExist.Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
}
} else {
Send("msg", "Cannot close moderator!");
}
} else {
Send("msg", "Cannot close user!");
}
}
}
},
fishsplit: function(playerExist, target) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 6), Math.round(playerExist.Points / 2), false);
}
},
fishupgrade: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 0);
},
fishhelp: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 6);
},
fishupgradenet: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
if (playerExist.Upgrades.Net >= 10) {
Send("msg", playerExist.Nickname + ", you own all upgrades.");
} else {
if (FishTransaction(playerExist, Fish.pricelist(playerExist, 0))) {
playerExist.Upgrades.Net += 1;
FishUpgradeStatus(playerExist, 1);
}
}
}
},
fishupgradeshop: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
if (playerExist.Upgrades.Store >= 6) {
Send("msg", playerExist.Nickname + ", you own them all already!");
} else {
if (FishTransaction(playerExist, Fish.pricelist(playerExist, 2))) {
playerExist.Upgrades.Store += 1;
FishUpgradeStatus(playerExist, 4);
}
}
}
},
fishupgraderadar: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
if (playerExist.Upgrades.Radar >= 20) {
Send("msg", playerExist.Nickname + ", you own all upgrades.");
} else {
if (FishTransaction(playerExist, Fish.pricelist(playerExist, 1))) {
playerExist.Upgrades.Radar += 5;
FishUpgradeStatus(playerExist, 2);
}
}
}
},
fishupgradeinsurance: function(playerExist) {
if (playerExist !== -1 && FishTimerCheck(playerExist)) {
if (playerExist.Upgrades.Insurance === true) {
Send("msg", playerExist.Nickname + ", you already have insurance!");
} else {
if (FishTransaction(playerExist, Fish.pricelist(playerExist, 3))) {
playerExist.Upgrades.Insurance = true;
FishUpgradeStatus(playerExist, 3);
}
}
}
}
};
//MISC FUNCTION
function debug() {
if (window.DebugClear === false) {
if (arguments[0] !== undefined) {
var msg = "CTS::" + arguments[0];
if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
console.log(msg);
}
} else {
console.clear();
console.log(" ( \n ( * ))\ ) \n )\ \` ) /(()/( \n (((_) ( )(_)/(_)) \n )\___(_(_()(_)) \n((/ __|_ _/ __| \n | (__ | | \__ \ /\n \___| |_| |___/ \nCosmosisT's TinyChat Script\nCREATOR: COSMOSIST\nVERSION: " + Ver() + "\nCONSOLE DEBUG: FALSE\n\nJoin the discord today!\nhttps://discord.gg/cHEf8z7");
}
}
function Remove() {
return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
}
})();