CosmosisT's TinyChat Script (CTS V1.6.65)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2020-05-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CosmosisT's TinyChat Script (CTS V1.6.65)
  3. // @version 1.6.65
  4. // @description Modified TinyChat - Best Scripts; prepare to be amazed.
  5. // @author CosmosisT
  6. // @url https://gist.github.com/CosmosisT
  7. // @license Copyright (C) 2019-2020 CosmosisT
  8. // @icon https://tinychat.com/webrtc/2.0.0-81/images/favicon.png
  9. // @match https://tinychat.com/room/*
  10. // @match https://tinychat.com/*
  11. // @exclude https://tinychat.com/settings/*
  12. // @exclude https://tinychat.com/subscription/*
  13. // @exclude https://tinychat.com/promote/*
  14. // @exclude https://tinychat.com/coins/*
  15. // @exclude https://tinychat.com/gifts*
  16. // @grant none
  17. // @run-at document-start
  18. // jshint esversion: 6
  19. // @namespace https://greasyfork.org/users/395685
  20. // ==/UserScript==
  21. (function() {
  22. "use strict";
  23. //DEBUGGER
  24. window.DebugClear = true; // TRUE = CLEARS || FALSE = SHOWS
  25. window.CTSVersion = {Major: 1, Minor: 6, Patch: 65};
  26. var MainElement, ChatLogElement, VideoListElement, SideMenuElement, TitleElement, UserListElement,ModerationListElement, ChatListElement, UserContextElement, MicrophoneElement,
  27. FeaturedCSS, VideoCSS, SideMenuCSS, MainCSS, RoomCSS, TitleCSS, ContextMenuCSS,ModeratorCSS, UserListCSS, ChatListCSS, NotificationCSS, ChatboxCSS;
  28. //CTS MAIN VARIABLES
  29. var CTS = {
  30. Project: {Name: "CTS",Storage: "CTS_", isTouchScreen: false},
  31. Chuck: {XHR: new XMLHttpRequest()}, Urb: {XHR: new XMLHttpRequest()}, Dad: {XHR: new XMLHttpRequest()}, Advice: {XHR: new XMLHttpRequest()},
  32. //API_KEY FOR YOUTUBE CAN BE INSERTED BELOW (NO WHERE ELSE)
  33. //TC KEY AIzaSyAf1XXorjOLdjS2j5PGi3SLCGl7LhyxQXs
  34. 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}},
  35. Me: [], Room: [],
  36. ScriptInit: false,
  37. MainBackground: undefined,
  38. 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,
  39. ChatLimit: 650,NotificationLimit: 100,
  40. 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,
  41. 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]]}},
  42. TTS: {synth: undefined,voices: undefined},
  43. hasGreetedWC: false,
  44. Host: 0,HostAttempt: 0,HostWaiting: false,
  45. WaitToVoteList: [],UserList: [],MentionList: [],TempIgnoreList: [],IgnoreList: [],BanList: [],KickList: [],BotOPList: [],BotModList: [],TTSList: [],BanKeywordList: [],KickKeywordList: [],HighlightList: [],GreetList: [],ReminderList: [],ReminderServerInList: [],Favorited: [],SafeList: [],GreenRoomIgnoreList: [],GreenRoomList: [],WatchList: [],KBQueue: [],
  46. MessageCallback: [],Message: [[]],LastMessage: new Date(),ShowedSettings: false,SendQueue: [],MissedMsg: 0, ActiveMessage: 0,
  47. Camera: {List: [],Sweep: false,SweepTimer: 5,clearRandom: undefined},
  48. NotificationTimeOut: [],
  49. };
  50. //API_KEY SAVE (PLEASE ENTER YOUR KEY ABOVE NOT HERE)
  51. if (CTS.YouTube.API_KEY !== "") Save("YouTubeAPI", CTS.YouTube.API_KEY);
  52. //CTS SETTINGS
  53. CTS.Game.Fish.HighScore = JSON.parse(Load("FishHighScore", JSON.stringify(["CosmosisT", 13337])));
  54. CTS.PublicCommandToggle = JSON.parse(Load("PublicCommandToggle", JSON.stringify(true)));
  55. CTS.CameraBorderToggle = JSON.parse(Load("CameraBorderToggle", JSON.stringify(true)));
  56. CTS.OGStyle.SavedHeight = JSON.parse(Load("OGStyleHeight", "3"));
  57. CTS.GreenRoomIgnoreList = JSON.parse(Load("GreenRoomIgnoreList", JSON.stringify([])));
  58. CTS.OGStyle.SavedWidth = JSON.parse(Load("OGStyleWidth", "1"));
  59. CTS.NotificationToggle = JSON.parse(Load("NotificationToggle", "0"));
  60. CTS.ChatStyleCounter = JSON.parse(Load("ChatStyle", "0"));
  61. CTS.KickKeywordList = JSON.parse(Load("KickKeywordList", JSON.stringify([])));
  62. CTS.TimeStampToggle = JSON.parse(Load("TimeStampToggle", JSON.stringify(true)));
  63. //API_KEY SAVE (PLEASE ENTER YOUR KEY ABOVE NOT HERE)
  64. CTS.YouTube.API_KEY = Load("YouTubeAPI", "");
  65. CTS.GreenRoomToggle = JSON.parse(Load("GreenRoomToggle", JSON.stringify(true)));
  66. CTS.BanKeywordList = JSON.parse(Load("BanKeywordList", JSON.stringify([])));
  67. CTS.GreenRoomList = JSON.parse(Load("GreenRoomList", JSON.stringify([])));
  68. CTS.MainBackground = Load("MainBackground", "url(https://i.imgur.com/RC3bKe7.jpg) rgb(0, 0, 0) no-repeat");
  69. CTS.HighlightList = JSON.parse(Load("HighlightList", JSON.stringify([])));
  70. CTS.CanHostGames = JSON.parse(Load("CanHostGames", JSON.stringify(false)));
  71. CTS.ReminderList = JSON.parse(Load("ReminderList", JSON.stringify([])));
  72. CTS.MentionList = JSON.parse(Load("MentionList", JSON.stringify([])));
  73. CTS.CanSeeGames = JSON.parse(Load("CanSeeGames", JSON.stringify(true)));
  74. CTS.ThemeChange = JSON.parse(Load("ThemeChange", JSON.stringify(true)));
  75. CTS.BotModList = JSON.parse(Load("BotModList", JSON.stringify([])));
  76. CTS.IgnoreList = JSON.parse(Load("IgnoreList", JSON.stringify([])));
  77. CTS.Favorited = JSON.parse(Load("Favorited", JSON.stringify([["stonercircle", "https://avatars.tinychat.com/da/838b96/5f/medium/phpKXAdEn.jpeg"], null, null, null, null])));
  78. CTS.GreetList = JSON.parse(Load("GreetList", JSON.stringify([])));
  79. CTS.BotOPList = JSON.parse(Load("BotOPList", JSON.stringify(["-ALL"])));
  80. CTS.GreetMode = JSON.parse(Load("GreetMode", JSON.stringify(false)));
  81. CTS.FontSize = JSON.parse(Load("FontSize", 20));
  82. CTS.SafeList = JSON.parse(Load("AKB", JSON.stringify([])));
  83. CTS.Featured = JSON.parse(Load("Featured", JSON.stringify(false)));
  84. CTS.KickList = JSON.parse(Load("KickList", JSON.stringify([])));
  85. CTS.Reminder = JSON.parse(Load("Reminder", JSON.stringify(true)));
  86. CTS.TTSList = JSON.parse(Load("TTSList", JSON.stringify([])));
  87. CTS.BanList = JSON.parse(Load("BanList", JSON.stringify([])));
  88. CTS.UserYT = JSON.parse(Load("UserYT", JSON.stringify(true)));
  89. CTS.Popups = JSON.parse(Load("Popups", JSON.stringify(true)));
  90. CTS.Avatar = JSON.parse(Load("Avatar", JSON.stringify(true)));
  91. CTS.imgur = JSON.parse(Load("imgur", JSON.stringify(true)));
  92. CTS.Bot = JSON.parse(Load("Bot", JSON.stringify(true)));
  93. //IS USER TOUCHSCREEN
  94. CheckUserTouchScreen();
  95.  
  96. if (CTS.ThemeChange) {
  97. 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%}";
  98. 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;}";
  99. 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;}";
  100. 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;}";
  101. 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;}";
  102. RoomCSS = "tc-title{display:flex!important;}#room-content{padding-top:0!important;background:unset!important;}";
  103. 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;}";
  104. 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;}";
  105. 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;}";
  106. 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;}";
  107. 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;}";
  108. } else {
  109. //OG CTS
  110. 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%}";
  111. 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;}";
  112. 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;}";
  113. 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;}";
  114. RoomCSS = "tc-title{display:flex!important;}#room{padding:0!important;}#room-content{padding-top:0!important;background:unset!important;}";
  115. 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;}";
  116. 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;}";
  117. 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;}";
  118. 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;}";
  119. 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;}";
  120. 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;}";
  121. 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;}";
  122. }
  123. //INITIATE
  124. CTSInit();
  125.  
  126. function CTSInit() {
  127. //INITIATE CTS
  128. var err_out=0;
  129. CTS.ScriptLoading = setInterval(function() {
  130. err_out++;
  131. if (document.querySelector("tinychat-webrtc-app")) {
  132. if (document.querySelector("tinychat-webrtc-app").shadowRoot) CTSRoomInject();
  133. debug("TINYCHAT::LOAD", "ROOM");
  134. } else if (document.querySelector("#welcome-wrapper")) {
  135. CTSHomeInject();
  136. debug("TinyChat::LOAD", "HOME");
  137. } else {
  138. err_out++;
  139. }
  140. if (err_out == 50) {
  141. clearInterval(CTS.ScriptLoading);
  142. clearInterval(CTS.FullLoad);
  143. }
  144. }, 200);
  145. //WEBSOCKET HOOK
  146. if (!document.URL.match(/^https:\/\/tinychat.com(\/$|\/#)/i)) {
  147. new MutationObserver(function() {
  148. this.disconnect();
  149. CTSWebSocket();
  150. }).observe(document, {
  151. subtree: true,
  152. childList: true
  153. });
  154. }
  155. //FULLY LOADED -> RUNALL
  156. CTS.FullLoad = setInterval(function() {
  157. if (CTS.ScriptInit && CTS.SocketConnected) {
  158. clearInterval(CTS.FullLoad);
  159. if (CTS.Me.mod) {
  160. if (CTS.Bot) CheckHost();
  161. if (CTS.Room.YT_ON) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").style.cssText = "display:block;";
  162. if (CTS.Room.YT_ON && CTS.Project.isTouchScreen) VideoListElement.querySelector("#videos-footer>#videos-footer-youtube").classList.toggle("hidden");
  163. //VideoListElement.querySelector("#videos-footer>#videos-footer-soundcloud").style.cssText = "display:block;";
  164. }
  165. //PTT AUTO
  166. if (CTS.Room.PTT) {
  167. VideoListElement.querySelector("#videos-footer-push-to-talk").addEventListener("mouseup", function(e) {
  168. if (e.which == 1) CTS.AutoMicrophone = false;
  169. if (e.which == 1 && e.ctrlKey === true) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  170. if (e.which == 2) CTS.AutoMicrophone = !CTS.AutoMicrophone;
  171. }, {
  172. passive: true
  173. });
  174. }
  175. //FAVORITE ROOM
  176. var favorited_rooms = "",
  177. len = CTS.Favorited.length,
  178. script = document.createElement("script"),
  179. elem = document.getElementsByTagName("script")[0];
  180. 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}';
  181. elem.parentNode.insertBefore(script, elem);
  182. 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>';
  183. 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>');
  184. //RECENT GIFTS
  185. var recent_gifts = "\n";
  186. for (var g = 0; g < CTS.Room.Recent_Gifts.length; g++) recent_gifts += "<img src=\""+CTS.Room.Recent_Gifts[g]+"\" />";
  187. //ALERT
  188. 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>");
  189. CTS.ShowedSettings = true;
  190. AddUserNotification(2, CTS.Me.namecolor, CTS.Me.nick, CTS.Me.username, false);
  191. //FEATURE LAUNCH
  192. SoundMeter();
  193. Reminder();
  194. }
  195. }, 500);
  196. }
  197.  
  198. function CTSHomeInject() {
  199. 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;}';
  200. //INSERT HTML/CSS
  201. document.body.querySelector("style").insertAdjacentHTML("beforeend", HomeCSS);
  202. document.body.insertAdjacentHTML("beforeend", '<div class="cts-footer"><h2>FAVORITED ROOMS</h2><div class="cts-footer-contents"></div></div>');
  203. //INSERT SCRIPT
  204. var script = document.createElement("script"),
  205. elem = document.getElementsByTagName("script")[0];
  206. 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}';
  207. elem.parentNode.insertBefore(script, elem);
  208. var len = CTS.Favorited.length;
  209. 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>");
  210. //SCRIPT INIT -> PREPARE()
  211. clearInterval(CTS.ScriptLoading);
  212. CTS.ScriptInit = true;
  213. CTSHomePrepare();
  214. }
  215.  
  216. function CTSHomePrepare() {
  217. //FUNCTION BYPASS
  218. window.ModalFreeTrialPro = function() {};
  219. //REMOVE
  220. Remove(document, "#footer");
  221. Remove(document, ".nav-logo");
  222. }
  223.  
  224. function CTSRoomInject() {
  225. // PUBLIC / ADDON GRABBERS
  226. window.CTSImages = [
  227. "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",
  228. "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",
  229. "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",
  230. "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",
  231. "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",
  232. "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",
  233. "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",
  234. ];
  235. 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."];
  236. window.CTSWelcomes = ["Hey ", "What's crackin ", "Hello ", "Good to see you ", "Howdy ", "Hey there ", "Yo ", "What's up ", "Greetings ", "What's hangin' "];
  237. window.CTSSound = {
  238. C: new Audio("https://media.vocaroo.com/mp3/e3VIvvFqdHe"),
  239. HIGHLIGHT: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  240. GREET: new Audio("https://media.vocaroo.com/mp3/mjS6tza4Tu4"),
  241. MENTION: new Audio("https://media.vocaroo.com/mp3/gsrjQNCdhlX"),
  242. MSG: new Audio("https://tinychat.com"+window.rootDir+"/sound/pop.mp3"),
  243. GIFT: new Audio("https://tinychat.com"+window.rootDir+"/sound/magic.mp3"),
  244. PVTMSG: new Audio("https://media.vocaroo.com/mp3/1eX3L752VdQ")
  245. };
  246. window.CTSRadioStations = [
  247. ["Flex 98.5FM", "https://edge1-b.exa.live365.net/a23768"],
  248. ["The Loop 97.9", "https://16883.live.streamtheworld.com/WLUPFMAAC.aac"],
  249. ["HOT899", "https://newcap.leanstream.co/CIHTFM"],
  250. ["chillstep.info", "https://chillstep.info/listen.ogg"],
  251. ["HOT997", "https://ice5.securenetsystems.net/KHHK"],
  252. ["Dance365", "https://edge1-b.exa.live365.net/a93720"],
  253. ["kexp.org", "https://kexp-mp3-128.streamguys1.com/kexp128.mp3"],
  254. ["Classic Deep Cuts", "https://edge1-b.exa.live365.net/a72496"],
  255. ["Divas Hustle Radio", "https://edge1-b.exa.live365.net/a72972"],
  256. ["Retro 8089", "https://edge1-b.exa.live365.net/a53202"],
  257. ["Teerex Radio Teerex", "https://edge1-b.exa.live365.net/a74387"],
  258. ["NGI Radio", "https://edge1-b.exa.live365.net/a24650"],
  259. ["Legend Oldies", "https://edge1-b.exa.live365.net/a88135"],
  260. ["Music City Roadhouse", "https://edge1-b.exa.live365.net/a73754"],
  261. ["Mashrup Reggae Radio", "https://edge1-b.exa.live365.net/a00564"],
  262. ["97.5 Dance Hits", "https://edge1-b.exa.live365.net/a50365"]
  263. ];
  264. window.CTSNameColor = ["#3f69c0", "#b63fc0", "#001f3f", "#0074D9", "#7FDBFF", "#39CCCC", "#3D9970", "#26a635", "#00b34d", "#e6c700", "#FF851B", "#FF4136", "#c81e70", "#f00fbb", "#B10DC9", "#111111", "#AAAAAA", "#cc6600", "#009933", "#003366", "#660033", "#804000"];
  265. window.CTSChatCSS = [
  266. [ //STYLE #0
  267. ["#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;}"],
  268. [".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;}"],
  269. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  270. ],
  271. [ //STYLE #1
  272. ["#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;}"],
  273. [".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;}"],
  274. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(25,25,25)8px,rgb(76,76,76)100%);}"]
  275. ],
  276. [ //STYLE #2
  277. ["#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;}"],
  278. [".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;}"],
  279. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(13,5,15)8px,rgb(121,24,188)100%);}"]
  280. ],
  281. [ //STYLE #3
  282. ["#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;}"],
  283. [".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;}"],
  284. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(15,5,5)8px,rgb(193,1,1)100%);}"]
  285. ],
  286. [ //STYLE #4
  287. ["#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;}"],
  288. [".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;}"],
  289. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,14,15)8px,rgb(83,182,239)100%);}"]
  290. ],
  291. [ //STYLE #5
  292. ["#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;}"],
  293. [".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;}"],
  294. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgb(5,15,5)8px,rgb(14,104,7)100%);}"]
  295. ],
  296. [ //STYLE #6
  297. ["#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;}"],
  298. [".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;}"],
  299. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(5, 15, 5, 0.72)8px,rgba(0, 0, 0, 0.42)100%);}"]
  300. ],
  301. [ //STYLE #7
  302. ["#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;}"],
  303. [".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;}"],
  304. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(255, 255, 255, 0.72)8px,rgba(255, 255, 255, 0.81)100%);}"]
  305. ],
  306. [ //STYLE #8
  307. ["#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;}"],
  308. [".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;}"],
  309. ["#sidemenu{background: linear-gradient(0deg,rgb(56, 50, 6)0%,rgb(149, 158, 22)8px,rgba(255, 255, 0, 1)100%);}"]
  310. ],
  311. [ //STYLE #9
  312. ["#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;}"],
  313. [".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;}"],
  314. ["#sidemenu{background: linear-gradient(0deg,rgb(154, 51, 1)0%,rgba(255, 125, 0, 1)8px,rgba(255, 125, 0, 1)100%);}"]
  315. ],
  316. [ //STYLE #10
  317. ["#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;}"],
  318. [".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;}"],
  319. ["#sidemenu{background: linear-gradient(0deg,rgb(94, 3, 62)0%,rgb(191, 0, 255)8px,rgb(71, 0, 20)100%);}"]
  320. ],
  321. [ //STYLE #11
  322. ["#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;}"],
  323. [".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;}"],
  324. ["#sidemenu{background: repeating-linear-gradient(-45deg,rgb(0, 0, 0)1px,rgb(0, 186, 255)3px,rgba(0, 115, 255, 0.49)15px);}"]
  325. ],
  326. [ //STYLE #12
  327. ["#chat-wrapper{background: #fff!important;}.message>#system_user{color:#FFFFFF}#cts-chat-content>.message{background:#00000000}.message{color:#000000;text-shadow: unset;}"],
  328. [".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;}"],
  329. ["#sidemenu{background: #2d373a;}"]
  330. ],
  331. [ //STYLE #13
  332. ["#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;}"],
  333. [".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;}"],
  334. ["#sidemenu{background: url(https://i.imgur.com/LCOulGB.png) repeat-x bottom;}"]
  335. ],
  336. [ //STYLE #14
  337. ["#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;}"],
  338. [".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;}"],
  339. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  340. ],
  341. [ //STYLE #14
  342. ["#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;}"],
  343. [".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;}"],
  344. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  345. ],
  346. [ //STYLE #15
  347. ["#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;}"],
  348. [".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;}"],
  349. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  350. ],
  351. [ //STYLE #16
  352. ["#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;}"],
  353. [".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;}"],
  354. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  355. ],
  356. [ //STYLE #17
  357. ["#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;}"],
  358. [".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;}"],
  359. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  360. ],
  361. [ //STYLE #18
  362. ["#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;}"],
  363. [".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;}"],
  364. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  365. ],
  366. [ //STYLE #19
  367. ["#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;}"],
  368. [".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;}"],
  369. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  370. ],
  371. [ //STYLE #20
  372. ["#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;}"],
  373. [".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;}"],
  374. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  375. ],
  376. [ //STYLE #21
  377. ["#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;}"],
  378. [".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;}"],
  379. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  380. ],
  381. [ //STYLE #22
  382. ["#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;}"],
  383. [".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;}"],
  384. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  385. ],
  386. [ //STYLE #23
  387. ["#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;}"],
  388. [".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;}"],
  389. ["#sidemenu{background: linear-gradient(0deg,rgb(0, 0, 0)0%,rgba(19,19,19,0.73)8px,rgba(0,0,0,0.34)100%);}"]
  390. ]
  391. ];
  392. //INSERT SCRIPT
  393. var script = document.createElement("script"),
  394. elem = document.getElementsByTagName("script")[0];
  395. 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}';
  396. elem.parentNode.insertBefore(script, elem);
  397. //LOCALSETTINGS
  398. CTS.enablePMs = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enablePMs : true;
  399. CTS.enableSound = (window.localStorage.tinychat_settings) ? JSON.parse(window.localStorage.tinychat_settings).enableSound : true;
  400. //TTS (TEXT-TO-SPEECH)
  401. if (CTS.enableSound === true && "speechSynthesis" in window) {
  402. CTS.TTS.synth = window.speechSynthesis;
  403. CTS.TTS.voices = CTS.TTS.synth.getVoices();
  404. }
  405. //ELEMENT DEFINE
  406. MainElement = document.querySelector("tinychat-webrtc-app").shadowRoot;
  407. ChatLogElement = MainElement.querySelector("tc-chatlog").shadowRoot;
  408. VideoListElement = MainElement.querySelector("tc-videolist").shadowRoot;
  409. MicrophoneElement = document.createEvent("MouseEvent");
  410. SideMenuElement = MainElement.querySelector("tc-sidemenu").shadowRoot;
  411. TitleElement = MainElement.querySelector("tc-title").shadowRoot;
  412. UserListElement = SideMenuElement.querySelector("tc-userlist").shadowRoot;
  413. ModerationListElement = SideMenuElement.querySelector("tc-video-moderation").shadowRoot;
  414. ChatListElement = SideMenuElement.querySelector("tc-chatlist").shadowRoot;
  415. UserContextElement = UserListElement.querySelector("tc-user-contextmenu").shadowRoot;
  416. var insert = TitleElement.querySelector('span[title="Settings"]');
  417. VideoListElement.querySelector("#videos-header").appendChild(insert);
  418. //INSERT HTML/CSS
  419. if (!CTS.Project.isTouchScreen) {
  420. insert = VideoListElement.querySelector("#videos-footer-broadcast-wrapper");
  421. VideoListElement.querySelector("#videolist").appendChild(insert);
  422. VideoListElement.querySelector("#videos-footer").insertAdjacentHTML("afterbegin", "Media");
  423. 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);">&#8592;</button><button class="music-radio-seek" onclick="SeekStation(this,1);">&#8594;</button><button class="music-radio-playpause" onclick="PlayPauseStation(this);">&#9654;</button><button class="music-radio-vol" onclick="VolStation(this,.05);">&#43;</button><button class="music-radio-vol" style="top:50%" onclick="VolStation(this,-.05);">&#45;</button></div><audio id="music-radio-audio" src="' + window.CTSRadioStations[0][1] + '"></audio>');
  424. TitleCSS +="span[title=\"Follow\"], span[title=\"Share room\"]{display:none!important;}";
  425. } else {
  426. 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;}";
  427. MainCSS += "body{overflow:auto;}";
  428. 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;}";
  429. UserListCSS += "#contextmenu{top:unset;bottom:0;left:0;}";
  430. }
  431. ChatLogElement.querySelector("style").insertAdjacentHTML("beforeend", ChatboxCSS);
  432. StyleSet();
  433. document.body.querySelector("style").insertAdjacentHTML("beforeend", MainCSS);
  434. MainElement.querySelector("style").insertAdjacentHTML("beforeend", RoomCSS);
  435. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", NotificationCSS);
  436. VideoListElement.querySelector("style").insertAdjacentHTML("beforeend", VideoCSS);
  437. SideMenuElement.querySelector("style").insertAdjacentHTML("beforeend", SideMenuCSS);
  438. UserListElement.querySelector("style").insertAdjacentHTML("beforeend", UserListCSS);
  439. ChatListElement.querySelector("style").insertAdjacentHTML("beforeend", ChatListCSS);
  440. ModerationListElement.querySelector("style").insertAdjacentHTML("beforeend", ModeratorCSS);
  441. UserContextElement.querySelector("style").insertAdjacentHTML("beforeend", ContextMenuCSS);
  442. TitleElement.querySelector("style").insertAdjacentHTML("beforeend", TitleCSS);
  443. UserListElement.querySelector("#button-banlist").insertAdjacentHTML("beforebegin", "<span>1</span>");
  444. VideoListElement.querySelector("#videos-header").insertAdjacentHTML("afterbegin", "<button style=\"display:"+((CTS.Project.isTouchScreen)?"none":"block")+"\" class=\"tcsettings\">⯇</button>");
  445. VideoListElement.querySelector("#videos-content").insertAdjacentHTML("beforeend", '<div id="popup" class="PMOverlay"></div>');
  446. 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>':''));
  447. ChatLogElement.querySelector("#chat-position").insertAdjacentHTML("afterbegin", '<div id="notification-content"></div><button class="notifbtn">▼</button>');
  448. ChatLogElement.querySelector("#chat").insertAdjacentHTML("beforeend", '<div id="cts-chat-content"></div>');
  449. ChatLogElement.querySelector("#chat").insertAdjacentHTML("afterend", '<div class="cts-message-unread" style="display:none;">There are unread messages!</div>');
  450. //SCRIPT INIT -> PREPARE()
  451. clearInterval(CTS.ScriptLoading);
  452. CTS.ScriptInit = true;
  453. CTSRoomPrepare();
  454. }
  455.  
  456. function CTSRoomPrepare() {
  457. //FUNCTION BYPASS
  458. window.TinychatApp.BLL.Videolist.prototype.blurOtherVids = function() {};
  459. window.TinychatApp.BLL.SoundPlayer.playMessage = function() {};
  460. window.TinychatApp.BLL.SoundPlayer.playGift = function() {};
  461. window.TinychatApp.BLL.User.isSubscription = function() {return true;};
  462. window.TinychatApp.BLL.User.canUseFilters = function() {return true;};
  463. window.TinychatApp.BLL.MediaConnection.prototype.Close = function() {RTC(this);};
  464. window.TinychatApp.BLL.ChatRoom.prototype.sendPushForUnreadPrivateMessage = function() {};
  465. if (!CTS.Project.isTouchScreen) {
  466. window.TinychatApp.BLL.ChatRoom.prototype.BroadcastStart = function(a) {
  467. var b = this,
  468. d = this.settings.getSettings();
  469. if (d.video === null) {
  470. return void this.app.MediaSettings(() => {
  471. this.BroadcastStart();
  472. });
  473. }
  474. this.videolist.AddingVideoSelf(this.self_handle);
  475. var e = {};
  476. if (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices) {
  477. e.audio = true;
  478. e.video = {width: {min: 320,max: 4096},height: {min: 240,max: 2160},frameRate: {min: 15,ideal: 30,max: 60}};
  479. } else {
  480. navigator.mediaDevices.enumerateDevices().then(g => {
  481. var h = false;
  482. var len = g.length;
  483. for (var c = 0; c < len; c++) {
  484. if (g[c].kind === "videoinput") {
  485. if (e.video === void 0) e.video = {width: {min: 320,max: 4096},height: {min: 240,max: 2160},frameRate: {min: 15,ideal: 30,max: 60}};
  486. if (h) {
  487. d.video = g[c];
  488. h = false;
  489. this.settings.saveSettings(d);
  490. } else if (d.video === null) {
  491. d.video = g[c];
  492. this.settings.saveSettings(d);
  493. } else if (d.video !== null && typeof d.video == "object" && d.video.deviceId == g[c].deviceId && d.video.deviceId !== a) {
  494. e.video.deviceId = {
  495. exact: d.video.deviceId
  496. };
  497. } else if (d.video.deviceId === a) {
  498. h = true;
  499. }
  500. }
  501. if (g[c].kind === "audioinput") {
  502. if (e.audio === void 0) e.audio = {};
  503. if (d.audio !== null && typeof d.audio == "object" && d.audio.deviceId == g[c].deviceId) {
  504. e.audio = {
  505. deviceId: {
  506. exact: d.audio.deviceId
  507. },
  508. };
  509. }
  510. }
  511. }
  512. if (e.video !== null && d.video !== null && d.video.deviceId == b.id__miconly) delete e.video;
  513. let i = navigator.mediaDevices.getSupportedConstraints();
  514. for (let a in i) {
  515. if (i.hasOwnProperty(a) && "echoCancellation" == a && e.audio) e.audio[a] = this.settings.isAcousticEchoCancelation();
  516. }
  517. if (!(e.audio || e.video)) {
  518. b.onMediaFailedCallback(new Error("No media devices to start broadcast."));
  519. } else if ("https:" === location.protocol || this.app.isDebug()) {
  520. debug("BROADCAST", "Initiating Media...");
  521. var m = new window.TinychatApp.BLL.BroadcastProgressEvent(window.TinychatApp.BLL.BroadcastProgressEvent.MEDIA_START);
  522. this.EventBus.broadcast(window.TinychatApp.BLL.BroadcastProgressEvent.ID, m);
  523. b.mediaLastConstraints = e;
  524. navigator.mediaDevices.getUserMedia(e).then(m => {
  525. b.onMediaSuccessCallback(m);
  526. });
  527. }
  528. }).catch(er => {
  529. debug("CAMERA::ERROR", er);
  530. });
  531. }
  532. };
  533. }
  534. window.TinychatApp.BLL.Userlist.prototype.ignore = function(a) {
  535. var b = a.isUsername ? a.username : a.nickname;
  536. if (this.isIgnored(a) || this.ignored.push(b)) {
  537. var c = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  538. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, c);
  539. this.app.showToast(b + " ignored successfully till they leave or you refresh!");
  540. CTS.TempIgnoreList.push(b.toUpperCase());
  541. Cameras();
  542. }
  543. };
  544. window.TinychatApp.BLL.Userlist.prototype.unignore = function(a) {
  545. var b = a.isUsername ? a.username : a.nickname,
  546. len = this.ignored.length;
  547. for (var TI = 0; TI < len; TI++) {
  548. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  549. this.ignored.splice(TI, 1);
  550. break;
  551. }
  552. }
  553. len = CTS.TempIgnoreList.length;
  554. for (TI = 0; TI < len; TI++) {
  555. if (CTS.TempIgnoreList[TI] === b.toUpperCase()) {
  556. CTS.TempIgnoreList.splice(TI, 1);
  557. break;
  558. }
  559. }
  560. var e = new window.TinychatApp.BLL.IgnorelistUpdateUserEvent(a);
  561. this.EventBus.broadcast(window.TinychatApp.BLL.IgnorelistUpdateUserEvent.ID, e);
  562. this.app.showToast(a.username + " unignored");
  563. };
  564. //REMOVE
  565. Remove(ChatLogElement, 'span[id="input-unread"]');
  566. Remove(ChatLogElement, "#chat-content");
  567. //PARAM REMOVE
  568. if (CTS.enablePMs === false) Remove(ChatListElement, "#chatlist");
  569. //LOAD
  570. CTSRoomLoad();
  571. }
  572.  
  573. function CTSRoomLoad() {
  574. //EVENT LISTENERS
  575. if (!CTS.ThemeChange) {
  576. // BOOT UP OG THEME
  577. var finishoff = false;
  578. while (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter || CTS.OGStyle.SavedWidth !== CTS.OGStyle.WidthCounter) {
  579. if (CTS.OGStyle.SavedHeight !== CTS.OGStyle.HeightCounter) {
  580. ChatHeightToggled();
  581. } else {
  582. finishoff = true;
  583. }
  584. if (CTS.OGStyle.SaveWidth !== CTS.OGStyle.WidthCounter && finishoff) ChatWidthToggled();
  585. }
  586. VideoListElement.querySelector("#ChatHeightToggled").addEventListener("click", function() {
  587. ChatHeightToggled();
  588. Save("OGStyleHeight", CTS.OGStyle.HeightCounter);
  589. }, {
  590. passive: true
  591. });
  592. VideoListElement.querySelector("#ChatWidthToggled").addEventListener("click", function() {
  593. ChatWidthToggled();
  594. Save("OGStyleWidth", JSON.stringify(CTS.OGStyle.WidthCounter));
  595. }, {
  596. passive: true
  597. });
  598. } else {
  599. if (!CTS.Project.isTouchScreen) {
  600. ChatLogElement.querySelector("#chat-wider").insertAdjacentHTML("beforebegin", "<div id=\"chat-hide\"></div>");
  601. ChatLogElement.querySelector("#chat-hide").addEventListener("click", function() {
  602. ChatHide();
  603. }, {
  604. passive: true
  605. });
  606. }
  607. }
  608. if (!CTS.Project.isTouchScreen) {
  609. ChatLogElement.querySelector("#chat-wrapper").insertAdjacentHTML("afterbegin", "<div id=\"chat-download\"></div>");
  610. ChatLogElement.querySelector("#chat-download").addEventListener("click", function() {
  611. var len = CTS.UserList.length,
  612. t = "Users : "+len+"\n",
  613. c;
  614. for (c = 0; c < len; c++) {
  615. if (c){ // 0 = false
  616. t+= ", ";
  617. if (c % 10 === 0) t += "\n";
  618. }
  619. t += CTS.UserList[c].username +" ("+CTS.UserList[c].nick+")";
  620. }
  621. t += "\n\n";
  622. len = CTS.Message[CTS.ActiveMessage].length;
  623. 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");
  624. Download("TinyChat_"+CTS.Room.Name.toUpperCase()+" "+DateTime()+".log", "Room : "+CTS.Room.Name+"\n"+t);
  625. }, {
  626. passive: true
  627. });
  628. VideoListElement.querySelector("#ThemeChange").addEventListener("click", function() {
  629. CTS.ThemeChange = !CTS.ThemeChange;
  630. Save("ThemeChange", JSON.stringify(CTS.ThemeChange));
  631. location.reload();
  632. }, {
  633. passive: true
  634. });
  635. }
  636. VideoListElement.querySelector("#PerformanceModeToggled").addEventListener("click", function() {
  637. if (CTS.ChatDisplay) {
  638. CTS.PerformanceMode = !CTS.PerformanceMode;
  639. PerformanceModeInit(CTS.PerformanceMode);
  640. }
  641. }, {
  642. passive: true
  643. });
  644. VideoListElement.querySelector("#FeaturedToggled").addEventListener("click", function() {
  645. CTS.Featured = !CTS.Featured;
  646. Save("Featured", JSON.stringify(CTS.Featured));
  647. FeaturedCameras(CTS.Featured);
  648. Resize();
  649. }, {
  650. passive: true
  651. });
  652. VideoListElement.querySelector("#CameraBorderToggled").addEventListener("click", function() {
  653. CTS.CameraBorderToggle = !CTS.CameraBorderToggle;
  654. Save("CameraBorderToggle", JSON.stringify(CTS.CameraBorderToggle));
  655. Cameras();
  656. Resize();
  657. }, {
  658. passive: true
  659. });
  660. VideoListElement.querySelector("#ChatColor").addEventListener("click", function() {
  661. CTS.ChatStyleCounter++;
  662. Remove(VideoListElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  663. Remove(ChatLogElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  664. Remove(SideMenuElement, "style[id=\"" + (CTS.ChatStyleCounter - 1) + "\"]");
  665. var len = window.CTSChatCSS.length - 1;
  666. if (CTS.ChatStyleCounter > len) CTS.ChatStyleCounter = 0;
  667. StyleSet();
  668. Save("ChatStyle", CTS.ChatStyleCounter);
  669. }, {
  670. passive: true
  671. });
  672. ChatLogElement.querySelector(".cts-message-unread").addEventListener("click", function() {
  673. UpdateScroll(1, true);
  674. CheckUnreadMessage();
  675. }, {
  676. passive: true
  677. });
  678. ChatLogElement.querySelector("#chat").addEventListener("scroll", function(event) {
  679. var element = event.target;
  680.  
  681. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CheckUnreadMessage(true);
  682. }, {
  683. passive: true
  684. });
  685. ChatLogElement.querySelector("#notification-content").addEventListener("scroll", function(event) {
  686. var element = event.target;
  687. if (Math.floor(element.scrollTop + 50) >= (element.scrollHeight - element.offsetHeight)) CTS.NotficationScroll = true;
  688. }, {
  689. passive: true
  690. });
  691. if (CTS.NotificationToggle === 0) {
  692. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  693. passive: true
  694. });
  695. }
  696. VideoListElement.querySelector(".tcsettings").addEventListener("click", function(event) {
  697. var arg;
  698. if (this.innerText === "⯈") {
  699. this.innerText = "⯇";
  700. arg = "block";
  701. } else {
  702. this.innerText = "⯈";
  703. arg = "none";
  704. }
  705. VideoListElement.querySelector("#videos-header-sound").style.display = arg;
  706. if (CTS.Room.PTT === false) VideoListElement.querySelector("#videos-header-mic").style.display = arg;
  707. //VideoListElement.querySelector("#videos-header-snapshot").style.display = arg;
  708. VideoListElement.querySelector("#videos-header-fullscreen").style.display = arg;
  709. VideoListElement.querySelector("span[title=\"Settings\"]").style.display = arg;
  710. }, {
  711. passive: true
  712. });
  713. VideoListElement.querySelector("button[id=\"BackgroundUpdateLeft\"]").addEventListener("click", function() {
  714. if (!Addon.active("BGIMG")) {
  715. CTS.MainBackgroundCounter++;
  716. if (CTS.MainBackgroundCounter === window.CTSImages.length) CTS.MainBackgroundCounter = 0;
  717. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  718. document.body.style.background = background;
  719. Save("MainBackground", background);
  720. }
  721. }, {
  722. passive: true
  723. });
  724. VideoListElement.querySelector("button[id=\"BackgroundUpdateRight\"]").addEventListener("click", function() {
  725. if (!Addon.active("BGIMG")) {
  726. CTS.MainBackgroundCounter--;
  727. if (CTS.MainBackgroundCounter === -1) CTS.MainBackgroundCounter = window.CTSImages.length - 1;
  728. var background = "url(\"" + window.CTSImages[CTS.MainBackgroundCounter] + "\") rgb(0, 0, 0) no-repeat";
  729. document.body.style.background = background;
  730. Save("MainBackground", background);
  731. }
  732. }, {
  733. passive: true
  734. });
  735. VideoListElement.querySelector("button[id=\"FontSizeUpdate\"]").addEventListener("click", function() {
  736. CTS.FontSize += 5;
  737. if (CTS.FontSize >= 40) CTS.FontSize = 15;
  738. Save("FontSize", CTS.FontSize);
  739. ChatLogElement.querySelector("#textarea").style.fontSize = (CTS.FontSize - 4) + "px";
  740. }, {
  741. passive: true
  742. });
  743. //MUTATION OBSERVERS
  744. new MutationObserver(function() {
  745. LoadMessage();
  746. }).observe(ChatLogElement.querySelector("#chat-instant"), {
  747. attributes: true,
  748. attributeFilter: ["class"],
  749. childList: false,
  750. characterData: false
  751. });
  752. new MutationObserver(function() {
  753. Cameras();
  754. }).observe(VideoListElement.querySelector(".videos-items:first-child"), {
  755. childList: true
  756. });
  757. new MutationObserver(function() {
  758. Cameras();
  759. }).observe(VideoListElement.querySelector(".videos-items:last-child"), {
  760. childList: true
  761. });
  762. new MutationObserver(function() {
  763. if (CTS.AutoMicrophone) {
  764. OpenMicrophone();
  765. }
  766. }).observe(VideoListElement.querySelector("#videos-footer-broadcast-wrapper"), {
  767. attributes: true,
  768. attributeFilter: ["class"]
  769. });
  770. //BOOT UP - FIRST START
  771. NotificationDisplay();
  772. FeaturedCameras(CTS.Featured);
  773. Cameras();
  774. }
  775. //YOUTUBE FUNCTIONS
  776. function CheckHost() {
  777. if (CTS.Host === 0) {
  778. Send("msg", "!whoisbot");
  779. CTS.HostAttempt = 0;
  780. CTS.HostWaiting = true;
  781. }
  782. }
  783.  
  784. function SetBot() {
  785. if (arguments[0]) CTS.Game.NoReset = true;
  786. Send("msg", "!bot");
  787. CTS.HostWaiting = false;
  788. }
  789.  
  790. function CheckYouTube() {
  791. //CHECK YOUTUBE LINK VIA REGEX (NEARLY EVERY LINK ALLOWED SOME FORMATTING REQUIRED ON PLAYLIST)
  792. if (arguments[3] === undefined) arguments[3] = true;
  793. CTS.YouTube.XHR.type = arguments[1];
  794. 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);
  795. if (videoid !== null) {
  796. videoid = videoid[1].replace(/v\=/g, "");
  797. //LINK IS PLAYLIST
  798. if (videoid.match(/list\=/i)) {
  799. if (arguments[3]) {
  800. videoid = videoid.replace(/list\=/, "");
  801. debug("YOUTUBE::PLAYLIST LINK GATHERER", videoid);
  802. 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);
  803. CTS.YouTube.XHR.send();
  804. }
  805. } else {
  806. //LINK IS REGULAR
  807. CTS.YouTube.XHR.videoid = videoid;
  808. CTS.YouTube.VideoReturn = true;
  809. 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);
  810. CTS.YouTube.XHR.send();
  811. debug("YOUTUBE::LINK SEARCH", CTS.YouTube.XHR.videoid);
  812. }
  813. } else {
  814. //KEYWORD SEARCH
  815. if (CTS.YouTube.MessageQueueList.length <= 0) {
  816. arguments[0] = arguments[0].replace(/^(!yt )/, "");
  817. CTS.YouTube.SearchReturn = true;
  818. 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");
  819. CTS.YouTube.XHR.send();
  820. debug("YOUTUBE::KEYWORD SEARCH", arguments[0]);
  821. }
  822. }
  823. }
  824.  
  825. function YouTubePlayList() {
  826. CTS.YouTube.ShowQueue = (arguments[0] !== undefined) ? true : false;
  827. if ((!CTS.YouTube.Playing && CTS.Host == CTS.Me.handle) || CTS.YouTube.Clear === true || CTS.YouTube.ShowQueue === true) Send("yut_playlist");
  828. }
  829.  
  830. function YouTubeTrackAdd() {
  831. if (CTS.YouTube.MessageQueueList[0] !== undefined) {
  832. if (CTS.YouTube.Busy === false) {
  833. if (CTS.YouTube.MessageQueueList.length > 0) {
  834. debug("YOUTUBE::ID", CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId);
  835. 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);
  836. CTS.YouTube.XHR.videoid = CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  837. CTS.YouTube.XHR.send();
  838. CTS.YouTube.MessageQueueList.shift();
  839. }
  840. }
  841. }
  842. }
  843.  
  844. function YouTubePlayListItems() {
  845. var len = arguments[0].length;
  846. for (var i = 0; i < len; i++) {
  847. if (CTS.YouTube.NotPlayable.includes(arguments[0][i].snippet.title) === false) {
  848. CTS.YouTube.MessageQueueList.push(arguments[0][i]);
  849. }
  850. }
  851. }
  852.  
  853. function YouTubeTimeConvert() {
  854. //TIME CONVERSION FOR APPROPRIATE YOUTUBE DURATION TO SEND BACK
  855. var a = arguments[0].match(/\d+/g);
  856. if (arguments[0].indexOf("M") >= 0 && arguments[0].indexOf("H") == -1 && arguments[0].indexOf("S") == -1) a = [0, a[0], 0];
  857. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1) a = [a[0], 0, a[1]];
  858. if (arguments[0].indexOf("H") >= 0 && arguments[0].indexOf("M") == -1 && arguments[0].indexOf("S") == -1) a = [a[0], 0, 0];
  859. var len = a.length;
  860. arguments[0] = 0;
  861. if (len == 3) {
  862. arguments[0] = arguments[0] + parseInt(a[0]) * 3600;
  863. arguments[0] = arguments[0] + parseInt(a[1]) * 60;
  864. arguments[0] = arguments[0] + parseInt(a[2]);
  865. }
  866. if (len == 2) {
  867. arguments[0] = arguments[0] + parseInt(a[0]) * 60;
  868. arguments[0] = arguments[0] + parseInt(a[1]);
  869. }
  870. if (len == 1) arguments[0] = arguments[0] + parseInt(a[0]);
  871. return arguments[0];
  872. }
  873.  
  874. function BotCommandCheck() {
  875. //USER COMMANDS TO HOST
  876. if (isCommand(arguments[1])) {
  877. if (arguments[1].match(/^!whoisbot$/i)) BotCommand(5, arguments[0]);
  878. if (arguments[1].match(/^!vote\s/i)) Vote(arguments[0], arguments[1]);
  879. // PUBLIC COMMANDS
  880. if (CTS.PublicCommandToggle) {
  881. if (arguments[1].match(/^!8ball\s.*\??/i)) Send("msg", "[8BALL]\n" + window.CTSEightBall[Rand(0, window.CTSEightBall.length - 1)]);
  882. if (arguments[1].match(/^!coin$/i)) Send("msg", "[COIN FLIP]\nThe coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!");
  883. if (arguments[1].match(/^!chuck$/i)) Chuck();
  884. if (arguments[1].match(/^!urb\s/i)) Urb(arguments[1]);
  885. if (arguments[1].match(/^!dad$/i)) Dad();
  886. if (arguments[1].match(/^!advice$/i)) Advice();
  887. }
  888. //MOD/JR.MOD
  889. if (CTS.BotModList.includes(CTS.UserList[arguments[0]].username) || CTS.UserList[arguments[0]].mod) {
  890. if (arguments[1].match(/^!kick\s/i)) ModCommand("kick", arguments[1]);
  891. if (arguments[1].match(/^!ban\s/i)) ModCommand("ban", arguments[1]);
  892. if (arguments[1].match(/^!close\s/i)) ModCommand("stream_moder_close", arguments[1]);
  893. }
  894. //ROOM IS PAID AND YOUTUBE IS ONLINE (TC SET)
  895. if (CTS.Room.YT_ON) {
  896. if (arguments[1].match(/^!play$/i)) YouTubePlayList();
  897. if (arguments[1].match(/^!yt\s/i)) BotCommand(1, arguments[0], arguments[1]);
  898. if (arguments[1].match(/^!ytbypass\s/i)) BotCommand(6, arguments[0], arguments[1]);
  899. if (arguments[1].match(/^!ytclear$/i)) BotCommand(2, arguments[0]);
  900. if (arguments[1].match(/^!ytskip$/i)) BotCommand(3, arguments[0]);
  901. if (arguments[1].match(/^!ytqueue$/i)) BotCommand(4, arguments[0]);
  902. }
  903. }
  904. //USER CAN GAME THEY'VE BEEN VERIFIED
  905. if (CTS.UserList[arguments[0]].canGame) FishCommandCheck(arguments[0], arguments[1]);
  906. }
  907.  
  908. function BotCheck() {
  909. if (CTS.UserList[arguments[0]].mod) {
  910. //CHECK HOST
  911. if (arguments[1].match(/^!bot$/i)) {
  912. //SET HOST
  913. CTS.Host = arguments[2].handle;
  914. CTS.HostWaiting = false;
  915. //RESET GAMES
  916. if (CTS.Host != CTS.Me.handle && CTS.Game.NoReset) CTS.Game.NoReset = false;
  917. if (arguments[2].handle === CTS.Host && CTS.HostWaiting === false && !CTS.Game.NoReset) {
  918. if (CTS.Me.handle !== arguments[2].handle) {
  919. CTS.Game.NoReset = false;
  920. Fish.reset(true);
  921. }
  922. }
  923. //IF CLIENT(ME) BECOMES HOST CHECK YOUTUBE IF ENABLED
  924. if (CTS.Me.handle == arguments[2].handle && CTS.Room.YT_ON) YouTubePlayList();
  925. //ELSE KEEP ON UNLESS HOSTWAITING (!WHOISBOT)
  926. } else if (CTS.HostWaiting === true) {
  927. CTS.HostAttempt++;
  928. //SET BOT IF NO RESPONSE IN 10 MESSAGES or 10 SECONDS
  929. if (CTS.HostAttempt == 1) {
  930. setTimeout(function() {
  931. //CHECK WAITING STATE OR IF HOST HAS CHANGED
  932. if (CTS.HostWaiting === true && CTS.Host === 0) SetBot(false);
  933. }, 10000);
  934. }
  935. //SETS BOT FORCEFULLY ON 10 MESSAGES CANCELING TIMER EVENT WHEN IT QUEUES
  936. if (CTS.HostAttempt == 10) SetBot(false);
  937. }
  938. }
  939. }
  940.  
  941. function Chuck() {
  942. //OPEN REQUEST
  943. CTS.Chuck.XHR.open("GET", "https://api.chucknorris.io/jokes/random");
  944. CTS.Chuck.XHR.send();
  945. }
  946.  
  947. function Urb() {
  948. //CHECK TERM
  949. var urban = arguments[0].match(/\!urb\s(.*)/i);
  950. if (urban !== null) {
  951. //OPEN REQUEST
  952. CTS.Urb.XHR.open("GET", "https://api.urbandictionary.com/v0/define?term=" + urban[1]);
  953. CTS.Urb.XHR.send();
  954. }
  955. }
  956.  
  957. function Dad() {
  958. //OPEN REQUEST
  959. CTS.Dad.XHR.open("GET", "https://icanhazdadjoke.com/");
  960. CTS.Dad.XHR.setRequestHeader("Accept", "application/json");
  961. CTS.Dad.XHR.send();
  962. }
  963.  
  964. function Advice() {
  965. //OPEN REQUEST
  966. CTS.Advice.XHR.open("GET", "https://api.adviceslip.com/advice");
  967. CTS.Advice.XHR.setRequestHeader("Accept", "application/json");
  968. CTS.Advice.XHR.send();
  969. }
  970. //MESSAGE FUNCTION
  971. function CreateMessage() {
  972. //SCROLLED UP? MISSED A MESSAGE?
  973. CheckUnreadMessage();
  974. // POST NEW CHAT ITEM AND IF ACTIVECHAT IS OUR CURRENT
  975. 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>");
  976. //CHAT CLEANUP
  977. var Chat = ChatLogElement.querySelectorAll("#cts-chat-content>.message");
  978. var len = Chat.length;
  979. if (len > CTS.ChatLimit + 50) {
  980. CTS.ChatScroll = true;
  981. //REMOVE 50 MESSAGES (CAN BE DONE CLEANER BUT NO BIG DEAL FOR OUR USE)
  982. len = Chat.length - CTS.ChatLimit;
  983. var ChatIndex = 0;
  984. for (ChatIndex; ChatIndex < len; ChatIndex++) {
  985. Chat[ChatIndex].parentNode.removeChild(Chat[ChatIndex]);
  986. CTS.Message[arguments[7]].shift();
  987. //CLEANING TC ITEMS THAT FILL UP OVERTIME
  988. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  989. }
  990. }
  991. UpdateScroll(1, false);
  992. }
  993.  
  994. function AKB() {
  995. //WATCH OR REMOVE USERS
  996. if ((CTS.AutoKick === false && CTS.AutoBan === false) && arguments[0] === true) {
  997. CTS.WatchList.push([arguments[2], arguments[1], new Date()]);
  998. debug("WATCHLIST::ADDED", arguments[2] + ":" + arguments[1]);
  999. } else {
  1000. if (CTS.Me.mod) {
  1001. if (CTS.AutoKick === true) {
  1002. CTS.NoGreet = true;
  1003. Send("kick", arguments[1]);
  1004. } else if (CTS.AutoBan === true) {
  1005. CTS.NoGreet = true;
  1006. Send("ban", arguments[1]);
  1007. }
  1008. }
  1009. }
  1010. }
  1011.  
  1012. function AKBS() {
  1013. if (arguments[0].username !== "") {
  1014. //EXTENDED SAFELIST
  1015. var temp = [];
  1016. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1017. //DEFAULT SAFELIST
  1018. if (!isSafeListed(arguments[0].username.toUpperCase())) {
  1019. if (arguments[0].giftpoints > 0 || arguments[0].subscription > 0 || arguments[0].mod === true) {
  1020. if (CTS.SafeList.length < 2500) {
  1021. CTS.SafeList.push(arguments[0].username.toUpperCase());
  1022. Save("AKB", JSON.stringify(CTS.SafeList));
  1023. debug("SAFELIST::ADDED", arguments[0].username.toUpperCase() + ":" + arguments[0].handle);
  1024. }
  1025. } else {
  1026. if (arguments[0].lurker === false) {
  1027. AKB(true, arguments[0].handle, arguments[0].username.toUpperCase());
  1028. } else {
  1029. AKB(false, arguments[0].handle);
  1030. }
  1031. }
  1032. }
  1033. } else {
  1034. AKB(false, arguments[0].handle);
  1035. }
  1036. }
  1037.  
  1038. function CheckSafeList() {
  1039. var target = User(arguments[0]);
  1040. if (target !== -1) {
  1041. var a = CTS.SafeList.indexOf(CTS.UserList[target].username);
  1042. if (a !== -1) {
  1043. //REMOVE
  1044. if (arguments[1]) {
  1045. debug("SAFELIST::", "REMOVE USER " + CTS.UserList[target].username + " FROM SAFELIST");
  1046. Alert(GetActiveChat(), "🗹Removing "+CTS.UserList[target].username+" from safelist!");
  1047. CommandList.saferemove(a);
  1048. } else {
  1049. //GETID
  1050. return a;
  1051. }
  1052. }
  1053. }
  1054. }
  1055.  
  1056. function LoadMessage() {
  1057. var ChatIndex, index, Chat = ChatLogElement.querySelector("#cts-chat-content");
  1058. CTS.ChatScroll = true;
  1059. if (!CTS.MessageCallback[CTS.ActiveMessage]) CTS.MessageCallback[CTS.ActiveMessage] = [];
  1060. CTS.MessageCallback[CTS.ActiveMessage].html = Chat.innerHTML;
  1061. CTS.MessageCallback[CTS.ActiveMessage].len = (Chat.innerHTML === "") ? 0 : CTS.Message[CTS.ActiveMessage].length;
  1062. Chat.innerHTML = "";
  1063. CheckUnreadMessage();
  1064. CTS.ActiveMessage = GetActiveChat();
  1065. if (CTS.Message[CTS.ActiveMessage]) {
  1066. index = (CTS.MessageCallback[CTS.ActiveMessage]) ? CTS.MessageCallback[CTS.ActiveMessage].len : 0;
  1067. if (index > 0) Chat.innerHTML = CTS.MessageCallback[CTS.ActiveMessage].html;
  1068. var len = CTS.Message[CTS.ActiveMessage].length;
  1069. 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>");
  1070. } else {
  1071. CTS.Message[CTS.ActiveMessage] = [];
  1072. }
  1073. UpdateScroll(1, false);
  1074. UpdateScroll(2, false);
  1075. }
  1076.  
  1077. function CheckUnreadMessage() {
  1078. if ((Math.floor(ChatLogElement.querySelector("#chat").scrollTop + 50) >= (ChatLogElement.querySelector("#chat").scrollHeight - ChatLogElement.querySelector("#chat").offsetHeight)) || arguments[0] !== undefined) {
  1079. CTS.MissedMsg = 0;
  1080. CTS.ChatScroll = true;
  1081. ChatLogElement.querySelector(".cts-message-unread").style.display = "none";
  1082. } else {
  1083. CTS.MissedMsg++;
  1084. CTS.ChatScroll = false;
  1085. ChatLogElement.querySelector(".cts-message-unread").style.display = "block";
  1086. ChatLogElement.querySelector(".cts-message-unread").innerHTML = "There are " + CTS.MissedMsg + " unread message(s)!";
  1087. }
  1088. }
  1089.  
  1090. function GetActiveChat() {
  1091. var elem = ChatListElement.querySelector(".active");
  1092. if (elem) return elem.getAttribute("data-chat-id");
  1093. return 0;
  1094. }
  1095.  
  1096. function CheckImgur() {
  1097. if (CTS.imgur) {
  1098. var i = arguments[0].match(/https?:\/\/i\.imgur\.com\/[a-zA-Z0-9]*\.(jpeg|jpg|gif|png|mp4)/);
  1099. if (i !== null) {
  1100. 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>";
  1101. }
  1102. }
  1103. return arguments[0];
  1104. }
  1105.  
  1106. function TTS() {
  1107. var utter = new window.SpeechSynthesisUtterance(arguments[0]);
  1108. utter.voice = CTS.TTS.voices[0];
  1109. utter.rate = 1.0;
  1110. utter.pitch = 0.5;
  1111. CTS.TTS.synth.speak(utter);
  1112. }
  1113.  
  1114. function isCommand() {
  1115. return arguments[0].match(/^!/);
  1116. }
  1117.  
  1118. function RoomUsers() {
  1119. if (CTS.ScriptInit) UserListElement.querySelector("#header>span>span").innerText = " : " + CTS.UserList.length;
  1120. }
  1121.  
  1122. function SpamPrevention() {
  1123. var LineBreaks = (arguments[0].match(/\n|\r/g) || []).length;
  1124. if (LineBreaks >= 14 && arguments[1] === false) return true;
  1125. return false;
  1126. }
  1127.  
  1128. function GamePrevention() {
  1129. if (!CTS.CanSeeGames && arguments[1] && arguments[0].match(/^\[(?:FISHING\sBOAT)\]/i)) return false;
  1130. return true;
  1131. }
  1132.  
  1133. function UpdateScroll() {
  1134. if (arguments[0] === 1 && (CTS.ChatScroll || arguments[1] === true)) ChatLogElement.querySelector("#chat").scrollTop = ChatLogElement.querySelector("#chat").scrollHeight;
  1135. if (arguments[0] === 2 && (CTS.NotificationScroll || arguments[1] === true) && CTS.NotificationToggle == 0) ChatLogElement.querySelector("#notification-content").scrollTop = ChatLogElement.querySelector("#notification-content").scrollHeight;
  1136. }
  1137.  
  1138. function DecodeTXT() {
  1139. var txt = document.createElement("textarea");
  1140. txt.innerHTML = arguments[0];
  1141. return txt.value;
  1142. }
  1143.  
  1144. function HTMLtoTXT() {
  1145. var p = document.createElement("p");
  1146. p.appendChild(document.createTextNode(arguments[0]));
  1147. 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>");
  1148. }
  1149.  
  1150. function IgnoreText() {
  1151. if (arguments[0] !== "") {
  1152. if (arguments[0].match(/^(\r|\n|\s).*/)) return false;
  1153. return true;
  1154. }
  1155. }
  1156.  
  1157. function TimeToDate() {
  1158. if (arguments[1] === undefined) arguments[1] = new Date();
  1159. var match = arguments[0].trim().match(/(\d+):(\d+)\s?((am|AM|aM|Am)|(pm|PM|pM|Pm))/);
  1160. var t = {
  1161. hours: parseInt(match[1]),
  1162. minutes: parseInt(match[2]),
  1163. period: match[3].toLowerCase()
  1164. };
  1165. if (t.hours === 12) {
  1166. if (t.period === "am") arguments[1].setHours(t.hours - 12, t.minutes, 0);
  1167. if (t.period === "pm") arguments[1].setHours(t.hours, t.minutes, 0);
  1168. } else {
  1169. if (t.period === "am") arguments[1].setHours(t.hours, t.minutes, 0);
  1170. if (t.period === "pm") arguments[1].setHours(t.hours + 12, t.minutes, 0);
  1171. }
  1172. return arguments[1];
  1173. }
  1174.  
  1175. function PushPM() {
  1176. var list = (arguments[2] !== undefined) ? CTS.UserList[arguments[2]] : CTS.Me;
  1177.  
  1178. CTS.Message[arguments[0]].push({
  1179. "time": Time(),
  1180. "namecolor": list.namecolor,
  1181. "avatar": list.avatar,
  1182. "username": list.username,
  1183. "nick": list.nick,
  1184. "msg": CheckImgur(HTMLtoTXT(arguments[1])),
  1185. "mention": false
  1186. });
  1187.  
  1188. if (arguments[0] == GetActiveChat()) {
  1189. var msg = CTS.Message[arguments[0]][CTS.Message[arguments[0]].length - 1];
  1190. CreateMessage(msg.time, list.namecolor, list.avatar, list.username, list.nick, msg.msg, msg.mention, arguments[0]);
  1191. UpdateScroll(1, false);
  1192. }
  1193. }
  1194.  
  1195. function Time() {
  1196. return (new Date().toLocaleString("en-US", {
  1197. hour: "numeric",
  1198. minute: "numeric",
  1199. second: "numeric",
  1200. hour12: true
  1201. }));
  1202. }
  1203. function DateTime() {
  1204. return (new Date().toLocaleString("en-US", {
  1205. year: 'numeric',
  1206. month: 'numeric',
  1207. day: 'numeric',
  1208. hour: "numeric",
  1209. minute: "numeric",
  1210. second: "numeric",
  1211. hour12: true
  1212. }));
  1213. }
  1214. //FEATURES
  1215. function Download() {
  1216. var element = document.createElement('a');
  1217. element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(arguments[1]));
  1218. element.setAttribute('download', arguments[0]);
  1219. element.style.display = 'none';
  1220. document.body.appendChild(element);
  1221. element.click();
  1222. document.body.removeChild(element);
  1223. }
  1224.  
  1225. function StyleSet() {
  1226. var style = document.createElement('style');
  1227. style.setAttribute('id', CTS.ChatStyleCounter);
  1228. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][0]+":host, #videolist {background-color:unset;}";
  1229. ChatLogElement.appendChild(style);
  1230.  
  1231. style = document.createElement('style');
  1232. style.setAttribute('id', CTS.ChatStyleCounter);
  1233. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][1]+":host, #videolist {background-color:unset;}";
  1234. VideoListElement.appendChild(style);
  1235.  
  1236. style = document.createElement('style');
  1237. style.setAttribute('id', CTS.ChatStyleCounter);
  1238. style.innerHTML = window.CTSChatCSS[CTS.ChatStyleCounter][2]+":host, #videolist {background-color:unset;}";
  1239. SideMenuElement.appendChild(style);
  1240. }
  1241.  
  1242. function ChatHeightToggled() {
  1243. CTS.OGStyle.HeightCounter++;
  1244. if (!CTS.ChatDisplay) {
  1245. CTS.ChatWidth += 5;
  1246. CTS.ChatDisplay = true;
  1247. }
  1248. CTS.ChatHeight -= 5;
  1249. CTS.UserListDisplay = true;
  1250. if (CTS.ChatHeight == 20) {
  1251. CTS.ChatHeight = 45;
  1252. CTS.UserListDisplay = false;
  1253. CTS.OGStyle.HeightCounter = 0;
  1254. }
  1255.  
  1256. 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;");
  1257. 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;");
  1258. 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;");
  1259. VideoListElement.querySelector("#videos-header").style.cssText = !CTS.UserListDisplay ? "top:0;right: 54px;" : "bottom:unset;top:" + CTS.ChatHeight + "%;";
  1260. 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;";
  1261. UserListElement.querySelector("#button-banlist").style.cssText = "top:calc(" + CTS.ChatHeight + "% + 89px);";
  1262. document.querySelector("#content").style.cssText = "width:calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  1263. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + (CTS.UserListDisplay ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  1264. PerformanceModeInit(CTS.PerformanceMode);
  1265. UpdateScroll(1, true);
  1266. UpdateScroll(2, true);
  1267. Resize();
  1268. }
  1269.  
  1270. function ChatWidthToggled() {
  1271. CTS.OGStyle.WidthCounter++;
  1272. CTS.ChatWidth += 5;
  1273. CTS.ChatDisplay = true;
  1274. if (CTS.ChatWidth == 25) {
  1275. CTS.ChatWidth = -5;
  1276. CTS.ChatDisplay = false;
  1277. CTS.OGStyle.WidthCounter = 0;
  1278. }
  1279. 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;");
  1280. 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;");
  1281. 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;");
  1282. VideoListElement.querySelector("#videos-header").style.cssText = (!CTS.ChatDisplay) ? "display:none" : ((CTS.UserListDisplay) ? "bottom:unset;top:" + CTS.ChatHeight + "%;" : "bottom:unset;top: 0;right: 54px;");
  1283. 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;";
  1284. UserListElement.querySelector("#button-banlist").style.cssText = (!CTS.ChatDisplay) ? "display:none" : "top:calc(" + CTS.ChatHeight + "% + 89px);";
  1285. document.querySelector("#content").style.cssText = "width:calc(100% " + ((CTS.ChatDisplay) ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")";
  1286. VideoListElement.querySelector("#videos-footer").style.cssText = "display:block;top:" + ((CTS.UserListDisplay) ? "calc(" + CTS.ChatHeight + "% + 119px);" : "119px;") + "right:-70px;display:block;";
  1287. CTS.PerformanceMode = false;
  1288. PerformanceModeInit(CTS.PerformanceMode);
  1289. UpdateScroll(1, true);
  1290. UpdateScroll(2, true);
  1291. Resize();
  1292. }
  1293.  
  1294. function ChatHide() {
  1295. CTS.NormalStyle.ChatHide = !CTS.NormalStyle.ChatHide;
  1296. ChatLogElement.querySelector("#chat-wrapper").style.display = (CTS.NormalStyle.ChatHide ? "none" : "block");
  1297. UpdateScroll(1, true);
  1298. UpdateScroll(2, true);
  1299. Resize();
  1300. }
  1301.  
  1302. function SoundMeter() {
  1303. //MICROPHONE INDICATOR
  1304. setTimeout(function() {
  1305. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  1306. Featured = VideoListElement.querySelectorAll(".videos-items:first-child tc-video-item"),
  1307. TCCameraList = window.TinychatApp.getInstance().defaultChatroom._videolist.items.length,
  1308. CameraLen = Camera.length,
  1309. users;
  1310. if (Featured.length > 0) {
  1311. for (var x = 0; x < TCCameraList; x++) {
  1312. if (CameraLen < 1) break;
  1313. for (users = 0; users < CameraLen; users++) {
  1314. if (Camera[users].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id") == window.TinychatApp.getInstance().defaultChatroom._videolist.items[x].userentity.path) {
  1315. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", window.TinychatApp.getInstance().defaultChatroom._videolist.items[x].audiolevel);
  1316. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  1317. break;
  1318. }
  1319. }
  1320. }
  1321. } else {
  1322. for (users = 0; users < CameraLen; users++) {
  1323. Camera[users].shadowRoot.querySelector(".video > div > .overlay").setAttribute("data-mic-level", window.TinychatApp.getInstance().defaultChatroom._videolist.items[users].audiolevel);
  1324. Camera[users].shadowRoot.querySelector(".video > div > svg").setAttribute("data-mic-level", 0);
  1325. }
  1326. }
  1327. //REPEAT
  1328. SoundMeter();
  1329. }, 200);
  1330. }
  1331.  
  1332. function RTC() {
  1333. if (null != arguments[0].rtc) {
  1334. let a = arguments[0].rtc;
  1335. arguments[0].rtc = null;
  1336. MS(arguments[0], a);
  1337. }
  1338. }
  1339.  
  1340. function Vote() {
  1341. var ChecksOut = CTS.VoteSystem,
  1342. len = CTS.WaitToVoteList.length;
  1343. if (len > 0 && ChecksOut) {
  1344. for (var i = 0; i < len; i++) {
  1345. if (CTS.WaitToVoteList[i][0] === CTS.UserList[arguments[0]].username.toUpperCase()) {
  1346. Send("msg", "Please wait several minutes till you can cast your vote again!");
  1347. ChecksOut = false;
  1348. break;
  1349. }
  1350. }
  1351. }
  1352. if (ChecksOut) {
  1353. if (isSafeListed(CTS.UserList[arguments[0]].username.toUpperCase())) {
  1354. var targetname = arguments[1].match(/\!vote\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
  1355. if (targetname !== null) {
  1356. var Target = UsernameToUser(targetname[1].toUpperCase());
  1357. if (Target !== -1) {
  1358. if (CTS.UserList[Target].broadcasting) {
  1359. if (CTS.Me.owner || !CTS.UserList[Target].mod) {
  1360. Send("msg", "Your vote has been cast, you may vote again shortly!");
  1361. CTS.WaitToVoteList.push([CTS.UserList[arguments[0]].username.toUpperCase(), new Date()]);
  1362. CTS.UserList[Target].vote += 1;
  1363. if (CTS.UserList[Target].vote === 3) {
  1364. CTS.UserList[Target].vote = 0;
  1365. Send("msg", CTS.UserList[Target].nick + "!\nYou've been voted off camera!");
  1366. Send("stream_moder_close", CTS.UserList[Target].handle);
  1367. }
  1368. } else {
  1369. Send("msg", "I cannot do that!");
  1370. }
  1371. }
  1372. } else {
  1373. Send("msg", "The user is not broadcasting...");
  1374. }
  1375. } else {
  1376. Send("msg", "The nickname or username does not exist!");
  1377. }
  1378. }
  1379. }
  1380. }
  1381.  
  1382. function MessagePopUp() {
  1383. if (CTS.Popups) {
  1384. var push = false;
  1385. if (arguments[0] != -1) {
  1386. if (ChatListElement.querySelector(".list-item .active")) {
  1387. if (ChatListElement.querySelector(".active").innerHTML.includes(CTS.UserList[arguments[0]].nick) && !ChatListElement.querySelector(".active").innerHTML.includes("(offline)")) {
  1388. if (arguments[2]) push = true;
  1389. } else {
  1390. push = true;
  1391. }
  1392. } else if (!arguments[2]) {
  1393. push = true;
  1394. }
  1395. }
  1396. if (arguments[3]) push = true;
  1397. if (push || !CTS.ChatDisplay) {
  1398. if (VideoListElement.querySelector(".PMOverlay .PMPopup:nth-child(5)")) {
  1399. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1400. clearTimeout(CTS.NotificationTimeOut[0]);
  1401. CTS.NotificationTimeOut.shift();
  1402. }
  1403. 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>");
  1404. CTS.NotificationTimeOut.push(setTimeout(function() {
  1405. if (VideoListElement.querySelector(".PMOverlay .PMPopup")) {
  1406. Remove(VideoListElement, ".PMOverlay .PMPopup:first-child");
  1407. CTS.NotificationTimeOut.shift();
  1408. }
  1409. }, 11100));
  1410. }
  1411. }
  1412. }
  1413.  
  1414. function Reminder() {
  1415. var temp,
  1416. i,
  1417. len = CTS.ReminderServerInList.length;
  1418. for (i = 0; i < len; i++) clearTimeout(CTS.ReminderServerInList[i]);
  1419. CTS.ReminderServerInList = [];
  1420. if (CTS.Reminder === true) {
  1421. var OffsetTime;
  1422. len = CTS.ReminderList.length;
  1423. for (i = 0; i < len; i++) {
  1424. temp = TimeToDate(CTS.ReminderList[i][0]);
  1425. CTS.RecentTime = new Date();
  1426. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  1427. OffsetTime = temp - CTS.RecentTime;
  1428. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, CTS.ReminderList[i][1]));
  1429. }
  1430. if (Addon.active("ReminderList")) {
  1431. len = Addon.get("ReminderList").length;
  1432. for (i = 0; i < len; i++) {
  1433. temp = TimeToDate(Addon.get("ReminderList")[i][0]);
  1434. CTS.RecentTime = new Date();
  1435. if (temp < CTS.RecentTime) temp.setDate(temp.getDate() + 1);
  1436. OffsetTime = temp - CTS.RecentTime;
  1437. CTS.ReminderServerInList.push(setTimeout(AddReminder, OffsetTime, Addon.get("ReminderList")[i][1]));
  1438. }
  1439. }
  1440. }
  1441. }
  1442.  
  1443. function AddReminder() {
  1444. Send("msg", "🕬 " + arguments[0]);
  1445. setTimeout(Reminder, 5000);
  1446. }
  1447.  
  1448. function NotificationDisplay() {
  1449. ChatLogElement.querySelector("#notification-content").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  1450. ChatLogElement.querySelector(".notifbtn").style.cssText = "display:" + ((CTS.NotificationToggle == 0) ? "block" : "none") + ";";
  1451. if (CTS.NotificationToggle == 0) {
  1452. ChatLogElement.querySelector(".notifbtn").addEventListener("click", NotificationResize, {
  1453. passive: true
  1454. });
  1455. } else {
  1456. ChatLogElement.querySelector(".notifbtn").removeEventListener("click", NotificationResize, {
  1457. passive: true
  1458. });
  1459. }
  1460. UpdateScroll(1, true);
  1461. UpdateScroll(2, true);
  1462. }
  1463.  
  1464. function NotificationResize() {
  1465. ChatLogElement.querySelector("#notification-content").classList.toggle("large");
  1466. if (ChatLogElement.querySelector(".notifbtn").innerText === "▼") {
  1467. ChatLogElement.querySelector(".notifbtn").innerText = "▲";
  1468. ChatLogElement.querySelector("#chat").style.height = "50%%";
  1469. } else {
  1470. ChatLogElement.querySelector(".notifbtn").innerText = "▼";
  1471. ChatLogElement.querySelector("#chat").style.height = "100%";
  1472. }
  1473. UpdateScroll(1, false);
  1474. UpdateScroll(2, true);
  1475. }
  1476.  
  1477. function Dice() {
  1478. return String.fromCharCode("0x268" + Rand(0, 5));
  1479. }
  1480.  
  1481. function Rand() {
  1482. arguments[0] = Math.ceil(arguments[0]);
  1483. arguments[1] = Math.floor(arguments[1]);
  1484. return Math.floor(Math.random() * (arguments[1] - arguments[0] + 1)) + arguments[0];
  1485. }
  1486.  
  1487. function OpenMicrophone() {
  1488. MicrophoneElement.initMouseEvent("mousedown");
  1489. VideoListElement.querySelector("#videos-footer-push-to-talk").dispatchEvent(MicrophoneElement);
  1490. }
  1491.  
  1492. function Cameras() {
  1493. var Camera = VideoListElement.querySelectorAll(".videos-items tc-video-item"),
  1494. Len = Camera.length;
  1495. for (var user = 0; user < Len; user++) {
  1496. var isIgnored = User(Camera[user].shadowRoot.querySelector(".video > div > video").getAttribute("data-video-id"));
  1497. if (CheckUserIgnore(isIgnored) || CheckUserTempIgnore(isIgnored) && !Camera[user].shadowRoot.querySelector(".not-visible")) Camera[user].shadowRoot.querySelector("button[class=\"icon-visibility\"]").click();
  1498. Camera[user].shadowRoot.querySelector(".video").style.padding = (CTS.CameraBorderToggle) ? "5px" : "0";
  1499. 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>");
  1500. }
  1501. Resize();
  1502. }
  1503.  
  1504. function FeaturedCameras() {
  1505. if (arguments[0] === true) {
  1506. if (VideoListElement.querySelector("#SmallFTYT")) {
  1507. Remove(VideoListElement, "#SmallFTYT");
  1508. }
  1509. } else {
  1510. var node = document.createElement("style");
  1511. node.appendChild(document.createTextNode(FeaturedCSS));
  1512. node.setAttribute("id", "SmallFTYT");
  1513. VideoListElement.appendChild(node);
  1514. }
  1515. }
  1516.  
  1517. function Resize() {
  1518. window.dispatchEvent(new Event("resize"));
  1519. }
  1520.  
  1521. function PerformanceModeInit() {
  1522. if (!CTS.ThemeChange) {
  1523. var value = ((arguments[0]) ? "100%" : "calc(400px + " + CTS.ChatWidth + "%)");
  1524. ChatLogElement.querySelector("#chat-wrapper").style.minWidth = value;
  1525. ChatLogElement.querySelector("#chat-wrapper").style.maxWidth = value;
  1526. ChatLogElement.querySelector("#chat-wrapper").style.width = value;
  1527. TitleElement.querySelector("#room-header").style.minWidth = value;
  1528. TitleElement.querySelector("#room-header").style.maxWidth = value;
  1529. TitleElement.querySelector("#room-header").style.width = value;
  1530. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.minWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  1531. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.maxWidth = ((!CTS.ChatDisplay) ? "100%" : value);
  1532. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.width = ((!CTS.ChatDisplay) ? "100%" : value);
  1533. VideoListElement.querySelector("#videos-header").style.minWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1534. VideoListElement.querySelector("#videos-header").style.maxWidth = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1535. VideoListElement.querySelector("#videos-header").style.width = ((!CTS.UserListDisplay) ? "calc(" + value + " - 54px)" : value);
  1536. SideMenuElement.querySelector("#sidemenu").style.minWidth = value;
  1537. SideMenuElement.querySelector("#sidemenu").style.maxWidth = value;
  1538. SideMenuElement.querySelector("#sidemenu").style.width = value;
  1539. document.querySelector("#content").style.width = ((!arguments[0]) ? "calc(100% " + (CTS.ChatDisplay ? "- (400px + " + CTS.ChatWidth + "%)" : "") + ")" : "0%");
  1540. VideoListElement.querySelector("#videos").style.display = ((!arguments[0]) ? "block!important" : "none!important");
  1541.  
  1542. } else {
  1543. if (arguments[0]) {
  1544. VideoListElement.querySelector("#videos-content").style.display = "none";
  1545. ChatLogElement.querySelector("#chat-wrapper").style.width ="100%";
  1546. ChatLogElement.querySelector("#chat-wrapper").style.position = "fixed";
  1547. ChatLogElement.querySelector("#chat-wrapper").style.left = "0";
  1548. ChatLogElement.querySelector("#chat-wrapper").style.bottom = "0";
  1549. ChatLogElement.querySelector("#chat-wrapper").style.minHeight = "100%";
  1550. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.display = "none";
  1551. VideoListElement.querySelector("#videos-header").style.display = "none";
  1552. VideoListElement.querySelector("#videos-footer").style.display = "none";
  1553. } else {
  1554. VideoListElement.querySelector("#videos-content").style.removeProperty("display");
  1555. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("width");
  1556. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("position");
  1557. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("left");
  1558. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("bottom");
  1559. ChatLogElement.querySelector("#chat-wrapper").style.removeProperty("min-height");
  1560. VideoListElement.querySelector("#videos-footer-broadcast-wrapper").style.removeProperty("display");
  1561. VideoListElement.querySelector("#videos-header").style.removeProperty("display");
  1562. VideoListElement.querySelector("#videos-footer").style.removeProperty("display");
  1563. }
  1564. }
  1565. UpdateScroll(1, true);
  1566. UpdateScroll(2, true);
  1567. Resize();
  1568. }
  1569.  
  1570. function OwnerCommand() {
  1571. //MESSAGE FROM OWNER
  1572. if (isCommand(arguments[1])) {
  1573. if (CTS.UserList[arguments[0]].owner) {
  1574. if (!CTS.Me.owner) {
  1575. //PROCEED WITH CAUTION (YOU SEND A SWARM OF USERS TO ANOTHER ROOM) - COME SAY HI
  1576. if (arguments[1].match(/^!raid\s/i)) {
  1577. var raid = arguments[1].match(/^(?:\!raid\s)(https?:\/\/tinychat.com(?!\/#)\/(?!gifts|settings|coins|subscription|promote)(?:room\/)?(?:[a-z0-9_]){1,32})/i);
  1578. if (raid !== null) window.location.replace(raid[1]);
  1579. }
  1580. if (arguments[1].match(/^!version$/i)) Send("pvtmsg", "I am using " + CTS.Project.Name + "v" + Ver(), CTS.UserList[arguments[0]].handle);
  1581. } else {
  1582. if (arguments[1].match(/^!closeall$/i)) {
  1583. for (var a = 0; a < CTS.Camera.List.length; a++) {
  1584. if (CTS.Me.handle !== CTS.Camera.List[a]) Send("stream_moder_close", CTS.Camera.List[a]);
  1585. }
  1586. }
  1587. if (arguments[1].match(/^!kickall$/i)) {
  1588. for (var b = 0; b < CTS.UserList.length; b++) {
  1589. if (CTS.Me.handle !== CTS.UserList[b].handle) Send("kick", CTS.UserList[b].handle);
  1590. }
  1591. }
  1592. }
  1593. }
  1594. }
  1595. }
  1596.  
  1597. function Command() {
  1598. var UserCommand = arguments[0].match(/^!([a-z0-9]*)(?:\s?)(.*)/i);
  1599. if (UserCommand) {
  1600. if (typeof CommandList[UserCommand[1].toLowerCase()] == "function") {
  1601. debug("COMMAND::" + ((arguments[1]) ? "PM" : "MAIN"), UserCommand[1] + ":" + UserCommand[2]);
  1602. CommandList[UserCommand[1].toLowerCase()](UserCommand[2], arguments[1]);
  1603. }
  1604. }
  1605. }
  1606. //ALERT FUNCTIONS
  1607. function Settings() {
  1608. 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>");
  1609. }
  1610.  
  1611. function Alert() {
  1612. CTS.Message[arguments[0]].push({
  1613. "time": Time(),
  1614. "namecolor": (arguments[2] !== undefined) ? "#000000" : "#3f69c0",
  1615. "avatar": (arguments[2] !== undefined) ? ("") : ("https://i.imgur.com/S09irS7.png"),
  1616. "username": "",
  1617. "nick": (arguments[2] !== undefined) ? (arguments[2]) : ("CTS Version: " + Ver()),
  1618. "msg": ((arguments[2] !== undefined) ? ("<div id=\"system_user\">" + arguments[1] + "</div>") : arguments[1]),
  1619. "mention": ((arguments[2] !== undefined) ? false : true)
  1620. });
  1621. var len = CTS.Message[arguments[0]].length - 1;
  1622. arguments[1] = CTS.Message[arguments[0]][len];
  1623. CreateMessage(arguments[1].time, arguments[1].namecolor, arguments[1].avatar, arguments[1].username, arguments[1].nick, arguments[1].msg, arguments[1].mention, arguments[0]);
  1624. }
  1625.  
  1626. function Ver() {
  1627. return window.CTSVersion.Major + "." + window.CTSVersion.Minor + "." + window.CTSVersion.Patch;
  1628. }
  1629.  
  1630. function AddUserNotification() {
  1631. if (CTS.FullLoad && CTS.ShowedSettings) {
  1632. var chat = ChatLogElement.querySelector("#notification-content"),
  1633. Notification;
  1634. CTS.NotificationScroll = (Math.floor(chat.scrollTop) + 5 >= (chat.scrollHeight - chat.offsetHeight)) ? true : false;
  1635. if (arguments[0] == 1) {
  1636. Notification = arguments[3] + ((arguments[4]) ? " is " : " has stopped ") + "broadcasting!";
  1637. } else if (arguments[0] == 2) {
  1638. Notification = arguments[3] + " has " + ((!arguments[4]) ? "joined!" : "left");
  1639. } else if (arguments[0] == 3) {
  1640. Notification = arguments[2] + "has mentioned you!";
  1641. 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>");
  1642. UpdateScroll(2, true);
  1643. } else if (arguments[0] == 4) {
  1644. Notification = "with the account name " + arguments[3] + " changed their name to " + arguments[5];
  1645. }
  1646. 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>");
  1647. if (CTS.NotificationToggle == 1) Alert(0, Notification, arguments[2]);
  1648. 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);
  1649. UpdateScroll(2, false);
  1650. var Notifications = ChatLogElement.querySelectorAll(".notification");
  1651. if (Notifications.length > CTS.NotificationLimit + 25) {
  1652. for (var NotificationIndex = 0; NotificationIndex < Notifications.length - CTS.NotificationLimit; NotificationIndex++) Notifications[NotificationIndex].parentNode.removeChild(Notifications[NotificationIndex]);
  1653. }
  1654. }
  1655. }
  1656.  
  1657. function AddSystemNotification() {
  1658. if (CTS.FullLoad && CTS.ShowedSettings) {
  1659. if (CTS.NotificationToggle == 0) {
  1660. 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>");
  1661. } else if (CTS.NotificationToggle == 1) {
  1662. Alert(0, arguments[0], "SYSTEM");
  1663. }
  1664. if (CTS.TTS.synth !== undefined && (CTS.TTSList.includes("-ALL") || CTS.TTSList.includes("-EVENT"))) TTS(arguments[0]);
  1665. UpdateScroll(2, false);
  1666. }
  1667. }
  1668. //USER FUNCTION
  1669. function AddUser() {
  1670. CTS.UserList.push({
  1671. "handle": arguments[0],
  1672. "username": arguments[5],
  1673. "nick": arguments[4],
  1674. "owner": arguments[7],
  1675. "mod": arguments[1],
  1676. "namecolor": arguments[2],
  1677. "avatar": arguments[3],
  1678. "canGame": arguments[6],
  1679. "broadcasting": false,
  1680. "vote": 0
  1681. });
  1682. if (CTS.ScriptInit) AddUserNotification(2, arguments[2], arguments[4], arguments[5], false);
  1683. }
  1684.  
  1685. function User() {
  1686. for (var user = 0; user < CTS.UserList.length; user++) {
  1687. if (CTS.UserList[user].handle == arguments[0]) return user;
  1688. }
  1689. return -1;
  1690. }
  1691.  
  1692. function UsernameToHandle() {
  1693. for (var user = 0; user < CTS.UserList.length; user++) {
  1694. if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return CTS.UserList[user].handle;
  1695. }
  1696. return -1;
  1697. }
  1698.  
  1699. function UsernameToUser() {
  1700. for (var user = 0; user < CTS.UserList.length; user++) {
  1701. if (CTS.UserList[user].username.toUpperCase() == arguments[0] || CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  1702. }
  1703. return -1;
  1704. }
  1705.  
  1706. function NicknameToAccount() {
  1707. for (var user = 0; user < CTS.UserList.length; user++) {
  1708. if (CTS.UserList[user].nick.toUpperCase() == arguments[0]) return user;
  1709. }
  1710. return -1;
  1711. }
  1712.  
  1713. function CheckUserListSafe() {
  1714. var len = CTS.UserList.length;
  1715. var temp = [];
  1716. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1717. for (var user = 0; user < len; user++) {
  1718. if (!CTS.UserList[user].mod && !isSafeListed(CTS.UserList[user].username)) {
  1719. CTS.KBQueue.push(CTS.UserList[user].handle);
  1720. }
  1721. }
  1722. len = CTS.KBQueue.length;
  1723. for (var kb = 0; kb < len; kb++) {
  1724. Send(arguments[0], CTS.KBQueue[kb]);
  1725. }
  1726. CTS.KBQueue = [];
  1727. }
  1728.  
  1729. function isSafeListed() {
  1730. var temp = [];
  1731. if (Addon.active("AKB")) temp = Addon.get("AKB");
  1732. return (CTS.SafeList.includes(arguments[0]) || temp.includes(arguments[0]));
  1733. }
  1734.  
  1735. function CheckUserTempIgnore() {
  1736. if (CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.TempIgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1737. return false;
  1738. }
  1739.  
  1740. function CheckUserIgnore() {
  1741. if (CTS.IgnoreList.includes(CTS.UserList[arguments[0]].username) || CTS.IgnoreList.includes(CTS.UserList[arguments[0]].nick.toUpperCase())) return true;
  1742. return false;
  1743. }
  1744.  
  1745. function CheckUserTouchScreen() {
  1746. if (/Mobi|Android/i.test(navigator.userAgent) || 'ontouchstart' in document.documentElement) {
  1747. CTS.Project.isTouchScreen = true;
  1748. CTS.ThemeChange = true;
  1749. }
  1750. }
  1751.  
  1752. function CheckUserAbuse() {
  1753. var action = false;
  1754. if (CTS.Me.mod) {
  1755. if ((CTS.KickList.includes(arguments[1]) || CTS.KickList.includes(arguments[2]))) {
  1756. CTS.NoGreet = true;
  1757. Send("kick", arguments[0]);
  1758. action = true;
  1759. }
  1760. if (!action) {
  1761. if ((CTS.BanList.includes(arguments[1]) || CTS.BanList.includes(arguments[2]))) {
  1762. CTS.NoGreet = true;
  1763. Send("ban", arguments[0]);
  1764. }
  1765. }
  1766. }
  1767. }
  1768.  
  1769. function CheckUserWordAbuse() {
  1770. if (CTS.UserList[arguments[0]].handle != CTS.Me.handle && !CTS.UserList[arguments[0]].mod) {
  1771. var action = false; //LETS NOT REPEAT/KICK
  1772. var len = CTS.KickKeywordList.length;
  1773. for (var i = 0; i < len; i++) {
  1774. if (arguments[1].includes(CTS.KickKeywordList[i])) {
  1775. Send("kick", CTS.UserList[arguments[0]].handle);
  1776. action = true;
  1777. break;
  1778. }
  1779. }
  1780. if (!action) {
  1781. len = CTS.BanKeywordList.length;
  1782. for (i = 0; i < len; i++) {
  1783. if (arguments[1].includes(CTS.BanKeywordList[i])) {
  1784. Send("ban", CTS.UserList[arguments[0]].handle);
  1785. break;
  1786. }
  1787. }
  1788. }
  1789. }
  1790. }
  1791.  
  1792. function RemoveUserCamera() {
  1793. var len = CTS.Camera.List.length;
  1794. if (len > 0) {
  1795. for (var i = 0; i < len; i++) {
  1796. if (CTS.Camera.List[i] === arguments[0]) {
  1797. CTS.Camera.List.splice(i, 1);
  1798. clearTimeout(CTS.Camera.clearRandom);
  1799. break;
  1800. }
  1801. }
  1802. }
  1803. }
  1804.  
  1805. function CheckUserStream() {
  1806. if (CTS.Me.mod) {
  1807. var user = User(arguments[0]);
  1808. if (user != -1) {
  1809. if (arguments[1]) {
  1810. //PUSH UPDATE
  1811. CTS.Camera.List.push(CTS.UserList[user].handle);
  1812. CTS.UserList[user].broadcasting = true;
  1813. var len = CTS.Camera.List.length;
  1814. if (CTS.UserList[user].username !== "GUEST" && !CTS.GreenRoomList.includes(CTS.UserList[user].username)) {
  1815. CTS.GreenRoomList.push(CTS.UserList[user].username);
  1816. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  1817. }
  1818. //CLEAR TIMERS
  1819. clearTimeout(CTS.Camera.clearRandom);
  1820. //CAMERA SWEEP FUNCTION
  1821. if (len >= 12 && CTS.Me.handle === CTS.Host && CTS.Camera.Sweep) {
  1822. CTS.Camera.clearRandom = setTimeout(function() {
  1823. var rand = Rand(0, len - 1);
  1824. if (CTS.Camera.List[rand] !== CTS.Me.handle && CTS.Camera.Sweep) {
  1825. var target = User(CTS.Camera.List[rand]);
  1826. if (CTS.Me.owner || !CTS.UserList[target].mod) {
  1827. Send("msg", "[Camera Clear]\n" + CTS.UserList[target].nick + "!\nYou've been randomly selected. You win, a cam close!");
  1828. Send("stream_moder_close", CTS.Camera.List[rand]);
  1829. CTS.Camera.List.splice(rand, 1);
  1830. }
  1831. }
  1832. }, CTS.Camera.SweepTimer * 60000);
  1833. }
  1834. } else {
  1835. clearTimeout(CTS.Camera.clearRandom);
  1836. RemoveUserCamera(CTS.UserList[user].handle);
  1837. CTS.UserList[user].broadcasting = false;
  1838. }
  1839. CTS.UserList[user].broadcasting = arguments[1];
  1840. if (CTS.ScriptInit) AddUserNotification(1, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, arguments[1]);
  1841. }
  1842. }
  1843. }
  1844.  
  1845. function CheckUserName() {
  1846. return arguments[0].match(/^(-all|[a-z0-9_]{1,32})$/i);
  1847. }
  1848.  
  1849. function CheckUserNameStrict() {
  1850. return arguments[0].match(/^([a-z0-9_]{1,32})$/i);
  1851. }
  1852.  
  1853. function MSR() {
  1854. if (arguments[0]) {
  1855. arguments[1].videolist.RemoveVideoRemote(arguments[1].handle);
  1856. } else {
  1857. arguments[1].mediaStream.stop();
  1858. arguments[1].mediaStream = null;
  1859. }
  1860. }
  1861.  
  1862. function MS() {
  1863. if (arguments[0].mediaStream !== null) {
  1864. if (arguments[0].mediaStream.active && arguments[1].signalingState !== "closed" && typeof arguments[1].removeStream === "function" && arguments[1].removeStream(arguments[0].mediaStream)) MSR(false, arguments[0]);
  1865. } else {
  1866. MSR(true, arguments[0]);
  1867. }
  1868. if (arguments[1].signalingState !== "closed" && arguments[1].close());
  1869. }
  1870. //LOAD/SAVE FUNCTION
  1871. function Load() {
  1872. var val = localStorage.getItem(CTS.Project.Storage + arguments[0]);
  1873. if (null === val && "undefined" != typeof arguments[1]) {
  1874. Save(arguments[0], arguments[1]);
  1875. return arguments[1];
  1876. }
  1877. return val;
  1878. }
  1879.  
  1880. function Save() {
  1881. localStorage.setItem(CTS.Project.Storage + arguments[0], arguments[1]);
  1882. }
  1883. //SOCKET FUNCTION
  1884. function CTSWebSocket() {
  1885. if (window.Proxy === undefined) return;
  1886. var handler = {
  1887. set: function(Target, prop, value) {
  1888. if (prop == "onmessage") {
  1889. var oldMessage = value;
  1890. value = function(event) {
  1891. ServerMsg(JSON.parse(event.data), Target);
  1892. oldMessage(event);
  1893. };
  1894. }
  1895. return (Target[prop] = value);
  1896. },
  1897. get: function(Target, prop) {
  1898. var value = Target[prop];
  1899. if (prop == "send") {
  1900. value = function(event) {
  1901. ClientMsg(JSON.parse(event), Target);
  1902. Target.send(event);
  1903. };
  1904. } else if (typeof value == 'function') {
  1905. value = value.bind(Target);
  1906. }
  1907. return value;
  1908. }
  1909. };
  1910. var WebSocketProxy = new window.Proxy(window.WebSocket, {
  1911. construct: function(Target, args) {
  1912. CTS.SocketTarget = new Target(args[0]);
  1913. debug("SOCKET::CONNECTING", args[0]);
  1914. return new window.Proxy(CTS.SocketTarget, handler);
  1915. }
  1916. });
  1917. window.WebSocket = WebSocketProxy;
  1918. }
  1919.  
  1920. function ModCommand() {
  1921. var name = arguments[1].match(/\!(?:kick|ban|close)\s(guest-[0-9]{1,26}|[a-z0-9_]{1,32})$/i);
  1922. if (name !== null) {
  1923. var target = UsernameToUser(name[1].toUpperCase());
  1924. if (target != -1) { // USER ONLINE
  1925. if (CTS.UserList[target].handle !== CTS.Me.handle && !CTS.BotModList.includes(CTS.UserList[target].username) && !CTS.UserList[target].mod) {
  1926. //IF USER IS NOT HOST/MODERATOR/JR.MODERATOR
  1927. if (arguments[0] === "stream_moder_close") {
  1928. if (CTS.UserList[target].broadcasting) Send(arguments[0], CTS.UserList[target].handle);
  1929. } else {
  1930. Send(arguments[0], CTS.UserList[target].handle);
  1931. }
  1932. } else {
  1933. Send("msg", "This users authorization is similar or above yours!");
  1934. }
  1935. }
  1936. }
  1937. }
  1938.  
  1939. function BotCommand() {
  1940. var len = CTS.YouTube.MessageQueueList.length;
  1941. if (len <= 0) {
  1942. // Moderator Control
  1943. if (CTS.UserList[arguments[1]].mod) {
  1944. if (arguments[0] == 2) {
  1945. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1946. CTS.YouTube.Clear = true;
  1947. YouTubePlayList();
  1948. }
  1949. }
  1950. if (arguments[0] == 5) SetBot(true);
  1951. }
  1952. // User and Moderator Control
  1953. if ((CTS.UserYT && CTS.SafeList.includes(CTS.UserList[arguments[1]].username) && (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)) {
  1954. if (arguments[0] == 1) CheckYouTube(arguments[2], true, undefined, CTS.UserList[arguments[1]].mod);
  1955. if (arguments[0] == 4) YouTubePlayList(true);
  1956. if (arguments[0] == 6) {
  1957. if (CTS.UserList[arguments[1]].mod || CTS.BotModList.includes(CTS.UserList[arguments[1]].username)) {
  1958. 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);
  1959. if (videoid !== null) {
  1960. CTS.SocketTarget.send(JSON.stringify({
  1961. "tc": "yut_play",
  1962. "item": {
  1963. "id": videoid[1],
  1964. "duration": 7200,
  1965. "offset": 0,
  1966. "title": "YOUTUBE IS BYPASSED - MODS ONLY"
  1967. }
  1968. }));
  1969. debug("YOUTUBE::LINK BYPASS", videoid[1]);
  1970. }
  1971. } else {
  1972. Send("msg", "Ask a moderator to play your request.");
  1973. }
  1974. }
  1975. if (arguments[0] == 3) {
  1976. if (CTS.YouTube.CurrentTrack.ID !== undefined) {
  1977. Send("yut_stop", [CTS.YouTube.CurrentTrack.ID, CTS.YouTube.CurrentTrack.duration, CTS.YouTube.CurrentTrack.title, CTS.YouTube.CurrentTrack.thumbnail, 0]);
  1978. Send("msg", "🎵" + CTS.YouTube.CurrentTrack.title + " has been skipped!🎵");
  1979. }
  1980. }
  1981. }
  1982. } else {
  1983. if (CTS.YouTube.ListBuilt === false) {
  1984. Send("msg", "🎵 Playlist search is happening, please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks found.");
  1985. } else {
  1986. Send("msg", "🎵 Playlist items are being added,a please wait! 🎵\n" + CTS.YouTube.MessageQueueList.length + " tracks remaining.");
  1987. }
  1988. }
  1989. }
  1990.  
  1991. function ServerMsg() {
  1992. if (typeof ServerInList[arguments[0].tc] == "function") {
  1993. debug(("SERVER::" + arguments[0].tc.toUpperCase()), arguments[0]);
  1994. ServerInList[arguments[0].tc](arguments[0]);
  1995. }
  1996. }
  1997.  
  1998. function ClientMsg() {
  1999. if (typeof ServerOutList[arguments[0].tc] == "function") {
  2000. debug(("CLIENT::" + arguments[0].tc.toUpperCase()), arguments[0]);
  2001. ServerOutList[arguments[0].tc](arguments[0]);
  2002. }
  2003. }
  2004.  
  2005. function Send() {
  2006. ServerSendList[arguments[0]](arguments[0], arguments[1], arguments[2]);
  2007. if (arguments[1] === undefined) arguments[1] = "Open Request";
  2008. debug(("CLIENT::SEND::" + arguments[0].toUpperCase()), arguments[1]);
  2009. }
  2010. //GAME FUNCTION
  2011. //FISHING BOAT
  2012. function FishUpgradeStatus(playerExist, type) {
  2013. var msg = "[FISHING BOAT]\n";
  2014. if (type != 7) msg += playerExist.Nickname + ":\n";
  2015. 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");
  2016. 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";
  2017. if (type == 0 || type == 3) msg += "[INSURANCE]\n" + ((playerExist.Upgrades.Insurance) ? "[OWNED]" : "[COSTS $" + Fish.pricelist(playerExist, 3) + " per ROUND]") + "\n\n";
  2018. 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";
  2019. 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";
  2020. Send("msg", msg);
  2021. }
  2022.  
  2023. function FishTimerCheck(playerExist) {
  2024. if (new Date() - playerExist.LastCheck >= 5000) {
  2025. playerExist.LastCheck = new Date();
  2026. return true;
  2027. }
  2028. return false;
  2029. }
  2030.  
  2031. function FishCommandCheck() {
  2032. var command,
  2033. playerExist = Fish.getPlayer(CTS.UserList[arguments[0]].handle, false, true),
  2034. FishCommand = arguments[1].match(/^\!(fish(?:rob|slap|split|help|upgrade)?)\s?(?:([a-z0-9_]*)|net|shop|radar|insurance)?$/i);
  2035. if (FishCommand) {
  2036. if (FishCommand[1] === "fishslap" || FishCommand[1] === "fishrob" || FishCommand[1] === "fishsplit") {
  2037. if (FishCommand[2] !== undefined) {
  2038. if (typeof FishList[FishCommand[1].toLowerCase()] == "function") FishList[FishCommand[1].toLowerCase()](playerExist, FishCommand[2]);
  2039. }
  2040. } else {
  2041. command = ((FishCommand[2] !== undefined) ? FishCommand[1] + FishCommand[2] : FishCommand[1]);
  2042. if (typeof FishList[command.toLowerCase()] == "function") FishList[command.toLowerCase()](playerExist, CTS.UserList[arguments[0]]);
  2043. }
  2044. }
  2045. }
  2046.  
  2047. function FishTransfer(playerExist, target, cost, deduct, rob) {
  2048. if (target !== undefined && target !== -1) {
  2049. if (playerExist.Points > cost) {
  2050. if (rob) {
  2051. playerExist.Points -= cost;
  2052. if (target.Points <= deduct) {
  2053. deduct = target.Points;
  2054. target.Points -= deduct;
  2055. playerExist.Points += deduct;
  2056. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " destroyed " + target.Nickname + "\nMoney made $" + deduct + "!");
  2057. Fish.getPlayer(target.Handle, true);
  2058. } else {
  2059. target.Points -= deduct;
  2060. playerExist.Points += deduct;
  2061. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " robbed " + target.Nickname + " for $" + deduct + "!");
  2062. }
  2063. } else {
  2064. playerExist.Points = deduct;
  2065. target.Points += deduct;
  2066. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " split their money with " + target.Nickname + "!");
  2067. }
  2068. } else {
  2069. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " are you kidding me?\nTalk to me when you have money!");
  2070. }
  2071. }
  2072. }
  2073.  
  2074. function FishTransaction(playerExist, cost, status) {
  2075. if (playerExist.Points > cost) {
  2076. playerExist.Points -= cost;
  2077. return true;
  2078. } else {
  2079. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + ", are you kidding me?\nTalk to me when you have money!");
  2080. return false;
  2081. }
  2082. }
  2083. //SERVER/CLIENT LIST FUNCTION
  2084. var UnicodeConversionList = {
  2085. convert: function() {
  2086. return this.numerical(arguments[0]).replace(/[A-Za-z]/g, this.alphabet);
  2087. },
  2088. alphabet: function() {
  2089. return String.fromCodePoint(arguments[0].codePointAt(0) + ((/[A-Z]/.test(arguments[0])) ? "𝗔".codePointAt(0) - "A".codePointAt(0) : "𝗮".codePointAt(0) - "a".codePointAt(0)));
  2090. },
  2091. numerical: function() {
  2092. return arguments[0].replace(/\d/g, function(c) {
  2093. return String.fromCodePoint(0x1D79E + c.charCodeAt(0));
  2094. });
  2095. }
  2096. };
  2097. var CommandList = {
  2098. cts: function() {
  2099. 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!greenroomignorelist\n!greenroomignorelistclear\n!greenroomignoreadd <b style=\"color:#ffff00;\">user</b>\n!greenroomignoreremove <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");
  2100. },
  2101. help: function() {
  2102. this.cts();
  2103. },
  2104. mentionadd: function() {
  2105. if (arguments[0] === "") {
  2106. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2107. } else {
  2108. if (CheckUserNameStrict(arguments[0])) {
  2109. CTS.MentionList.push(arguments[0].toUpperCase());
  2110. Save("MentionList", JSON.stringify(CTS.MentionList));
  2111. Alert(GetActiveChat(), "🗹Command Accepted!");
  2112. } else {
  2113. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2114. }
  2115. }
  2116. },
  2117. mentionremove: function() {
  2118. if (arguments[0] === "" || isNaN(arguments[0])) {
  2119. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2120. } else {
  2121. if (CTS.MentionList[arguments[0]] !== undefined) {
  2122. CTS.MentionList.splice(arguments[0], 1);
  2123. Save("MentionList", JSON.stringify(CTS.MentionList));
  2124. Alert(GetActiveChat(), "🗹Command Accepted!");
  2125. } else {
  2126. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2127. }
  2128. }
  2129. },
  2130. mentionlistclear: function() {
  2131. CTS.MentionList = [];
  2132. Save("MentionList", JSON.stringify(CTS.MentionList));
  2133. Alert(GetActiveChat(), "🗹Command Accepted!");
  2134. },
  2135. mentionlist: function() {
  2136. Alert(GetActiveChat(), SettingsList.MentionList());
  2137. },
  2138. ignoreadd: function() {
  2139. if (arguments[0] === "") {
  2140. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2141. } else {
  2142. if (CheckUserNameStrict(arguments[0])) {
  2143. CTS.IgnoreList.push(arguments[0].toUpperCase());
  2144. Cameras();
  2145. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2146. Alert(GetActiveChat(), "🗹Command Accepted!");
  2147. } else {
  2148. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2149. }
  2150. }
  2151. },
  2152. ignoreremove: function() {
  2153. if (arguments[0] === "" || isNaN(arguments[0])) {
  2154. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2155. } else {
  2156. if (CTS.IgnoreList[arguments[0]] !== undefined) {
  2157. CTS.IgnoreList.splice(arguments[0], 1);
  2158. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2159. Alert(GetActiveChat(), "🗹Command Accepted!");
  2160. } else {
  2161. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2162. }
  2163. }
  2164. },
  2165. ignorelistclear: function() {
  2166. CTS.IgnoreList = [];
  2167. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2168. Alert(GetActiveChat(), "🗹Command Accepted!");
  2169. },
  2170. ignorelist: function() {
  2171. Alert(GetActiveChat(), SettingsList.IgnoreList());
  2172. },
  2173. banadd: function() {
  2174. if (arguments[0] === "") {
  2175. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2176. } else {
  2177. if (CheckUserNameStrict(arguments[0])) {
  2178. CTS.BanList.push(arguments[0].toUpperCase());
  2179. Save("BanList", JSON.stringify(CTS.BanList));
  2180. Alert(GetActiveChat(), "🗹Command Accepted!");
  2181. var check = UsernameToHandle(arguments[0].toUpperCase());
  2182. if (check != -1 && CTS.Me.mod) Send("ban", check);
  2183. } else {
  2184. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2185. }
  2186. }
  2187. },
  2188. banremove: function() {
  2189. if (arguments[0] === "" || isNaN(arguments[0])) {
  2190. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2191. } else {
  2192. if (CTS.BanList[arguments[0]] !== undefined) {
  2193. CTS.BanList.splice(arguments[0], 1);
  2194. Save("BanList", JSON.stringify(CTS.BanList));
  2195. Alert(GetActiveChat(), "🗹Command Accepted!");
  2196. } else {
  2197. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2198. }
  2199. }
  2200. },
  2201. banlistclear: function() {
  2202. CTS.BanList = [];
  2203. Save("BanList", JSON.stringify(CTS.BanList));
  2204. Alert(GetActiveChat(), "🗹Command Accepted!");
  2205. },
  2206. banlist: function() {
  2207. Alert(GetActiveChat(), SettingsList.BanList());
  2208. },
  2209. kickadd: function() {
  2210. if (arguments[0] === "") {
  2211. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2212. } else {
  2213. if (CheckUserNameStrict(arguments[0])) {
  2214. CTS.KickList.push(arguments[0].toUpperCase());
  2215. Save("KickList", JSON.stringify(CTS.KickList));
  2216. Alert(GetActiveChat(), "🗹Command Accepted!");
  2217. var check = UsernameToHandle(arguments[0].toUpperCase());
  2218. if (check != -1 && CTS.Me.mod) Send("kick", check);
  2219. } else {
  2220. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2221. }
  2222. }
  2223. },
  2224. kickremove: function() {
  2225. if (arguments[0] === "" || isNaN(arguments[0])) {
  2226. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2227. } else {
  2228. if (CTS.KickList[arguments[0]] !== undefined) {
  2229. CTS.KickList.splice(arguments[0], 1);
  2230. Save("KickList", JSON.stringify(CTS.KickList));
  2231. Alert(GetActiveChat(), "🗹Command Accepted!");
  2232. } else {
  2233. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2234. }
  2235. }
  2236. },
  2237. kicklistclear: function() {
  2238. CTS.KickList = [];
  2239. Save("KickList", JSON.stringify(CTS.KickList));
  2240. Alert(GetActiveChat(), "🗹Command Accepted!");
  2241. },
  2242. kicklist: function() {
  2243. Alert(GetActiveChat(), SettingsList.KickList());
  2244. },
  2245. bankeywordadd: function() {
  2246. if (arguments[0] === "") {
  2247. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2248. } else {
  2249. CTS.BanKeywordList.push(arguments[0]);
  2250. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2251. Alert(GetActiveChat(), "🗹Command Accepted!");
  2252. }
  2253. },
  2254. bankeywordremove: function() {
  2255. if (arguments[0] === "" || isNaN(arguments[0])) {
  2256. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2257. } else {
  2258. if (CTS.BanKeywordList[arguments[0]] !== undefined) {
  2259. CTS.BanKeywordList.splice(arguments[0], 1);
  2260. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2261. Alert(GetActiveChat(), "🗹Command Accepted!");
  2262. } else {
  2263. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2264. }
  2265. }
  2266. },
  2267. bankeywordlistclear: function() {
  2268. CTS.BanKeywordList = [];
  2269. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2270. Alert(GetActiveChat(), "🗹Command Accepted!");
  2271. },
  2272. bankeywordlist: function() {
  2273. Alert(GetActiveChat(), SettingsList.BanKeywordList());
  2274. },
  2275. kickkeywordadd: function() {
  2276. if (arguments[0] === "") {
  2277. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2278. } else {
  2279. CTS.KickKeywordList.push(arguments[0]);
  2280. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2281. Alert(GetActiveChat(), "🗹Command Accepted!");
  2282. }
  2283. },
  2284. kickkeywordremove: function() {
  2285. if (arguments[0] === "" || isNaN(arguments[0])) {
  2286. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2287. } else {
  2288. if (CTS.KickKeywordList[arguments[0]] !== undefined) {
  2289. CTS.KickKeywordList.splice(arguments[0], 1);
  2290. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2291. Alert(GetActiveChat(), "🗹Command Accepted!");
  2292. } else {
  2293. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2294. }
  2295. }
  2296. },
  2297. kickkeywordlistclear: function() {
  2298. CTS.KickKeywordList = [];
  2299. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2300. Alert(GetActiveChat(), "🗹Command Accepted!");
  2301. },
  2302. kickkeywordlist: function() {
  2303. Alert(GetActiveChat(), SettingsList.KickKeywordList());
  2304. },
  2305. greetadd: function() {
  2306. if (arguments[0] === "") {
  2307. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2308. } else {
  2309. if (CheckUserName(arguments[0])) {
  2310. CTS.GreetList.push(arguments[0].toUpperCase());
  2311. Save("GreetList", JSON.stringify(CTS.GreetList));
  2312. Alert(GetActiveChat(), "🗹Command Accepted!");
  2313. } else {
  2314. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2315. }
  2316. }
  2317. },
  2318. greetremove: function() {
  2319. if (arguments[0] === "" || isNaN(arguments[0])) {
  2320. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2321. } else {
  2322. if (CTS.GreetList[arguments[0]] !== undefined) {
  2323. CTS.GreetList.splice(arguments[0], 1);
  2324. Save("GreetList", JSON.stringify(CTS.GreetList));
  2325. Alert(GetActiveChat(), "🗹Command Accepted!");
  2326. } else {
  2327. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2328. }
  2329. }
  2330. },
  2331. greetlistclear: function() {
  2332. CTS.GreetList = [];
  2333. Save("GreetList", JSON.stringify(CTS.GreetList));
  2334. Alert(GetActiveChat(), "🗹Command Accepted!");
  2335. },
  2336. greetlist: function() {
  2337. Alert(GetActiveChat(), SettingsList.GreetList());
  2338. },
  2339. highlightadd: function() {
  2340. if (arguments[0] === "") {
  2341. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2342. } else {
  2343. if (CheckUserNameStrict(arguments[0])) {
  2344. CTS.HighlightList.push(arguments[0].toUpperCase());
  2345. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2346. Alert(GetActiveChat(), "🗹Command Accepted!");
  2347. } else {
  2348. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2349. }
  2350. }
  2351. },
  2352. highlightremove: function() {
  2353. if (arguments[0] === "" || isNaN(arguments[0])) {
  2354. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2355. } else {
  2356. if (CTS.HighlightList[arguments[0]] !== undefined) {
  2357. CTS.HighlightList.splice(arguments[0], 1);
  2358. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2359. Alert(GetActiveChat(), "🗹Command Accepted!");
  2360. } else {
  2361. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2362. }
  2363. }
  2364. },
  2365. highlightlistclear: function() {
  2366. CTS.HighlightList = [];
  2367. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2368. Alert(GetActiveChat(), "🗹Command Accepted!");
  2369. },
  2370. highlightlist: function() {
  2371. Alert(GetActiveChat(), SettingsList.HighlightList());
  2372. },
  2373. opadd: function() {
  2374. if (arguments[0] === "") {
  2375. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2376. } else {
  2377. if (CheckUserName(arguments[0])) {
  2378. CTS.BotOPList.push(arguments[0].toUpperCase());
  2379. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2380. Alert(GetActiveChat(), "🗹Command Accepted!");
  2381. } else {
  2382. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2383. }
  2384. }
  2385. },
  2386. opremove: function() {
  2387. if (arguments[0] === "" || isNaN(arguments[0])) {
  2388. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2389. } else {
  2390. if (CTS.BotOPList[arguments[0]] !== undefined) {
  2391. CTS.BotOPList.splice(arguments[0], 1);
  2392. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2393. Alert(GetActiveChat(), "🗹Command Accepted!");
  2394. } else {
  2395. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2396. }
  2397. }
  2398. },
  2399. oplistclear: function() {
  2400. CTS.BotOPList = [];
  2401. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2402. Alert(GetActiveChat(), "🗹Command Accepted!");
  2403. },
  2404. oplist: function() {
  2405. Alert(GetActiveChat(), SettingsList.BotOPList());
  2406. },
  2407. modadd: function() {
  2408. if (arguments[0] === "") {
  2409. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2410. } else {
  2411. if (CheckUserNameStrict(arguments[0])) {
  2412. CTS.BotModList.push(arguments[0].toUpperCase());
  2413. Save("BotModList", JSON.stringify(CTS.BotModList));
  2414. Alert(GetActiveChat(), "🗹Command Accepted!");
  2415. } else {
  2416. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2417. }
  2418. }
  2419. },
  2420. modremove: function() {
  2421. if (arguments[0] === "" || isNaN(arguments[0])) {
  2422. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2423. } else {
  2424. if (CTS.BotModList[arguments[0]] !== undefined) {
  2425. CTS.BotModList.splice(arguments[0], 1);
  2426. Save("BotModList", JSON.stringify(CTS.BotModList));
  2427. Alert(GetActiveChat(), "🗹Command Accepted!");
  2428. } else {
  2429. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2430. }
  2431. }
  2432. },
  2433. modlistclear: function() {
  2434. CTS.BotModList = [];
  2435. Save("BotModList", JSON.stringify(CTS.BotModList));
  2436. Alert(GetActiveChat(), "🗹Command Accepted!");
  2437. },
  2438. modlist: function() {
  2439. Alert(GetActiveChat(), SettingsList.BotModList());
  2440. },
  2441. ttsadd: function() {
  2442. if (arguments[0] === "") {
  2443. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2444. } else {
  2445. if (arguments[0].match(/^(-all|-event|[a-z0-9_]){1,32}$/i)) {
  2446. CTS.TTSList.push(arguments[0].toUpperCase());
  2447. Save("TTSList", JSON.stringify(CTS.TTSList));
  2448. Alert(GetActiveChat(), "🗹Command Accepted!");
  2449. } else {
  2450. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2451. }
  2452. }
  2453. },
  2454. ttsremove: function() {
  2455. if (arguments[0] === "" || isNaN(arguments[0])) {
  2456. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2457. } else {
  2458. if (CTS.TTSList[arguments[0]] !== undefined) {
  2459. CTS.TTSList.splice(arguments[0], 1);
  2460. Save("TTSList", JSON.stringify(CTS.TTSList));
  2461. Alert(GetActiveChat(), "🗹Command Accepted!");
  2462. } else {
  2463. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2464. }
  2465. }
  2466. },
  2467. ttslistclear: function() {
  2468. CTS.TTSList = [];
  2469. Save("TTSList", JSON.stringify(CTS.TTSList));
  2470. Alert(GetActiveChat(), "🗹Command Accepted!");
  2471. },
  2472. ttslist: function() {
  2473. Alert(GetActiveChat(), SettingsList.TTSList());
  2474. },
  2475. reminderadd: function() {
  2476. if (arguments[0] === "") {
  2477. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2478. } else {
  2479. var reminder = arguments[0].match(/^((?:1[0-2]|0?[1-9]):(?:[0-5][0-9])\s?(?:[AaPp][Mm]))\s(.*)/);
  2480. if (reminder === null) {
  2481. Alert(GetActiveChat(), "🗷Command Rejected!\n!reminderadd 4:18 PM This is an example you can try!");
  2482. } else {
  2483. CTS.ReminderList.push([reminder[1], reminder[2]]);
  2484. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2485. Alert(GetActiveChat(), "🗹Command Accepted!");
  2486. Reminder();
  2487. }
  2488. }
  2489. },
  2490. reminderremove: function() {
  2491. if (arguments[0] === "" || isNaN(arguments[0])) {
  2492. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2493. } else {
  2494. if (CTS.ReminderList[arguments[0]] !== undefined) {
  2495. CTS.ReminderList.splice(arguments[0], 1);
  2496. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2497. Reminder();
  2498. Alert(GetActiveChat(), "🗹Command Accepted!");
  2499. } else {
  2500. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2501. }
  2502. }
  2503. },
  2504. reminderlistclear: function() {
  2505. CTS.ReminderList = [];
  2506. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2507. Alert(GetActiveChat(), "🗹Command Accepted!");
  2508. },
  2509. reminderlist: function() {
  2510. Alert(GetActiveChat(), SettingsList.ReminderList());
  2511. },
  2512. remindertoggle: function() {
  2513. CTS.Reminder = !CTS.Reminder;
  2514. Save("Reminder", JSON.stringify(CTS.Reminder));
  2515. Reminder();
  2516. Settings();
  2517. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Reminder) ? "Reminders are now on!\n" : "Reminders are now off!\n "));
  2518. },
  2519. timestamptoggle: function() {
  2520. CTS.TimeStampToggle = !CTS.TimeStampToggle;
  2521. Save("TimeStampToggle", JSON.stringify(CTS.TimeStampToggle));
  2522. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.TimeStampToggle) ? "Timestamps are now on!\n" : "Timestamps are now off\n "));
  2523. },
  2524. safeadd: function() {
  2525. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  2526. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2527. } else {
  2528. if (CheckUserNameStrict(arguments[0])) {
  2529. if (!CTS.SafeList.includes(arguments[0].toUpperCase())) {
  2530. CTS.SafeList.push(arguments[0].toUpperCase());
  2531. Save("AKB", JSON.stringify(CTS.SafeList));
  2532. Alert(GetActiveChat(), "🗹Command Accepted!");
  2533. } else {
  2534. Alert(GetActiveChat(), "🗷Name already exists!");
  2535. }
  2536. } else {
  2537. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2538. }
  2539. }
  2540. },
  2541. saferemove: function() {
  2542. if (arguments[0] === "" || isNaN(arguments[0])) {
  2543. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2544. } else {
  2545. if (CTS.SafeList[arguments[0]] !== undefined) {
  2546. CTS.SafeList.splice(arguments[0], 1);
  2547. Save("AKB", JSON.stringify(CTS.SafeList));
  2548. Alert(GetActiveChat(), "🗹Command Accepted!");
  2549. } else {
  2550. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2551. }
  2552. }
  2553. },
  2554. safelistclear: function() {
  2555. CTS.SafeList = [];
  2556. Save("AKB", JSON.stringify(CTS.SafeList));
  2557. Alert(GetActiveChat(), "🗹Command Accepted!");
  2558. },
  2559. safelist: function() {
  2560. Alert(GetActiveChat(), SettingsList.SafeList());
  2561. },
  2562. greenroomadd: function() {
  2563. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  2564. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2565. } else {
  2566. if (CheckUserNameStrict(arguments[0])) {
  2567. if (!CTS.GreenRoomList.includes(arguments[0].toUpperCase())) {
  2568. CTS.GreenRoomList.push(arguments[0].toUpperCase());
  2569. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  2570. Alert(GetActiveChat(), "🗹Command Accepted!");
  2571. } else {
  2572. Alert(GetActiveChat(), "🗷Name already exists!");
  2573. }
  2574. } else {
  2575. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2576. }
  2577. }
  2578. },
  2579. greenroomremove: function() {
  2580. if (arguments[0] === "" || isNaN(arguments[0])) {
  2581. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2582. } else {
  2583. if (CTS.GreenRoomList[arguments[0]] !== undefined) {
  2584. CTS.GreenRoomList.splice(arguments[0], 1);
  2585. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  2586. Alert(GetActiveChat(), "🗹Command Accepted!");
  2587. } else {
  2588. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2589. }
  2590. }
  2591. },
  2592. greenroomlistclear: function() {
  2593. CTS.GreenRoomList = [];
  2594. Save("GreenRoomList", JSON.stringify(CTS.GreenRoomList));
  2595. Alert(GetActiveChat(), "🗹Command Accepted!");
  2596. },
  2597. greenroomlist: function() {
  2598. Alert(GetActiveChat(), SettingsList.GreenRoomList());
  2599. },
  2600. greenroomignoreadd: function() {
  2601. if (arguments[0] === "" || arguments[0].toUpperCase() === "GUEST") { // Can't protect guests;
  2602. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2603. } else {
  2604. if (CheckUserNameStrict(arguments[0])) {
  2605. if (!CTS.GreenRoomIgnoreList.includes(arguments[0].toUpperCase())) {
  2606. CTS.GreenRoomIgnoreList.push(arguments[0].toUpperCase());
  2607. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  2608. Alert(GetActiveChat(), "🗹Command Accepted!");
  2609. } else {
  2610. Alert(GetActiveChat(), "🗷Name already exists!");
  2611. }
  2612. } else {
  2613. Alert(GetActiveChat(), "🗷Command Rejected!\nArgument passed didn't match criteria!");
  2614. }
  2615. }
  2616. },
  2617. greenroomignoreremove: function() {
  2618. if (arguments[0] === "" || isNaN(arguments[0])) {
  2619. Alert(GetActiveChat(), "🗷Command Rejected!\nParameter was missing/incorrect\nUse <b>!cts</b> for help.");
  2620. } else {
  2621. if (CTS.GreenRoomIgnoreList[arguments[0]] !== undefined) {
  2622. CTS.GreenRoomIgnoreList.splice(arguments[0], 1);
  2623. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  2624. Alert(GetActiveChat(), "🗹Command Accepted!");
  2625. } else {
  2626. Alert(GetActiveChat(), "🗷Command Rejected!\nID was not found!");
  2627. }
  2628. }
  2629. },
  2630. greenroomignorelistclear: function() {
  2631. CTS.GreenRoomIgnoreList = [];
  2632. Save("GreenRoomIgnoreList", JSON.stringify(CTS.GreenRoomIgnoreList));
  2633. Alert(GetActiveChat(), "🗹Command Accepted!");
  2634. },
  2635. greenroomignorelist: function() {
  2636. Alert(GetActiveChat(), SettingsList.GreenRoomIgnoreList());
  2637. },
  2638. optoggle: function() {
  2639. CTS.UserYT = !CTS.UserYT;
  2640. Save("UserYT", JSON.stringify(CTS.UserYT));
  2641. Settings();
  2642. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.UserYT) ? "Operators can now use YouTube.\n" : "Operators cannot use YouTube.\n"));
  2643. },
  2644. avatartoggle: function() {
  2645. CTS.Avatar = !CTS.Avatar;
  2646. Save("Avatar", JSON.stringify(CTS.Avatar));
  2647. Settings();
  2648. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Avatar) ? "Avatars from now on will be visible!\n " : "Avatars from now on will hidden!\n"));
  2649. },
  2650. popuptoggle: function() {
  2651. CTS.Popups = !CTS.Popups;
  2652. Save("Popups", JSON.stringify(CTS.Popups));
  2653. Settings();
  2654. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Popups) ? "Popups from now on will be visible!\n " : "Popups from now on will hidden!\n"));
  2655. },
  2656. notificationtoggle: function() {
  2657. CTS.NotificationToggle++;
  2658. if (CTS.NotificationToggle >= 3) CTS.NotificationToggle = 0;
  2659. Save("NotificationToggle", JSON.stringify(CTS.NotificationToggle));
  2660. NotificationDisplay();
  2661. Settings();
  2662. Alert(GetActiveChat(), "🗹Command Accepted!\nNotifications " + ((CTS.NotificationToggle==0) ? "above chat enabled" : (CTS.NotificationToggle==1)?"in chat enabled":"disabled")+".");
  2663. },
  2664. greetmode: function() {
  2665. CTS.GreetMode = !CTS.GreetMode;
  2666. Save("GreetMode", JSON.stringify(CTS.GreetMode));
  2667. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreetMode) ? "Server like greet is enabled." : "Server like greet is disabled."));
  2668. },
  2669. imgurtoggle: function() {
  2670. CTS.imgur = !CTS.imgur;
  2671. Save("imgur", JSON.stringify(CTS.imgur));
  2672. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.imgur) ? "Imgur preview is enabled." : "Imgur preview is disabled."));
  2673. },
  2674. publiccommandtoggle: function() {
  2675. CTS.PublicCommandToggle = !CTS.PublicCommandToggle;
  2676. Save("PublicCommandToggle", JSON.stringify(CTS.PublicCommandToggle));
  2677. Settings();
  2678. 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."));
  2679. },
  2680. greenroomtoggle: function() {
  2681. CTS.GreenRoomToggle = !CTS.GreenRoomToggle;
  2682. Save("GreenRoomToggle", JSON.stringify(CTS.GreenRoomToggle));
  2683. Settings();
  2684. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.GreenRoomToggle) ? "Green Room Auto Allow ON!" : "Green Room Auto Allow OFF!"));
  2685. },
  2686. clr: function() {
  2687. CTS.MessageCallback = [];
  2688. CTS.Message = [];
  2689. CTS.Message[0] = [];
  2690. window.TinychatApp.getInstance().defaultChatroom._chatlog.items = [];
  2691. ChatLogElement.querySelector("#cts-chat-content").innerHTML = "";
  2692. },
  2693. autokick: function() {
  2694. if (arguments[1] === false && CTS.Me.mod) {
  2695. CTS.AutoKick = !CTS.AutoKick;
  2696. CTS.AutoBan = false;
  2697. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoKick) ? "AUTO KICK IS NOW ON!" : "AUTO KICK IS NOW OFF!"));
  2698. if (CTS.AutoKick === true) CheckUserListSafe("kick");
  2699. }
  2700. },
  2701. autoban: function() {
  2702. if (arguments[1] === false && CTS.Me.mod) {
  2703. CTS.AutoBan = !CTS.AutoBan;
  2704. CTS.AutoKick = false;
  2705. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.AutoBan) ? "AUTO BAN IS NOW ON!" : "AUTO BAN IS NOW OFF!"));
  2706. if (CTS.AutoBan === true) CheckUserListSafe("ban");
  2707. }
  2708. },
  2709. camsweep: function() {
  2710. if (CTS.Me.mod && CTS.Host === CTS.Me.handle) {
  2711. CTS.Camera.SweepTimer = arguments[0] === "" || isNaN(arguments[0]) ? 5 : (arguments[0] > 30) ? 30 : (arguments[0] < 1) ? 1 : parseInt(arguments[0]);
  2712. CTS.Camera.Sweep = !CTS.Camera.Sweep;
  2713. clearTimeout(CTS.Camera.clearRandom);
  2714. Settings();
  2715. 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!"));
  2716. }
  2717. },
  2718. bottoggle: function() {
  2719. CTS.Bot = !CTS.Bot;
  2720. Save("Bot", JSON.stringify(CTS.Bot));
  2721. Settings();
  2722. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.Bot) ? "You'll now ask !bot bypass on load." : "You'll not !bot bypass on load."));
  2723. },
  2724. votetoggle: function() {
  2725. if (CTS.Me.mod) {
  2726. CTS.VoteSystem = !CTS.VoteSystem;
  2727. CTS.WaitToVoteList = [];
  2728. var len = CTS.UserList.length;
  2729. if (len > 0) {
  2730. for (var i = 0; i < len; i++) CTS.UserList[i].vote = 0;
  2731. }
  2732. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.VoteSystem) ? "VOTING IS NOW ON!" : "VOTING IS NOW OFF!"));
  2733. }
  2734. },
  2735. bot: function() {
  2736. if (arguments[1] === false && CTS.Me.mod) Alert(0, "🗹Command Accepted!\nBot bypass was called!");
  2737. },
  2738. share: function() {
  2739. 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";
  2740. if (GetActiveChat() !== 0) {
  2741. Send("pvtmsg", msg, GetActiveChat());
  2742. PushPM(GetActiveChat(), msg);
  2743. } else {
  2744. Send("msg", msg);
  2745. }
  2746. },
  2747. gameview: function() {
  2748. CTS.CanSeeGames = !CTS.CanSeeGames;
  2749. Save("CanSeeGames", JSON.stringify(CTS.CanSeeGames));
  2750. Settings();
  2751. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanSeeGames) ? "GAME VIEW IS NOW ON!" : "GAME VIEW IS NOW OFF!"));
  2752. },
  2753. gamehost: function() {
  2754. CTS.CanHostGames = !CTS.CanHostGames;
  2755. Save("CanHostGames", JSON.stringify(CTS.CanHostGames));
  2756. Fish.reset(true, true);
  2757. Settings();
  2758. Alert(GetActiveChat(), "🗹Command Accepted!\n" + ((CTS.CanHostGames) ? "GAME HOSTING IS NOW ON!" : "GAME HOSTING IS NOW OFF!"));
  2759. },
  2760. version: function() {
  2761. if (!CTS.Me.owner) {
  2762. var msg = "I am using " + CTS.Project.Name + "v" + Ver();
  2763. if (GetActiveChat() !== 0) {
  2764. Send("pvtmsg", msg, GetActiveChat());
  2765. PushPM(GetActiveChat(), msg);
  2766. } else {
  2767. Send("msg", msg);
  2768. }
  2769. }
  2770. },
  2771. roll: function() {
  2772. var dice,
  2773. msg = "";
  2774. dice = (arguments[0] === "" || isNaN(arguments[0])) ? 1 : (arguments[0] < 12) ? arguments[0] : 12;
  2775. for (var i = 0; i < dice; i++) msg += Dice();
  2776. if (GetActiveChat() !== 0) {
  2777. Send("pvtmsg", msg, GetActiveChat());
  2778. PushPM(GetActiveChat(), msg);
  2779. } else {
  2780. Send("msg", msg);
  2781. }
  2782. },
  2783. coin: function() {
  2784. if (CTS.Host == 0 || GetActiveChat() !== 0) {
  2785. var msg = "The coin landed on " + ((Rand(0, 1) == 1) ? "heads" : "tails") + "!";
  2786. if (GetActiveChat() !== 0) {
  2787. Send("pvtmsg", msg, GetActiveChat());
  2788. } else {
  2789. Send("msg", msg);
  2790. }
  2791. }
  2792. },
  2793. settings: function() {
  2794. Settings();
  2795. },
  2796. lists: function() {
  2797. 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());
  2798. },
  2799. listsclear: function() {
  2800. CTS.MentionList = [];
  2801. CTS.IgnoreList = [];
  2802. CTS.BanList = [];
  2803. CTS.KickList = [];
  2804. CTS.BanKeywordList = [];
  2805. CTS.KickKeywordList = [];
  2806. CTS.GreetList = [];
  2807. CTS.HighlightList = [];
  2808. CTS.ReminderList = [];
  2809. CTS.TTSList = [];
  2810. CTS.BotOPList = [];
  2811. CTS.BotModList = [];
  2812. Save("MentionList", JSON.stringify(CTS.MentionList));
  2813. Save("IgnoreList", JSON.stringify(CTS.IgnoreList));
  2814. Save("BanList", JSON.stringify(CTS.BanList));
  2815. Save("KickList", JSON.stringify(CTS.KickList));
  2816. Save("BanKeywordList", JSON.stringify(CTS.BanKeywordList));
  2817. Save("KickKeywordList", JSON.stringify(CTS.KickKeywordList));
  2818. Save("GreetList", JSON.stringify(CTS.GreetList));
  2819. Save("HighlightList", JSON.stringify(CTS.HighlightList));
  2820. Save("ReminderList", JSON.stringify(CTS.ReminderList));
  2821. Save("TTSList", JSON.stringify(CTS.TTSList));
  2822. Save("BotModList", JSON.stringify(CTS.BotModList));
  2823. Save("BotOPList", JSON.stringify(CTS.BotOPList));
  2824. Alert(GetActiveChat(), "🗹Command Accepted!\nItems Mentionlist, igore");
  2825. },
  2826. ytqueue: function() {},
  2827. ytclear: function() {},
  2828. ytskip: function() {},
  2829. yt: function() {},
  2830. ytbypass: function() {}
  2831. };
  2832. var SettingsList = {
  2833. BanList: function() {
  2834. var index,
  2835. msg,
  2836. len = CTS.BanList.length;
  2837. msg = "<b style=\"color:#ee3636;\"><u>Ban list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2838. for (index = 0; index < len; index++) msg += index + " : " + CTS.BanList[index] + "\n";
  2839. return msg;
  2840. },
  2841. BanKeywordList: function() {
  2842. var index,
  2843. msg,
  2844. len = CTS.BanKeywordList.length;
  2845. msg = "<b style=\"color:#ee3636;\"><u>Ban Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2846. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.BanKeywordList[index]) + "\n";
  2847. return msg;
  2848. },
  2849. KickList: function() {
  2850. var index,
  2851. msg,
  2852. len = CTS.KickList.length;
  2853. msg = "<b style=\"color:#ee3636;\"><u>Kick list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2854. for (index = 0; index < len; index++) msg += index + " : " + CTS.KickList[index] + "\n";
  2855. return msg;
  2856. },
  2857. KickKeywordList: function() {
  2858. var index,
  2859. msg,
  2860. len = CTS.KickKeywordList.length;
  2861. msg = "<b style=\"color:#ee3636;\"><u>Kick Keyword list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2862. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.KickKeywordList[index]) + "\n";
  2863. return msg;
  2864. },
  2865. BotOPList: function() {
  2866. var index,
  2867. msg,
  2868. len = CTS.BotOPList.length;
  2869. msg = "<b style=\"color:#ee3636;\"><u>Bot OP list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2870. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotOPList[index] + "\n";
  2871. return msg;
  2872. },
  2873. BotModList: function() {
  2874. var index,
  2875. msg,
  2876. len = CTS.BotModList.length;
  2877. msg = "<b style=\"color:#ee3636;\"><u>Bot Mod list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2878. for (index = 0; index < len; index++) msg += index + " : " + CTS.BotModList[index] + "\n";
  2879. return msg;
  2880. },
  2881. MentionList: function() {
  2882. var index,
  2883. msg,
  2884. len = CTS.MentionList.length;
  2885. msg = "<b style=\"color:#ee3636;\"><u>Mention list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2886. for (index = 0; index < len; index++) msg += index + " : " + HTMLtoTXT(CTS.MentionList[index]) + "\n";
  2887. return msg;
  2888. },
  2889. IgnoreList: function() {
  2890. var index,
  2891. msg,
  2892. len = CTS.IgnoreList.length;
  2893. msg = "<b style=\"color:#ee3636;\"><u>Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2894. for (index = 0; index < len; index++) msg += index + " : " + CTS.IgnoreList[index] + "\n";
  2895. return msg;
  2896. },
  2897. GreetList: function() {
  2898. var index,
  2899. msg,
  2900. len = CTS.GreetList.length;
  2901. msg = "<b style=\"color:#ee3636;\"><u>Greet list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2902. for (index = 0; index < len; index++) msg += index + " : " + CTS.GreetList[index] + "\n";
  2903. return msg;
  2904. },
  2905. TTSList: function() {
  2906. var index,
  2907. msg,
  2908. len = CTS.TTSList.length;
  2909. msg = "<b style=\"color:#ee3636;\"><u>TTS list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2910. for (index = 0; index < len; index++) msg += index + " : " + CTS.TTSList[index] + "\n";
  2911. return msg;
  2912. },
  2913. HighlightList: function() {
  2914. var index,
  2915. msg,
  2916. len = CTS.HighlightList.length;
  2917. msg = "<b style=\"color:#ee3636;\"><u>Highlight list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2918. for (index = 0; index < len; index++) msg += index + " : " + CTS.HighlightList[index] + "\n";
  2919. return msg;
  2920. },
  2921. ReminderList: function() {
  2922. var index,
  2923. msg,
  2924. len = CTS.ReminderList.length;
  2925. msg = "<b style=\"color:#ee3636;\"><u>Reminder list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2926. for (index = 0; index < len; index++) msg += index + ": [" + CTS.ReminderList[index][0] + "] " + HTMLtoTXT(CTS.ReminderList[index][1]) + "\n";
  2927. return msg;
  2928. },
  2929. SafeList: function() {
  2930. var index,
  2931. msg,
  2932. len = CTS.SafeList.length;
  2933. msg = "<b style=\"color:#ee3636;\"><u>Safe list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2934. for (index = 0; index < len; index++) msg += index + ": " + CTS.SafeList[index] + "\n";
  2935. return msg;
  2936. },
  2937. GreenRoomList: function() {
  2938. var index,
  2939. msg,
  2940. len = CTS.GreenRoomList.length;
  2941. msg = "<b style=\"color:#ee3636;\"><u>Green Room list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2942. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomList[index] + "\n";
  2943. return msg;
  2944. },
  2945. GreenRoomIgnoreList: function() {
  2946. var index,
  2947. msg,
  2948. len = CTS.GreenRoomIgnoreList.length;
  2949. msg = "<b style=\"color:#ee3636;\"><u>Green Room Ignore list:</u></b>\n" + ((!len) ? "empty\n" : "");
  2950. for (index = 0; index < len; index++) msg += index + ": " + CTS.GreenRoomIgnoreList[index] + "\n";
  2951. return msg;
  2952. }
  2953. };
  2954. var MessageQueueList = {
  2955. add: function() {
  2956. CTS.SendQueue.push(arguments[0]);
  2957. MessageQueueList.run();
  2958. },
  2959. run: function() {
  2960. if (CTS.SendQueue !== undefined && CTS.SendQueue.length > 0) {
  2961. setTimeout(function() {
  2962. var temp = new Date();
  2963. var OffsetTime = temp - CTS.LastMessage;
  2964. if (OffsetTime >= 1500) {
  2965. CTS.LastMessage = new Date();
  2966. CTS.SocketTarget.send(CTS.SendQueue[0]);
  2967. CTS.SendQueue.shift();
  2968. }
  2969. MessageQueueList.run();
  2970. }, 1600, CTS.LastMessage);
  2971. }
  2972. }
  2973. };
  2974. var ServerSendList = {
  2975. msg: function() {
  2976. var obj = {
  2977. "tc": arguments[0]
  2978. };
  2979. if (arguments[2] !== undefined) {
  2980. obj.handle = arguments[1];
  2981. CTS.SocketTarget.send(JSON.stringify(obj));
  2982. } else {
  2983. if (arguments[1] !== undefined) {
  2984. obj.text = arguments[1];
  2985. MessageQueueList.add(JSON.stringify(obj));
  2986. } else {
  2987. CTS.SocketTarget.send(JSON.stringify(obj));
  2988. }
  2989. }
  2990. },
  2991. pvtmsg: function() {
  2992. var obj = {
  2993. "tc": arguments[0],
  2994. "text": arguments[1],
  2995. "handle": Number(arguments[2])
  2996. };
  2997. MessageQueueList.add(JSON.stringify(obj));
  2998. },
  2999. kick: function() {
  3000. CheckSafeList(arguments[1], true);
  3001. ServerSendList.msg(arguments[0], arguments[1], "kick");
  3002. },
  3003. ban: function() {
  3004. CheckSafeList(arguments[1], true);
  3005. ServerSendList.msg(arguments[0], arguments[1], "ban");
  3006. },
  3007. nick: function() {
  3008. var obj = {
  3009. "tc": "nick",
  3010. "nick": arguments[1]
  3011. };
  3012. CTS.SocketTarget.send(JSON.stringify(obj));
  3013. },
  3014. stream_moder_close: function() {
  3015. CheckSafeList(arguments[1], true);
  3016. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_close");
  3017. },
  3018. stream_moder_allow: function() {
  3019. ServerSendList.msg(arguments[0], arguments[1], "stream_moder_allow");
  3020. },
  3021. yut_playlist_add: function() {
  3022. var obj = {
  3023. "tc": arguments[0],
  3024. "item": {
  3025. "id": arguments[1][0],
  3026. "duration": arguments[1][1] + 10,
  3027. "title": arguments[1][2],
  3028. "image": arguments[1][3]
  3029. }
  3030. };
  3031. if (arguments[1][4] !== undefined) obj.item.offset = arguments[1][4];
  3032. CTS.SocketTarget.send(JSON.stringify(obj));
  3033. },
  3034. yut_playlist_remove: function() {
  3035. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  3036. },
  3037. yut_stop: function() {
  3038. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  3039. },
  3040. yut_play: function() {
  3041. ServerSendList.yut_playlist_add(arguments[0], arguments[1]);
  3042. },
  3043. yut_playlist: function() {
  3044. ServerSendList.msg("yut_playlist");
  3045. },
  3046. yut_playlist_clear: function() {
  3047. ServerSendList.msg("yut_playlist_clear");
  3048. }
  3049. };
  3050. var ServerInList = {
  3051. joined: function() {
  3052. Reset();
  3053. CTS.Me = {
  3054. "handle": arguments[0].self.handle,
  3055. "username": (arguments[0].self.username === "") ? "GUEST" : arguments[0].self.username.toUpperCase(),
  3056. "nick": arguments[0].self.nick,
  3057. "owner": arguments[0].self.owner,
  3058. "mod": arguments[0].self.mod,
  3059. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  3060. "avatar": arguments[0].self.avatar
  3061. };
  3062. if (CTS.Me.nick.match(/^guest(?:\-[0-9]{1,10})?/i) && CTS.Me.username !== "GUEST") Send("nick", CTS.Me.username); //AUTO CORRECT NAME
  3063. if (CTS.Me.mod && CTS.Bot && CTS.ScriptInit && CTS.SocketConnected) CheckHost();
  3064. CTS.Room = {
  3065. "Avatar": arguments[0].room.avatar,
  3066. "Bio": arguments[0].room.biography,
  3067. "Name": arguments[0].room.name,
  3068. "PTT": arguments[0].room.pushtotalk,
  3069. "Website": arguments[0].room.website,
  3070. "YT_ON": arguments[0].room.youtube_enabled,
  3071. "Recent_Gifts": arguments[0].room.recent_gifts
  3072. };
  3073. CTS.SocketConnected = true;
  3074. },
  3075. userlist: function() {
  3076. var len = arguments[0].users.length;
  3077. for (var user = 0; user < len; user++) {
  3078. AKBS(arguments[0].users[user]);
  3079. var username = (arguments[0].users[user].username === "") ? "GUEST" : arguments[0].users[user].username.toUpperCase();
  3080. CheckUserAbuse(arguments[0].users[user].handle, username, arguments[0].users[user].nick.toUpperCase());
  3081. CTS.UserList.push({
  3082. "handle": arguments[0].users[user].handle,
  3083. "username": username,
  3084. "nick": arguments[0].users[user].nick,
  3085. "owner": arguments[0].users[user].owner,
  3086. "mod": arguments[0].users[user].mod,
  3087. "namecolor": window.CTSNameColor[Rand(0, window.CTSNameColor.length - 1)],
  3088. "avatar": (arguments[0].users[user].avatar === "") ? "https://avatars.tinychat.com/standart/small/eyePink.png" : arguments[0].users[user].avatar,
  3089. "canGame": (arguments[0].users[user].username !== "GUEST") ? true : false,
  3090. "broadcasting": false,
  3091. "vote": 0
  3092. });
  3093. }
  3094. RoomUsers();
  3095. debug();
  3096. },
  3097. join: function() {
  3098. AKBS(arguments[0]);
  3099. var user = (arguments[0].username === "") ? "GUEST" : arguments[0].username.toUpperCase();
  3100. CheckUserAbuse(arguments[0].handle, user, arguments[0].nick.toUpperCase());
  3101. if (CTS.HighlightList.includes(user) || CTS.HighlightList.includes(arguments[0].nick.toUpperCase())) {
  3102. if (CTS.enableSound === true) window.CTSSound.HIGHLIGHT.play();
  3103. }
  3104. if (user === "COSMOSIST" && CTS.Room.Name.toUpperCase() !== "STONERCIRCLE" && !CTS.hasGreetedWC) { // Meet your creator
  3105. CTS.hasGreetedWC = true;
  3106. if (CTS.enableSound === true) window.CTSSound.C.play();
  3107. Send("msg", UnicodeConversionList.convert("HI! " + arguments[0].nick.toUpperCase()) + "!");
  3108. } else {
  3109. if ((CTS.GreetList.includes(user) || CTS.GreetList.includes(arguments[0].nick.toUpperCase()) || (CTS.Host == CTS.Me.handle && CTS.GreetList.includes("-ALL"))) && CTS.NoGreet === false) {
  3110. 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!") : "!"))));
  3111. if (CTS.enableSound === true) window.CTSSound.GREET.play();
  3112. }
  3113. }
  3114. CTS.NoGreet = false;
  3115. 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);
  3116. RoomUsers();
  3117. debug();
  3118. },
  3119. sysmsg: function() {
  3120. if (CTS.Me.mod) {
  3121. var action = arguments[0].text.match(/^([a-z0-9_]{1,32}):?\s(closed|banned|kicked)\s([a-z0-9_]{1,32})$/i);
  3122. if (action !== null) {
  3123. var user;
  3124. if (action[2] == "closed" || action[2] == "banned" || action[2] == "kicked") {
  3125. user = NicknameToAccount(action[3].toUpperCase());
  3126. if (user != -1) {
  3127. var a = CTS.GreenRoomList.indexOf(CTS.UserList[user].username);
  3128. if (a !== -1) {
  3129. //REMOVE
  3130. debug("GREENROOMLIST::", "REMOVE USER " + CTS.UserList[user].username + " FROM GREENROOMLIST");
  3131. Alert(GetActiveChat(), "🗹Removing "+CTS.UserList[user].username+" from greenroomlist!");
  3132. CommandList.greenroomremove(a);
  3133. }
  3134. }
  3135. }
  3136. }
  3137. }
  3138. AddSystemNotification(HTMLtoTXT(arguments[0].text));
  3139. debug();
  3140. },
  3141. nick: function() {
  3142. var user = User(arguments[0].handle);
  3143. if (user != -1) {
  3144.  
  3145. AddUserNotification(4, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true, arguments[0].nick);
  3146.  
  3147. 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) {
  3148. Send("msg", UnicodeConversionList.convert(CTS.UserList[user].nick + "\nwith the account name " + CTS.UserList[user].username + " changed their name to " + arguments[0].nick));
  3149. if (CTS.enableSound === true) window.CTSSound.GREET.play();
  3150. }
  3151.  
  3152. CTS.UserList[user].nick = arguments[0].nick;
  3153. if (CTS.Me.handle == arguments[0].handle) CTS.Me.nick = arguments[0].nick;
  3154. }
  3155. debug();
  3156. },
  3157. stream_connected: function() {
  3158. if (CTS.Host === CTS.Me.handle && CTS.GreenRoomToggle && arguments[0].publish == false && CTS.Me.handle !== arguments[0].handle && !CTS.Camera.List.includes(arguments[0].handle)) {
  3159. //USER IS NOT ON CAMERA START AUTO ACCEPT PROCESS
  3160. var user = User(arguments[0].handle);
  3161. if (user != -1) {
  3162. debug("CAMERA::WAITING", "nickname:" + CTS.UserList[user].nick);
  3163. if (!CTS.GreenRoomIgnoreList.includes(CTS.UserList[user].username) && CTS.GreenRoomList.includes(CTS.UserList[user].username)) Send("stream_moder_allow", CTS.UserList[user].handle);
  3164. }
  3165. }
  3166. debug();
  3167. },
  3168. stream_closed: function() {
  3169. debug();
  3170. },
  3171. publish: function() { //ADD GLOBAL CAMERA
  3172. CheckUserStream(arguments[0].handle, true);
  3173. debug();
  3174. },
  3175. unpublish: function() { //REMOVE GLOBAL CAMERA
  3176. CheckUserStream(arguments[0].handle, false);
  3177. debug();
  3178. },
  3179. ping: function() {
  3180. if (CTS.ScriptInit) {
  3181. var verify;
  3182. if (CTS.WatchList.length > 0) {
  3183. verify = new Date() - CTS.WatchList[0][2];
  3184. debug("WATCHLIST::LIST", CTS.WatchList);
  3185. debug("WATCHLIST::VERIFYING", CTS.WatchList[0][0] + " " + verify + "/600000");
  3186. if (CTS.SafeList.indexOf(CTS.WatchList[0][0]) === -1) { //LET'S NOT ADD TWICE
  3187. if (verify > 600000) {
  3188. debug("WATCHLIST::VERIFIED", CTS.WatchList[0][0] + " " + verify + "/600000");
  3189. CTS.SafeList.push(CTS.WatchList[0][0]);
  3190. CTS.WatchList.shift();
  3191. }
  3192. } else {
  3193. CTS.WatchList.shift();
  3194. }
  3195. }
  3196. if (CTS.WaitToVoteList.length > 0) {
  3197. verify = new Date() - CTS.WaitToVoteList[0][1];
  3198. debug("VOTE::LIST", CTS.WaitToVoteList);
  3199. debug("VOTE::WAIT", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  3200. if (verify > 300000) {
  3201. debug("VOTE::READY", CTS.WaitToVoteList[0][0] + " " + verify + "/300000");
  3202. CTS.WaitToVoteList.shift();
  3203. }
  3204. }
  3205. }
  3206. //DISPOSE OF ITEMS
  3207. window.TinychatApp.getInstance().defaultChatroom.packetWorker.queue = {};
  3208. debug();
  3209. },
  3210. quit: function() {
  3211. if (CTS.ScriptInit) {
  3212. if (CTS.WatchList.length > 0) {
  3213. var len = CTS.WatchList.length;
  3214. for (var i = 0; i < len; i++) {
  3215. if (CTS.WatchList[i][1] == arguments[0].handle) {
  3216. CTS.WatchList.splice(i, 1);
  3217. break;
  3218. }
  3219. }
  3220. }
  3221. if (CTS.Me.mod) RemoveUserCamera(arguments[0].handle);
  3222. var user = User(arguments[0].handle);
  3223. if (user != -1) {
  3224. if (CTS.Me.handle === CTS.Host) {
  3225. if (Fish.getPlayer(arguments[0].handle, true, false)) {
  3226. Send("msg", CTS.Game.Fish.UserQuitLast + ", has slipped off the boat; I don't think we should look back.");
  3227. }
  3228. }
  3229. //SEND THEM OUT
  3230. AddUserNotification(2, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  3231. CTS.UserList.splice(user, 1);
  3232. }
  3233. RoomUsers();
  3234. if (CTS.Host == arguments[0].handle) {
  3235. CTS.Host = 0;
  3236. CTS.Camera.Sweep = false;
  3237. if (CTS.Me.mod && CTS.Bot) {
  3238. setTimeout(function(handle) {
  3239. if (CTS.Host == 0) SetBot(false);
  3240. }, (Rand(10, 30) * 1000), arguments[0].handle);
  3241. }
  3242. }
  3243. }
  3244. debug();
  3245. },
  3246. msg: function() {
  3247. if (CTS.ScriptInit) {
  3248. var user = User(arguments[0].handle);
  3249. if (user != -1) {
  3250. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3251. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3252. var text = HTMLtoTXT(arguments[0].text);
  3253. //ALL USERS REPORT
  3254. OwnerCommand(user, arguments[0].text);
  3255. BotCheck(user, text, arguments[0]);
  3256. //MODERATORS
  3257. if (CTS.Me.mod) {
  3258. if (CTS.Host == CTS.Me.handle) BotCommandCheck(user, text);
  3259. CheckUserWordAbuse(user, arguments[0].text);
  3260. }
  3261.  
  3262. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  3263. //PUSH MESSAGE
  3264. CTS.Message[0].push({
  3265. "time": Time(),
  3266. "namecolor": CTS.UserList[user].namecolor,
  3267. "avatar": CTS.UserList[user].avatar,
  3268. "username": CTS.UserList[user].username,
  3269. "nick": CTS.UserList[user].nick,
  3270. "msg": CheckImgur(text),
  3271. "mention": false
  3272. });
  3273. var msg = CTS.Message[0][CTS.Message[0].length - 1];
  3274. if (CTS.Me.handle !== arguments[0].handle) {
  3275. if (CTS.UserList[user].mod && (text.match(/^!autokick$/i) || text.match(/^!autoban$/i))) {
  3276. Alert(GetActiveChat(), "🗹AntiSpam Watch List CLEARED!\nAnother user has initiated autokick/autoban.");
  3277. CTS.AutoKick = false;
  3278. CTS.AutoBan = false;
  3279. }
  3280. if (CTS.enableSound === true) {
  3281. if (CTS.UserList.length <= 14) window.CTSSound.MSG.play();
  3282. 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!"));
  3283. }
  3284. var len = CTS.MentionList.length;
  3285. for (var i = 0; i < len; i++) {
  3286. if (text.toUpperCase().includes(CTS.MentionList[i])) {
  3287. if (CTS.enableSound === true) window.CTSSound.MENTION.play();
  3288. msg.mention = true;
  3289. AddUserNotification(3, CTS.UserList[user].namecolor, CTS.UserList[user].nick, CTS.UserList[user].username, true);
  3290. }
  3291. }
  3292. }
  3293. if (GetActiveChat() === 0) CreateMessage(msg.time, msg.namecolor, msg.avatar, msg.username, msg.nick, msg.msg, msg.mention, 0);
  3294. MessagePopUp(user, text, true, false);
  3295. }
  3296. }
  3297. } else {
  3298. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  3299. }
  3300. }
  3301. }
  3302. debug();
  3303. },
  3304. pvtmsg: function() {
  3305. if (CTS.ScriptInit) {
  3306. if (CTS.enablePMs === true) {
  3307. if (arguments[0].handle != CTS.Me.handle) {
  3308. var user = User(arguments[0].handle);
  3309. if (user != -1) {
  3310. if (!SpamPrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3311. if (GamePrevention(arguments[0].text, CTS.UserList[user].mod)) {
  3312. var text = arguments[0].text;
  3313. if (CTS.Me.mod) CheckUserWordAbuse(user, arguments[0].text);
  3314. if (!CheckUserIgnore(user) && !CheckUserTempIgnore(user) && IgnoreText(text)) {
  3315. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  3316. PushPM(arguments[0].handle, text, user);
  3317. if (CTS.enableSound === true) {
  3318. window.CTSSound.PVTMSG.play();
  3319. 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!"));
  3320. }
  3321. MessagePopUp(user, CheckImgur(HTMLtoTXT(text)), false, false);
  3322. }
  3323. }
  3324. } else {
  3325. if (CTS.Me.mod) Send("kick", arguments[0].handle);
  3326. }
  3327. }
  3328. }
  3329. }
  3330. }
  3331. debug();
  3332. },
  3333. gift: function(parse) {
  3334. window.DebugClear = false;
  3335. Alert(GetActiveChat(), "USER HAS SENT A GIFT--CHECK PACKET OUT!!!\n");
  3336. //coming soon a handler near you! :D
  3337. console.log(parse);
  3338. debug();
  3339. },
  3340. yut_playlist_add: function() {
  3341. if (CTS.ScriptInit) {
  3342. if (!CTS.YouTube.Playing) {
  3343. if (CTS.PlayListStart === true) CTS.PlayListStart = false;
  3344. if (CTS.Host != CTS.Me.handle) {
  3345. Send("msg", "!play");
  3346. } else {
  3347. YouTubePlayList();
  3348. }
  3349. }
  3350. }
  3351. debug();
  3352. },
  3353. yut_playlist: function() {
  3354. if (CTS.ScriptInit) {
  3355. if (CTS.Me.mod && CTS.Me.handle == CTS.Host) {
  3356. if (CTS.YouTube.Clear === true) {
  3357. if (arguments[0].items !== null) Send("yut_playlist_clear");
  3358. CTS.YouTube.MessageQueueList = [];
  3359. Send("msg", "🎵YouTube cleared!🎵");
  3360. CTS.YouTube.Clear = false;
  3361. } else {
  3362. if (arguments[0].items === null) {
  3363. CTS.PlayListStart = true;
  3364. } else {
  3365. CTS.YouTube.PlayListCount = arguments[0].items.length;
  3366. CTS.PlayListStart = false;
  3367. if (CTS.YouTube.ShowQueue === true) {
  3368. var msg = "🎵" + CTS.YouTube.PlayListCount + " track(s) in queue!🎵";
  3369. for (var i = 0; i < 3; i++) {
  3370. if (arguments[0].items[i] === undefined) break;
  3371. 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]";
  3372. }
  3373. Send("msg", msg);
  3374. }
  3375. }
  3376. 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);
  3377. }
  3378. CTS.YouTube.ShowQueue = false;
  3379. }
  3380. }
  3381. debug();
  3382. },
  3383. yut_play: function() {
  3384. if (CTS.ScriptInit) {
  3385. if (CTS.YouTube.CurrentTrack.ID != arguments[0].item.id) {
  3386. CTS.YouTube.CurrentTrack.ID = arguments[0].item.id;
  3387. CTS.YouTube.CurrentTrack.duration = arguments[0].item.duration;
  3388. CTS.YouTube.CurrentTrack.title = arguments[0].item.title;
  3389. CTS.YouTube.CurrentTrack.thumbnail = arguments[0].item.image;
  3390. MessagePopUp(-1, CTS.YouTube.CurrentTrack.title + " is now playing!", true, true);
  3391. }
  3392. CTS.YouTube.Playing = true;
  3393. YouTubePlayList();
  3394. }
  3395. debug();
  3396. },
  3397. yut_stop: function() {
  3398. if (CTS.ScriptInit) {
  3399. CTS.YouTube.CurrentTrack.ID = undefined;
  3400. CTS.YouTube.CurrentTrack.duration = undefined;
  3401. CTS.YouTube.CurrentTrack.title = undefined;
  3402. CTS.YouTube.CurrentTrack.thumbnail = undefined;
  3403. CTS.YouTube.Playing = false;
  3404. YouTubePlayList();
  3405. }
  3406. debug();
  3407. }
  3408. };
  3409. var ServerOutList = {
  3410. pvtmsg: function() {
  3411. if (CTS.ScriptInit) {
  3412. Command(arguments[0].text, true);
  3413. var text = arguments[0].text;
  3414. if (!CTS.Message[arguments[0].handle]) CTS.Message[arguments[0].handle] = [];
  3415. PushPM(arguments[0].handle, text);
  3416. }
  3417. debug();
  3418. },
  3419. msg: function() {
  3420. if (CTS.ScriptInit) {
  3421. CTS.LastMessage = new Date();
  3422. Command(arguments[0].text, false);
  3423. }
  3424. debug();
  3425. },
  3426. ban: function() {
  3427. CheckSafeList(arguments[0].handle, true);
  3428. debug();
  3429. },
  3430. kick: function() {
  3431. CheckSafeList(arguments[0].handle, true);
  3432. debug();
  3433. },
  3434. stream_moder_close: function() {
  3435. CheckSafeList(arguments[0].handle, true);
  3436. debug();
  3437. }
  3438. };
  3439. //ADDON
  3440. var Addon = {
  3441. active: function() {
  3442. if (window.CTSAddon !== undefined) {
  3443. if (window.CTSAddon[arguments[0]] !== undefined) {
  3444. return true;
  3445. }
  3446. }
  3447. return false;
  3448. },
  3449. get: function() {
  3450. return window.CTSAddon[arguments[0]];
  3451. }
  3452. };
  3453. //XMLHttpRequest
  3454. CTS.YouTube.XHR.onload = function() {
  3455. var response = JSON.parse(CTS.YouTube.XHR.responseText);
  3456. if (response.error) {
  3457. Send("msg", "⛔" + ((response.error.errors[0].reason) ? response.error.errors[0].reason : "Track could not be added!") + "⛔");
  3458. } else {
  3459. if (response.kind == "youtube#playlistItemListResponse" && response.nextPageToken === undefined && response.items.length === 0) {
  3460. CTS.YouTube.ListBuilt = true;
  3461. Send("msg", "🎵Found " + CTS.YouTube.MessageQueueList.length + " tracks!\nThis may take a few moments to add, requests can be made shortly.🎵");
  3462. CTS.YouTube.DataReady = true;
  3463. CTS.YouTube.Busy = false;
  3464. YouTubeTrackAdd();
  3465. }
  3466. CTS.YouTube.DataReady = false;
  3467. if (response.items[0]) {
  3468. CTS.YouTube.Busy = true;
  3469. if (response.items[0].id) {
  3470. if (response.kind == "youtube#playlistItemListResponse") {
  3471. YouTubePlayListItems(response.items);
  3472. } else {
  3473. CTS.YouTube.VideoID = response.items[0].id.videoId;
  3474. 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);
  3475. CTS.YouTube.XHR.send();
  3476. }
  3477. } else if (response.items[0].contentDetails.duration) {
  3478. CTS.YouTube.DataReady = true;
  3479. }
  3480. if (CTS.YouTube.DataReady === false) {
  3481. CTS.YouTube.Busy = false;
  3482. if (response.kind == "youtube#searchListResponse") CTS.YouTube.XHR.videoid = response.items[0].id.videoId;
  3483. if (response.kind == "youtube#playlistItemListResponse") {
  3484. CTS.YouTube.ListBuilt = true;
  3485. Send("msg", "🎵Adding " + CTS.YouTube.MessageQueueList.length + " track(s) to queue!🎵\nEnjoy!");
  3486. CTS.YouTube.Busy = false;
  3487. }
  3488. } else {
  3489. CTS.YouTube.VideoID = (CTS.YouTube.XHR.videoid) ? CTS.YouTube.XHR.videoid : CTS.YouTube.MessageQueueList[0].snippet.resourceId.videoId;
  3490. if (CTS.YouTube.Playing === true) {
  3491. MessagePopUp(-1, "Added " + ((response.items[0] === undefined) ? response.items.snippet.title : response.items[0].snippet.title), true, true);
  3492. 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]);
  3493. CTS.YouTube.Busy = false;
  3494. } else {
  3495. if (response.items[0].snippet.title !== undefined) {
  3496. 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]);
  3497. 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]);
  3498. CTS.YouTube.Playing = true;
  3499. }
  3500. CTS.YouTube.Busy = false;
  3501. }
  3502. }
  3503. }
  3504. if (CTS.YouTube.SearchReturn === true || (CTS.YouTube.SearchReturn === false && CTS.YouTube.VideoReturn === true && CTS.YouTube.XHR.type === true)) {
  3505. var title = "";
  3506. CTS.YouTube.SearchReturn = false;
  3507. CTS.YouTube.VideoReturn = false;
  3508. if (response.items[0] !== undefined) {
  3509. if (response.items[0].length > 0) title = response.items[0].snippet.title;
  3510. }
  3511. if (response.items !== undefined) {
  3512. if (response.items.length > 0) title = response.items[0].snippet.title;
  3513. }
  3514. Send("msg", ((title === "") ? "⛔Track could not be added!⛔" : "🎵Added " + DecodeTXT(title) + " to queue!🎵"));
  3515. }
  3516. if (CTS.YouTube.MessageQueueList.length > 0) YouTubeTrackAdd();
  3517. }
  3518. };
  3519. //Chuck Norris Jokes API (https://api.chucknorris.io/)
  3520. CTS.Chuck.XHR.onload = function() {
  3521. var resp = JSON.parse(CTS.Chuck.XHR.responseText),
  3522. msg = "[CHUCK NORRIS]\n" + resp.value;
  3523. if (resp !== null) Send("msg", msg.substr(0, 499));
  3524. };
  3525. //https://api.Urb.com/
  3526. CTS.Urb.XHR.onload = function() {
  3527. var resp = JSON.parse(CTS.Urb.XHR.responseText),
  3528. msg = "[URBAN DICTIONARY]\n" + ((resp.list[0] !== undefined) ? resp.list[0].word + "\n" + resp.list[0].definition : "Nothing was found!");
  3529. if (resp !== null) Send("msg", msg.substr(0, 499));
  3530. };
  3531. //icanhazdadjoke API (https://icanhazdadjoke.com/)
  3532. CTS.Dad.XHR.onload = function() {
  3533. var resp = JSON.parse(CTS.Dad.XHR.responseText),
  3534. msg = "[DAD JOKE]\n" + resp.joke;
  3535. if (resp !== null) Send("msg", msg.substr(0, 499));
  3536. };
  3537. //adviceslip API (https://api.adviceslip.com/advice)
  3538. CTS.Advice.XHR.onload = function() {
  3539. var resp = JSON.parse(CTS.Advice.XHR.responseText),
  3540. msg = "[ADVICE]\n" + resp.slip.advice;
  3541. if (resp !== null) Send("msg", msg.substr(0, 499));
  3542. };
  3543. //GAME LIST FUNCTION
  3544. var Fish = {
  3545. //INIT
  3546. init: function() {
  3547. if (CTS.Me.handle == CTS.Host && CTS.CanHostGames === true) {
  3548. 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!");
  3549. CTS.Game.Fish.StartTimeout = setTimeout(function(g) {
  3550. g.cast();
  3551. }, 5000, this);
  3552. }
  3553. },
  3554. //PLAYERS
  3555. addPlayer: function(handle, username, nickname) {
  3556. if (!this.getPlayer(handle, false, false) && CTS.CanHostGames === true) {
  3557. if (isSafeListed(username)) {
  3558. CTS.Game.Fish.Player.push({
  3559. Handle: handle,
  3560. Username: username,
  3561. Nickname: nickname,
  3562. LastCheck: new Date() - 5000,
  3563. Points: 5000,
  3564. Upgrades: {
  3565. Net: 1,
  3566. Store: 1,
  3567. Radar: 1,
  3568. Insurance: false
  3569. },
  3570. });
  3571. Send("msg", "[FISHING BOAT]\n" + nickname.substr(0, 16) + "...\n has jumped aboard.\nType !fishhelp for commands if you don't already know!");
  3572. if (this.getPlayer() == 0) this.init();
  3573. }
  3574. }
  3575. },
  3576.  
  3577. getPlayer: function(handle, del, exists) {
  3578. var len = CTS.Game.Fish.Player.length;
  3579. if (handle !== undefined) {
  3580. for (var player = 0; player < len; player++) {
  3581. if (CTS.Game.Fish.Player[player].Handle == handle) {
  3582. if (exists) return CTS.Game.Fish.Player[player];
  3583. if (del) {
  3584. CTS.Game.Fish.UserQuitLast = CTS.Game.Fish.Player[player].Nickname;
  3585. CTS.Game.Fish.Player.splice(player, 1);
  3586. }
  3587. if (!exists) return true;
  3588. }
  3589. }
  3590. if (!exists) {
  3591. return false;
  3592. } else {
  3593. return -1;
  3594. }
  3595. } else {
  3596. return len - 1;
  3597. }
  3598. },
  3599.  
  3600. listPlayers: function() {
  3601. var msg = "[FISHING BOAT]\nTOP 5 PLAYERS:\n",
  3602. place = 0;
  3603. for (var u = arguments[0]; u >= 0; u--) {
  3604. place++;
  3605. if (u < 5) {
  3606. msg += place + ":" + CTS.Game.Fish.Player[u].Nickname + "[$" + CTS.Game.Fish.Player[u].Points + "]\n";
  3607. }
  3608. CTS.Game.Fish.Player[u].Upgrades.Insurance = false;
  3609. CTS.Game.Fish.Player[u].Points += 10000;
  3610. }
  3611. Send("msg", msg);
  3612. },
  3613.  
  3614. winner: function() {
  3615. CTS.Game.Fish.Player.sort(function(a, b) {
  3616. return a.Points - b.Points;
  3617. });
  3618. if (CTS.Game.Fish.HighScore[1] < CTS.Game.Fish.Player[0].Points) {
  3619. Send("msg", "[FISHING HIGH SCORE]\nNEW HIGH SCORE,\nKeep going " + CTS.Game.Fish.Player[0].Nickname + "!");
  3620. CTS.Game.Fish.HighScore = [CTS.Game.Fish.Player[0].Nickname, CTS.Game.Fish.Player[0].Points];
  3621. Save("FishHighScore", JSON.stringify(CTS.Game.Fish.HighScore));
  3622. }
  3623. var len = CTS.Game.Fish.Player.length - 1;
  3624. 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!");
  3625. this.listPlayers(len);
  3626. CTS.Game.Fish.RestockTimeout = setTimeout(function(g) {
  3627. g.reset(false, true);
  3628. }, 30000, this);
  3629. },
  3630. //PRICELIST
  3631. pricelist: function(playerExist, item) {
  3632. if (item == 0) { // net
  3633. return (1000 * playerExist.Upgrades.Net * playerExist.Upgrades.Net * playerExist.Upgrades.Net);
  3634. } else if (item == 1) { // radar
  3635. return (1000 * playerExist.Upgrades.Radar * 2) + 3500;
  3636. } else if (item == 2) { // shop
  3637. return (playerExist.Upgrades.Store * playerExist.Upgrades.Store * 25000);
  3638. } else if (item == 3) { // insurance
  3639. return (20000);
  3640. } else if (item == 4) { // rob
  3641. return (10000);
  3642. } else if (item == 5) { // slap
  3643. return (50000);
  3644. } else if (item == 6) { // split (min$) / gamble
  3645. return (1000);
  3646. }
  3647. },
  3648. //GAMEPLAY
  3649. cast: function() {
  3650. clearTimeout(CTS.Game.Fish.StartTimeout);
  3651. if (CTS.Host === CTS.Me.handle) {
  3652. if (this.getPlayer() >= 0) {
  3653. if (CTS.Game.Fish.Round < 10) {
  3654. CTS.Game.Fish.Round++;
  3655. var playerlen,
  3656. fishlen = CTS.Game.Fish.TypesOfFish.length - 1,
  3657. id,
  3658. type,
  3659. handle,
  3660. eliminate = false,
  3661. msgeliminate,
  3662. value,
  3663. msg = "[FISHING BOAT]\n";
  3664. for (var cast = 0; cast <= 2; cast++) {
  3665. playerlen = this.getPlayer();
  3666. id = Rand(0, playerlen);
  3667. type = Rand(CTS.Game.Fish.Player[id].Upgrades.Radar, fishlen);
  3668. if (Rand(0, 100) <= Rand(10, 70)) {
  3669. var net = Rand(1, CTS.Game.Fish.Player[id].Upgrades.Net);
  3670. value = (net * CTS.Game.Fish.TypesOfFish[type][1] * 40 * CTS.Game.Fish.Player[id].Upgrades.Store);
  3671. if (CTS.Game.Fish.TypesOfFish[type][2] === true) {
  3672. CTS.Game.Fish.Player[id].Points += value;
  3673. 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");
  3674. } else {
  3675. if (!CTS.Game.Fish.Player[id].Upgrades.Insurance) {
  3676. CTS.Game.Fish.Player[id].Points -= value;
  3677. 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");
  3678. } else {
  3679. 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");
  3680. }
  3681. }
  3682. } else {
  3683. cast--;
  3684. }
  3685. if (this.getPlayer() == -1) break;
  3686. if (CTS.Game.Fish.Player[id].Points < 0) {
  3687. eliminate = true;
  3688. handle = CTS.Game.Fish.Player[id].Handle;
  3689. msgeliminate = "[FISHING BOAT]\n" + (CTS.Game.Fish.Player[id].Nickname.substr(0, 16) + "...\nCan walk the plank for costing me my moneys!");
  3690. CTS.Game.Fish.Player.splice(id, 1);
  3691. break;
  3692. }
  3693. }
  3694. if (msg !== "[FISHING BOAT]\n") Send("msg", msg);
  3695. if (eliminate) {
  3696. eliminate = false;
  3697. Send("msg", msgeliminate);
  3698. }
  3699. CTS.Game.Fish.ReCastTimeout = setTimeout(function(g) {
  3700. g.cast();
  3701. }, Rand(90000, 120000), this);
  3702. } else {
  3703. this.winner();
  3704. }
  3705. } else {
  3706. //RESTART
  3707. Fish.stop();
  3708. }
  3709. }
  3710. },
  3711. //STOPPERS
  3712. reset: function(stop, bypass) {
  3713. var get = this.getPlayer();
  3714. if (get !== undefined) {
  3715. if (get >= 0 && !CTS.Game.NoReset || bypass !== undefined) {
  3716. CTS.Game.Fish.Round = 0;
  3717. clearTimeout(CTS.Game.Fish.StartTimeout);
  3718. clearTimeout(CTS.Game.Fish.RestockTimeout);
  3719. clearTimeout(CTS.Game.Fish.ReCastTimeout);
  3720. clearTimeout(CTS.Game.Fish.NotEnoughTimeout);
  3721. if (!stop) {
  3722. this.init();
  3723. } else {
  3724. if (CTS.Game.Fish.Player.length > 0) Send("msg", "[FISHING BOAT]\nWelp... Boat sank! I'm not refunding anyone!");
  3725. CTS.Game.Fish.Player = [];
  3726. }
  3727. }
  3728. }
  3729. },
  3730.  
  3731. stop: function() {
  3732. CTS.Game.NoReset = false;
  3733. this.reset(true, true);
  3734. }
  3735. };
  3736. var FishList = {
  3737. fish: function(playerExist, user) {
  3738. Fish.addPlayer(user.handle, user.username, user.nick);
  3739. },
  3740.  
  3741. fishbank: function(playerExist) {
  3742. if (playerExist !== -1 && FishTimerCheck(playerExist)) Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname.substr(0, 16) + ", you have $" + playerExist.Points + ".");
  3743. },
  3744.  
  3745. fishrob: function(playerExist, target) {
  3746. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3747. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  3748. FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 4), Rand(5000, 20000), true);
  3749. }
  3750. },
  3751. fishgamble: function(playerExist) {
  3752. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3753. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 6))) {
  3754. var winnings;
  3755. if (Rand(1, 10) === 7) { // 10% chance
  3756. winnings = Rand(1000, 25000);
  3757. playerExist.Points += winnings;
  3758. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
  3759. } else {
  3760. if (Rand(1, 7) === 4) { // 15%
  3761. winnings = Rand(1000, 5000);
  3762. playerExist.Points += winnings;
  3763. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " you've won $" + winnings);
  3764. } else {
  3765. Send("msg", "[FISHING BOAT]\n" + playerExist.Nickname + " tough luck, you lost $1000!");
  3766. }
  3767. }
  3768. }
  3769. }
  3770. },
  3771. fishslap: function(playerExist, target) {
  3772. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3773. var user = UsernameToUser(target.toUpperCase());
  3774. if (user !== -1) {
  3775. if (CTS.UserList[user].broadcasting && CTS.UserList[user].handle !== CTS.Me.handle) {
  3776. if (CTS.Me.owner || !CTS.UserList[user].mod) {
  3777. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 5))) {
  3778. Send("stream_moder_close", CTS.UserList[user].handle);
  3779. Send("msg", playerExist.Nickname + " has paid to close your camera " + CTS.UserList[user].nick + "!");
  3780. }
  3781. } else {
  3782. Send("msg", "Cannot close moderator!");
  3783. }
  3784. } else {
  3785. Send("msg", "Cannot close user!");
  3786. }
  3787. }
  3788. }
  3789. },
  3790.  
  3791. fishsplit: function(playerExist, target) {
  3792. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3793. var CanEliminate = Fish.getPlayer(UsernameToHandle(target.toUpperCase()), false, true);
  3794. FishTransfer(playerExist, CanEliminate, Fish.pricelist(playerExist, 6), Math.round(playerExist.Points / 2), false);
  3795. }
  3796. },
  3797.  
  3798. fishupgrade: function(playerExist) {
  3799. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 0);
  3800. },
  3801.  
  3802. fishhelp: function(playerExist) {
  3803. if (playerExist !== -1 && FishTimerCheck(playerExist)) FishUpgradeStatus(playerExist, 6);
  3804. },
  3805.  
  3806. fishupgradenet: function(playerExist) {
  3807. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3808. if (playerExist.Upgrades.Net >= 10) {
  3809. Send("msg", playerExist.Nickname + ", you own all upgrades.");
  3810. } else {
  3811. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 0))) {
  3812. playerExist.Upgrades.Net += 1;
  3813. FishUpgradeStatus(playerExist, 1);
  3814. }
  3815. }
  3816. }
  3817. },
  3818.  
  3819. fishupgradeshop: function(playerExist) {
  3820. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3821. if (playerExist.Upgrades.Store >= 6) {
  3822. Send("msg", playerExist.Nickname + ", you own them all already!");
  3823. } else {
  3824. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 2))) {
  3825. playerExist.Upgrades.Store += 1;
  3826. FishUpgradeStatus(playerExist, 4);
  3827. }
  3828. }
  3829. }
  3830. },
  3831.  
  3832. fishupgraderadar: function(playerExist) {
  3833. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3834. if (playerExist.Upgrades.Radar >= 20) {
  3835. Send("msg", playerExist.Nickname + ", you own all upgrades.");
  3836. } else {
  3837. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 1))) {
  3838. playerExist.Upgrades.Radar += 5;
  3839. FishUpgradeStatus(playerExist, 2);
  3840. }
  3841. }
  3842. }
  3843. },
  3844.  
  3845. fishupgradeinsurance: function(playerExist) {
  3846. if (playerExist !== -1 && FishTimerCheck(playerExist)) {
  3847. if (playerExist.Upgrades.Insurance === true) {
  3848. Send("msg", playerExist.Nickname + ", you already have insurance!");
  3849. } else {
  3850. if (FishTransaction(playerExist, Fish.pricelist(playerExist, 3))) {
  3851. playerExist.Upgrades.Insurance = true;
  3852. FishUpgradeStatus(playerExist, 3);
  3853. }
  3854. }
  3855. }
  3856. }
  3857. };
  3858. //MISC FUNCTION
  3859. function debug() {
  3860. if (window.DebugClear === false) {
  3861. if (arguments[0] !== undefined) {
  3862. var msg = "CTS::" + arguments[0];
  3863. if (arguments[1]) msg = msg + "\n" + JSON.stringify(arguments[1]);
  3864. console.log(msg);
  3865. }
  3866. } else {
  3867. console.clear();
  3868. 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");
  3869. }
  3870. }
  3871.  
  3872. function Reset() {
  3873. CTS.UserList = [];
  3874. CTS.Me = [];
  3875. CTS.Room = [];
  3876. CTS.SendQueue = [];
  3877. CTS.Camera.List = [];
  3878. CTS.Camera.List = [];
  3879. CTS.WaitToVoteList = [];
  3880. CTS.WatchList = [];
  3881. CTS.Host = 0;
  3882. CTS.HostAttempt = 0;
  3883. CTS.HostWaiting = false;
  3884. CTS.TempIgnoreList = [];
  3885. // Fish Reset
  3886. Fish.stop();
  3887. }
  3888.  
  3889. function Remove() {
  3890. return (arguments[1] !== undefined) ? arguments[0].querySelector(arguments[1]).parentNode.removeChild(arguments[0].querySelector(arguments[1])) : arguments[0].parentNode.removeChild(arguments[0]);
  3891. }
  3892. })();