CosmosisT's TinyChat Script (CTS V1.6.86)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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