CosmosisT's TinyChat Script (CTS V1.6.33)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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