CosmosisT's TinyChat Script (CTS V1.8.421)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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