CosmosisT's TinyChat Script (CTS V1.8.420)

Modified TinyChat - Best Scripts; prepare to be amazed.

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

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