CosmosisT's TinyChat Script (CTS V1.6.90)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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