CosmosisT's TinyChat Script (CTS V1.8.65)

Modified TinyChat - Best Scripts; prepare to be amazed.

当前为 2024-04-03 提交的版本,查看 最新版本

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